Pagini recente » Istoria paginii problema/squirrel | Diferente pentru problema/disconnect intre reviziile 25 si 24 | Istoria paginii problema/heavypath | Atasamentele paginii zombies | Cod sursa (job #1410931)
#include<fstream>
#include<set>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n,tip,x,i,hs;
int mod=666013;
set<int> s[666050];
int main()
{
fin>>n;
for(i=1;i<=n;++i)
{
fin>>tip>>x;
hs=x%mod;
if(tip==1)
{
// if(s[hs].find(x)!=s[hs].end())
s[hs].insert(x);
continue;
}
if(tip==2)
{
// if(s[hs].find(x)!=s[hs].end())
s[hs].erase(x);
continue;
}
if(tip==3)
{
if(s[hs].find(x)!=s[hs].end())
{
fout<<"1\n";
}
else
{
fout<<"0\n";
}
}
}
return 0;
}