Pagini recente » Cod sursa (job #615494) | Cod sursa (job #40862) | Cod sursa (job #2053481) | Cod sursa (job #767027) | Cod sursa (job #633462)
Cod sursa(job #633462)
#include <fstream>
#include <map>
#define p 666013
using namespace std;
int main()
{
long n, o, x;
map<int, int> h;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin>>n;
for (long i=0; i<n; i++)
{
fin>>o>>x;
if (o==1)
if (h.find(x)==h.end())
h[x]=x%p;
if (o==2)
h.erase(x);
if (o==3)
fout<<(h.find(x)!=h.end())<<"\n";
}//for i
return 0;
}//main