Pagini recente » Cod sursa (job #2222062) | Cod sursa (job #2408188) | Cod sursa (job #2605985) | Cod sursa (job #914379) | Cod sursa (job #2194124)
#include <bits/stdc++.h>
#define ll long long
#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 mod=1e9+7;
const int inf=1e5;
const int huh=6e5;
using namespace std;
vector<ll>lel[huh];
int n;
ll x;
int t;
bool lol;
int main(){
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin >> n;
for(int i=1;i<=n;i++){
fin >> t >> x;
if(t==1){
lel[x%huh].push_back(x);
continue;
}
if(t==2){
for(int j=0;j<lel[x%huh].size();j++){
if(lel[x%huh][j]==x) lel[x%huh].erase(lel[x%huh].begin()+j-1);
}
continue;
}
if(t==3){
lol=true;
for(int j=0;j<lel[x%huh].size();j++){
if(lel[x%huh][j]==x){fout<<1<<endl; lol=false; break;}
}
if(lol==true) fout<<0<<endl;
}
}
}