Cod sursa(job #265565)
| Utilizator | Data | 24 februarie 2009 02:33:36 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.59 kb |
#include <fstream>
#include <vector>
#include <algorithm>
#include <ext/hash_map>
using __gnu_cxx::hash_map;
using namespace std;
hash_map<int, int> H;
int main() {
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n;
fin >> n;
while (n--) {
int op, X;
fin >> op >> X;
if (op == 1) ++H[X];
if (op == 2) --H[X];
if (op == 3)
{
if (H[X]) fout << "1\n";
else
fout << "0\n";
}
}
return 0;
}
