Pagini recente » Cod sursa (job #1279156) | Cod sursa (job #284253) | Cod sursa (job #213539) | Cod sursa (job #2201492) | Cod sursa (job #2474400)
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
//ifstream f("date.in");
//ofstream g("date.out");
const int dim = 666013;
vector <int> v[dim];
int n, op, x;
int main()
{
int i, rest, poz, j;
bool exista;
f >> n;
for(i = 1; i <= n; ++i){
f >> op >> x;
exista = 0;
rest = x % dim;
for(j = 0; j < v[rest].size(); ++j){
if(v[rest].at(j) == x){
exista = 1;
poz = j;
break;
}
}
if(op == 1 && !exista){
v[rest].push_back(x);
} else if(op == 2 && exista){
v[rest].erase(v[rest].begin() + poz);
} else if(op == 3){
g << exista << '\n';
}
}
return 0;
}