Cod sursa(job #1037943)
Utilizator | Data | 20 noiembrie 2013 21:25:00 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <fstream>
#include <map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,t,i,x;
map <int,int >a;
int main()
{
f>>n;
for (i=1;i<=n;i++)
{
f>>t>>x;
if (t==1 && a.find(x)==a.end())
a[x]=1;
if (t==2 && a.find(x)!=a.end())
a.erase(x);
if (t==3)
g<<(a.find(x)!=a.end())<<'\n';
}
f.close();
g.close();
}