Cod sursa(job #2743366)
Utilizator | Data | 22 aprilie 2021 21:12:50 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.56 kb |
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, x;
short int op;
map<int, int> s;
int main()
{
f >> n;
int i;
for(i = 1; i <= n; i++)
{
f >> op >> x;
switch(op){
case 1:
s[x] = 1;
break;
case 2:
s[x] = 0;
break;
default:
g << s[x] << '\n';
break;
}
}
return 0;
}