Cod sursa(job #1419133)
Utilizator | Data | 14 aprilie 2015 19:12:46 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
unordered_map<int,int> has;
int n,x,a;
int main()
{
fstream f("hashuri.in",ios::in);
fstream g("hashuri.out",ios::out);
f>>n;
for(int i = 0; i < n; ++i)
{
f>>a>>x;
if(a==1)
has[x]=1;
if(a==2)
has[x]=0;
if(a==3)
g<<has[x]<<'\n';
}
return 0;
}