Cod sursa(job #2181416)
| Utilizator | Data | 21 martie 2018 17:39:13 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.49 kb |
#include <iostream>
#include <map>
#include <unordered_set>
#include <fstream>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,op,elem,curent;
unordered_set<int>Ma;
int main()
{
f>>n;
while (n--)
{
f>>op>>elem;
if (op==1&&Ma.find(elem)==Ma.end())
Ma.insert(elem);
if (op==2)
Ma.erase(elem);
if (op==3)
g<<(Ma.find(elem)!=Ma.end())<<'\n';
}
return 0;
}
