Cod sursa(job #1037958)
Utilizator | Data | 20 noiembrie 2013 21:35:00 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.37 kb |
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, x, t;
unordered_map<int, int> m;
int main()
{
f>>n;
while(n--){
f>>t>>x;
if(t==1) m[x]=1;
if(t==2) m.erase(x);
if(t==3) g<<(m.find(x)!=m.end())<<'\n';
}
return 0;
}