Pagini recente » Cod sursa (job #205675) | Cod sursa (job #2481582) | Cod sursa (job #725406) | Cod sursa (job #2372511) | Cod sursa (job #2805924)
#include<fstream>
#include<vector>
#define mod 100007
using namespace std;
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
vector<vector<long long> >mat;
long long c,x,n;
int main()
{
mat.resize(mod+1);
cin>>n;
for(int i=1; i<=n; i++)
{
cin>>c>>x;
if(c==1)
{
int ok=0;
for(int j=0; j<mat[x%mod].size(); j++)
if(mat[x%mod][j]==x/mod)
{
ok=1;
break;
}
if(ok==0)
mat[x%mod].push_back(x/mod);
}
else if(c==2)
{
for(int j=0; j<mat[x%mod].size(); j++)
if(mat[x%mod][j]==x/mod)
{
mat[x%mod].erase(mat[x%mod].begin()+j);
break;
}
}
else
{
int ok=0;
for(int j=0; j<mat[x%mod].size(); j++)
if(mat[x%mod][j]==x/mod)
{
ok=1;
break;
}
cout<<ok<<'\n';
}
}
}