Cod sursa(job #2400647)
Utilizator | Data | 8 aprilie 2019 23:08:54 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.47 kb |
#include <fstream>
#include <map>
typedef unsigned long long ll;
using namespace std;
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
int n, k;
map<int, int> a;
int main() {
cin >> n;
while(n--) {
int h, cer;
cin >> cer >> h;
switch(cer) {
case 1:
if(a.find(h) == a.end())
a[h] = ++k;
break;
case 2:
a.erase(h);
break;
case 3:
cout << (a.find(h) != a.end()) << '\n';
break;
}
}
return 0;
}