Cod sursa(job #1155706)
| Utilizator | Data | 27 martie 2014 09:15:59 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.42 kb |
#include <iostream>
#include <fstream>
#include <map>
#define TEST 666133
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, nr, type, x;
map<int, int> m;
int main()
{
f >> n;
nr = 0;
for(int i = 0; i < n; ++i)
{
f >> type >> x;
x %= TEST;
if(type == 1 && m.find(x) == m.end())
m[x] = nr++;
if(type == 2)
m.erase(x);
if(type == 3)
g << (m.find(x) != m.end()) << "\n";
}
}
