Cod sursa(job #1037964)
| Utilizator | Data | 20 noiembrie 2013 21:38:59 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.48 kb |
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, x, t;
class hash_f{
public:
long operator()(const int &k) const{
return k%666013;
}
};
unordered_map<int, int, hash_f> 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;
}
