Cod sursa(job #1076323)
| Utilizator | Data | 10 ianuarie 2014 01:08:27 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 60 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.53 kb |
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
int N, op, el, nr = 0;
map<int, int> Map;
fin >> N;
for(int i = 0; i < N; i++){
fin >> op >> el;
if(op == 1 && Map.find(el) == Map.end()) {
Map[el] = ++nr;
}
if(op == 2) {
Map.erase(el);
}
if(op == 3) {
fout << (Map.find(el) != Map.end()) << endl;
}
}
return 0;
}
