Cod sursa(job #3342714)
| Utilizator | Data | 25 februarie 2026 13:40:17 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.55 kb |
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map <int, bool> v;
int main(){
int n;
fin>>n;
for (int i = 1; i<=n; i++){
int tip, x;
fin>>tip>>x;
if (tip == 1){
v[x]=1;
}
else if (tip == 2){
v[x]=0;
}
else{
if (v.count(x)>0){
fout<<v[x];
}
else{
fout<<0;
}
fout<<'\n';
}
}
}