Pagini recente » Cod sursa (job #3350568) | Monitorul de evaluare | Cod sursa (job #3001225) | Cod sursa (job #933127)
Cod sursa(job #933127)
#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;
}