Cod sursa(job #1641440)
Utilizator | Data | 8 martie 2016 23:08:29 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.48 kb |
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int x, nrquiz, type;
unordered_map < int, int > m;
int main()
{
f >> nrquiz;
while (nrquiz)
{
nrquiz --;
f >> type >> x;
if (type == 1)
m[x] ++;
if (type == 2)
m.erase(x);
if (type == 3)
g << (m.find(x) != m.end()) << '\n';
}
return 0;
}