Cod sursa(job #2725841)
Utilizator | Data | 19 martie 2021 19:01:40 | |
---|---|---|---|
Problema | Hashuri | Scor | 10 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
unordered_map <int,int> M;
int main()
{
int n; fin >> n;
for(int i = 1; i <= n; ++i) {
int op, x; fin >> op >> x;
if(op == 1)
M[x] += 1;
if(op == 2)
M[x] -= 1;
if(op == 3) {
if(M[x] == 0) fout << "0\n";
else fout << "1\n";
}
}
return 0;
}