Cod sursa(job #2442597)
Utilizator | Data | 24 iulie 2019 14:41:25 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.36 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
map <int,int> m;
int main()
{ int n;
f>>n;
while(n--)
{ int t,x;
f>>t>>x;
if(t==1 && m.find(x)==m.end()) m[x]=1;
if(t==2) m.erase(x);
if(t==3) g<<(m.find(x)!=m.end())<<'\n';
}
return 0;
}