Cod sursa(job #1901916)
| Utilizator | Data | 4 martie 2017 11:58:19 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.42 kb |
#include <bits/stdc++.h>
using namespace std;
int n;
map <int,int> hasht;
int main()
{
ifstream in ("hashuri.in");
ofstream out ("hashuri.out");
in >> n;
while (n--)
{
int op, x;
in >> op >> x;
if(op == 1)
hasht[x] = 1;
else if(op == 2)
hasht.erase(x);
else
out << (hasht.find(x) != hasht.end()) << '\n';
}
in.close();
out.close();
return 0;
}
