Pagini recente » Cod sursa (job #1362183) | Cod sursa (job #3271126) | Cod sursa (job #491295) | Cod sursa (job #1435653) | Cod sursa (job #1072148)
#include <algorithm>
#include <fstream>
#include <vector>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
const int mod= 6613;
vector <int> v[mod];
int check( int x ) {
int ch= 0;
for ( vector <int>::iterator it= v[x%mod].begin(); it!=v[x%mod].end(); ++it ) {
if ( *it==x ) {
ch= 1;
break;
}
}
return ch;
}
int main( ) {
int n;
fin>>n;
for ( ; n>0; --n ) {
int x, y;
fin>>x>>y;
if ( x==1 && check(y)==0 ) {
v[y%mod].push_back(y);
} else if ( x==2 && check(y)==1 ) {
v[y%mod].erase( find( v[y%mod].begin(), v[y%mod].end(), y ) );
} else if ( x==3 ) {
fout<<check(y)<<"\n";
}
}
return 0;
}