Cod sursa(job #2074016)
| Utilizator | Data | 23 noiembrie 2017 23:16:20 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.54 kb |
#include <fstream>
#include <map>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
const int p = 666013;
map <int, int>dict[p + 2];
int n, q, x;
int main(){
in >> n;
while (n > 0){
in >> q >> x;
if (q == 1){
dict[x % p][x] = 1;
}
if (q == 2){
if (dict[x % p].count(x))
dict[x % p].erase(x);
}
if (q == 3){
if (dict[x % p].count(x))
out << 1 << '\n';
else
out << 0 << '\n';
}
n --;
}
return 0;
}
