Cod sursa(job #2837674)
Utilizator | Data | 22 ianuarie 2022 13:20:11 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.54 kb |
#include <cstdio>
#include <unordered_map>
using namespace std;
int main() {
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
int n, x, type;
unordered_map<int, bool> H;
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%d %d", &type, &x);
switch (type) {
case 1:
H[x] = true;
break;
case 2:
H[x] = false;
break;
case 3:
printf("%d\n", H[x]);
break;
}
}
return 0;
}