Cod sursa(job #2155905)
| Utilizator | Data | 8 martie 2018 11:38:17 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.5 kb |
#include <iostream>
#include <fstream>
#include <set>
#include <map>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int n;
map<int,int>v;
int main()
{
in>>n;
int op,aux = 0;
for(int i = 0; i < n; i++){
int x;
in>>op>>x;
if(op == 1 && v.find(x) == v.end())
v[x] = ++aux;
else if(op == 2)
v.erase(x);
else
out<<(v.find(x) != v.end())<<"\n";
}
return 0;
}
