Cod sursa(job #1413233)
Utilizator | Data | 1 aprilie 2015 19:01:33 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <iostream>
#include <fstream>
#include <vector>
#include <unordered_set>
using namespace std;
const int maxn = 1000005;
const int mod = 666013;
int n;
unordered_set<int> _hash;
int main() {
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin >> n;
while(n -- ) {
int op, x;
fin >> op >> x;
if(op == 1)
_hash.insert(x);
if(op == 2)
_hash.erase(x);
if(op == 3)
fout << (_hash.find(x) != _hash.end()) << "\n";
}
}