Pagini recente » Cod sursa (job #559672) | Cod sursa (job #219810) | Cod sursa (job #2206648) | Cod sursa (job #1090121) | Cod sursa (job #1503180)
#include <fstream>
#include <algorithm>
#include <vector>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
const int MOD = 666013;
vector <int> V[MOD];
int N;
int main()
{
fin>>N;
while(N--)
{
int op,x;
fin>>op>>x;
int List = x%MOD;
vector <int> :: iterator it = find(V[List].begin(),V[List].end(),x);
if(op == 1)
if(it == V[List].end())
V[List].push_back(x);
if(op == 2)
if(it != V[List].end())
V[List].erase(it);
if(op == 3)
fout << (it != V[List].end())<<"\n";
}
return 0;
}