Cod sursa(job #933127)
| Utilizator | Data | 29 martie 2013 17:14:13 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.5 kb |
#include<fstream>
#include<unordered_set>
#define MOD 10000
using namespace std;
unordered_set <int> G[MOD];
short list;
int main()
{
int n,choice,x;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin>>n;
while(n--)
{
fin>>choice>>x;
list=x%MOD;
if(choice==1)
{
G[list].insert(x);
continue;
}
if(choice==2)
{
G[list].erase(x);
continue;
}
fout<<(G[list].find(x)!=G[list].end())<<'\n';
}
fin.close();
fout.close();
return 0;
}
