Cod sursa(job #3149366)
| Utilizator | Data | 7 septembrie 2023 19:57:45 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.53 kb |
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n, t;
unordered_map <int, int> m;
int main() {
fin >> n;
for (int i = 1; i <= n; i++) {
int x;
fin >> t >> x;
if (t == 1)
m[x] = 1;
else if (t == 2)
m[x] = 0;
else
if (m[x] == 1)
fout << "1\n";
else
fout << "0\n";
}
return 0;
}
