Cod sursa(job #2974043)
Utilizator | Data | 2 februarie 2023 23:04:48 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.42 kb |
#include <bits/stdc++.h>
using namespace std;
int n,op,x;
unordered_map<int, bool> mp;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
fin >> n;
while(n--){
fin >> op >> x;
if(op == 1){
mp[x] = 1;
}else if(op == 2){
mp[x] = 0;
}else{
fout << ( mp.count(x) ? mp[x] : 0) << "\n";
}
}
return 0;
}