Pagini recente » Cod sursa (job #1223532) | Cod sursa (job #1296524) | Cod sursa (job #268564) | Cod sursa (job #1060596) | Cod sursa (job #2747366)
#include <fstream>
#include <vector>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
const int p = 750019;
int k;
vector <int> v[p];
int main() {
int n,x,y;
f>>n;
for(int i = 0 ; i < n ; ++i)
{
f>>x>>y;
if(x==1)
{
k=y%p;
bool ok =true;
for(int j = 0 ; j < v[k].size() && ok ; ++j)
if(y==v[k][j])
{
ok=false;
}
if(ok)
v[k].push_back(y);
}
else
if(x==2)
{k=y%p;
bool ok = true;
for(int j = 0 ; j < v[k].size() && ok; ++j)
if(y==v[k][j])
{
v[k][j] = -1;
ok= false;
}
}
else
{
k=y%p;
bool ok =true;
for(int j = 0 ; j < v[k].size() && ok ; ++j)
if(y==v[k][j])
{
ok=false;
g<<1<<'\n';
}
if(ok)
g<<0<<'\n';
}
}
return 0;
}