Pagini recente » Cod sursa (job #3179311) | Cod sursa (job #306348) | Cod sursa (job #1364494) | Cod sursa (job #1299589) | Cod sursa (job #2085892)
#include <fstream>
#include <vector>
using namespace std;
ifstream cin ("hashuri.in");
ofstream cout ("hashuri.out");
int MOD = 1000133;
vector <int> v[1001000];
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
for (int i=1; i<=n; i++){
int tip , nr;
cin>>tip>>nr;
int caut = nr % MOD;
if (tip == 1){
bool ignore = false;
for (auto &x : v[caut]){
if (x == nr){
ignore = true;
break;
}
}
if (!ignore){
v[caut].push_back(nr);
}
}
if (tip == 2){
vector <int> now;
for (auto &x : v[caut]){
if (x != nr){
now.push_back(x);
}
}
v[caut] = now;
}
if (tip == 3){
bool gasit = false;
for (auto &x : v[caut]){
if (x == nr){
gasit = true;
break;
}
}
cout<<gasit<<'\n';
}
}
return 0;
}