Pagini recente » Cod sursa (job #1167604) | Cod sursa (job #1304691) | Cod sursa (job #1872191) | Cod sursa (job #636329) | Cod sursa (job #1328971)
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
#define MOD 666013
vector<int> g[666013];
int main()
{
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int n,x,y,mod=666013;
bool gasit;
in >> n;
for(int i=0;i<n;i++)
{
in >> x >> y;
if(x==1)
{
bool gasit=false;
for(int i=0;i<g[y%mod].size();i++)
if(g[y%mod][i]==y)
gasit=true;
if(!gasit)
g[y%mod].push_back(y);
}
else if(x==2)
{
gasit=false;
for(int i=0;i<g[y%mod].size();i++)
if(g[y%mod][i]==y)
g[y%mod].erase(g[y%mod].begin()+i);
}
else
{
gasit=false;
for(int i=0;i<g[y%mod].size();i++)
if(g[y%mod][i]==y)
gasit=true;
out << gasit << "\n";
}
}
return 0;
}