Cod sursa(job #1047909)
Utilizator | Data | 4 decembrie 2013 23:28:42 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.41 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
unordered_set<int> h;
int t, x, n, i;
int main()
{
cin>>n;
for(i=1; i<=n; i++)
{
cin>>t>>x;
if(t==1) h.insert(x);
else
if(t==2) h.erase(x);
else
if(t==3) cout<<(h.find(x)!=h.end())<<'\n';
}
return 0;
}