Pagini recente » Cod sursa (job #1929901) | Cod sursa (job #2596705) | Cod sursa (job #2832237) | Cod sursa (job #1652005) | Cod sursa (job #2416542)
#include <bits/stdc++.h>
using namespace std;
vector<int> hashfct[1000005];
int main()
{
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n, mod = 666013;
fin >> n;
for(int i = 1; i <= n; ++i){
int op, x;
fin >> op >> x;
if(op == 1) hashfct[x % mod].push_back(x);
else if(op == 2){
for(int i = 0; i < int(hashfct[x % mod].size()); ++i)
if(hashfct[x % mod][i] == x) hashfct[x % mod].erase(hashfct[x % mod].begin() + i);
}
else{
bool ans = 0;
for(int i = 0; i < int(hashfct[x % mod].size()); ++i)
if(hashfct[x % mod][i] == x){
ans = 1;
break;
}
fout << ans << "\n";
}
}
return 0;
}