Pagini recente » Cod sursa (job #2057642) | Cod sursa (job #195481) | Cod sursa (job #1510540) | Cod sursa (job #1151883) | Cod sursa (job #2266612)
#include <fstream>
#include <map>
using namespace std;
map <int, int> f[666013];
void insert (int x){
f[x%66013][x]+=1;
}
void erase (int x){
f[x%666013].erase(x);
}
bool find (int x) {
return f[x%666013].count(x)!=0;
}
int main()
{
int n;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
fin>>n;
for(int i=1;i<=n;i++){
int op,x;
fin>>op>>x;
if(op==1) insert(x);
if(op==2) erase(x);
if(op==2) fout<<find(x)<<endl;
}
return 0;
}