Cod sursa(job #2722600)
| Utilizator | Data | 13 martie 2021 00:48:22 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.49 kb |
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n;
unordered_map <int, bool> m;
int main()
{
f >> n;
int c, x;
for(int i = 1; i <= n; ++i) {
f >> c >> x;
if(c == 1)
m[x] = true;
else if(c == 2) {
if(m[x])
m[x] = false;
}
else if(c == 3) g << (m[x] ? "1\n" : "0\n");
}
}
