Pagini recente » Cod sursa (job #1400456) | Cod sursa (job #1595922) | Cod sursa (job #774777) | Cod sursa (job #1627651) | Cod sursa (job #2194200)
#include <bits/stdc++.h>
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define sz size
#define pb push_back
#define er erase
#define in insert
#define fr first
#define sc second
#define mp make_pair
#define pi pair
#define _ ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
#define rc(s) return cout<<s,0
const int huh=666013;
using namespace std;
std::vector<int>::iterator it;
vector<int>lel[huh];
int n;
int x;
int t;
bool lol;
bool findo(int y){
int iopta=y%huh;
for(int i=0;i<lel[iopta].size();i++){
if(lel[iopta][i]==y) return true;
}
return false;
}
int main(){ _
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
scanf("%d", &n);
while(n--){
scanf("%d %d", &t, &x);
int you=x%huh;
if(t==1){
if(findo(x)==false)lel[you].push_back(x);
continue;
}
if(t==2){
it=lel[you].begin();
while(it!=lel[you].end()){
if(*it==x){ lel[you].erase(it); break; }
it++;
}
continue;
}
if(findo(x)==true) cout<<1<<endl;
else cout<<0<<endl;
}
}