Cod sursa(job #1688100)
Utilizator | Data | 13 aprilie 2016 11:36:12 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <fstream>
#include <map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int t, nr, cer, x;
map <int, int> a;
int main()
{
for (f >> t; t; t--)
{
f >> cer >> x;
if (cer == 1 && a.find(x) == a.end())
a[x] = 1;
else if (cer == 2)
a.erase(x);
else if (cer == 3)
g << (a.find(x) != a.end()) << '\n';
}
return 0;
}