Cod sursa(job #933110)
| Utilizator | Data | 29 martie 2013 17:04:05 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.45 kb |
#include<fstream>
#include<set>
#define MOD 10000
using namespace std;
set<int> G[MOD];
int main()
{
int n,choice,x;
short list;
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);
if(choice==2)
G[list].erase(x);
if(choice==3)
fout<<(G[list].find(x)!=G[list].end())<<'\n';
}
fin.close();
fout.close();
return 0;
}
