Cod sursa(job #2434063)
| Utilizator | Data | 30 iunie 2019 15:38:14 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.47 kb |
#include <fstream>
#include <map>
int main() {
std::ifstream cin("hashuri.in");
std::ofstream cout("hashuri.out");
std::ios::sync_with_stdio(false);
int n, op_type, x;
cin >> n;
std::map<int, int> map;
for (int i = 0 ; i < n ; ++i) {
cin >> op_type >> x;
switch(op_type) {
case 1: if (map.find(x) == map.end()) {
map[x++];
}
break;
case 2: map.erase(x);
break;
default: cout << (map.find(x) != map.end()) << '\n';
}
}
return 0;
}