Cod sursa(job #1914279)
| Utilizator | Data | 8 martie 2017 16:16:30 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
#include <fstream>
#include <map>
using namespace std;
ifstream cin ("hashuri.in" );
ofstream cout("hashuri.out");
map <int, int> M;
int main()
{
int y, x, n, m;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> y >> x;
if (y == 1 && M.find(x) == M.end()) M[x] = ++ m;
if (y == 2) M.erase(x);
if (y == 3) cout << ((bool)(M.find(x) != M.end())) << '\n';
}
return 0;
}
