Pagini recente » Cod sursa (job #3134556) | Profil MihaelaCismaru | Cod sursa (job #872830) | Cod sursa (job #1530136) | Cod sursa (job #1909265)
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int MOD=9973,i,n,tip,x;
vector <int> ::iterator p;
vector <int> L[200001];
int main()
{
f>>n;
for(i=1;i<=n;i++)
{
f>>tip>>x;
if(tip==1)
L[x%MOD].push_back(x);
if(tip==2){
p=find(L[x%MOD].begin(),L[x%MOD].end(),x);
if(p!=L[x%MOD].end())
L[x%MOD].erase(p);
}
if(tip==3){
p=find(L[x%MOD].begin(),L[x%MOD].end(),x);
if(p!=L[x%MOD].end())
g<<1<<'\n';
else
g<<0<<'\n';
}
}
return 0;
}