Cod sursa(job #398292)
| Utilizator | Data | 18 februarie 2010 13:33:27 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.48 kb |
#include<fstream.h>
#include<set>
using namespace std;
int N,K,x,y;
set<int> V;
int main()
{
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin>>N;
for(int i=1;i<=N;++i)
{
fin>>x;
if(x==1)
{
fin>>y;
V.insert(y);
}
if(x==2)
{
fin>>y;
V.erase(y);
}
if(x==3)
{
fin>>y;
if(V.find(y)!=V.end())
fout<<"1"<<"\n";
else
fout<<"0"<<"\n";
}
}
}
