Cod sursa(job #2884893)
Utilizator | Data | 5 aprilie 2022 10:01:06 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.46 kb |
#include <fstream>
#include <map>
using namespace std;
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
map<int,int> mapa;
int main()
{
int n;
cin >> n;
for(int i = 1; i <= n; ++i) {
int cod, x;
cin >> cod >> x;
if(cod == 1) {
mapa[x] = 1;
}
if(cod == 2) {
mapa[x] = 0;
}
if(cod == 3) {
cout << mapa[x] << '\n';
}
}
}