Cod sursa(job #2445348)
Utilizator | Data | 3 august 2019 18:07:12 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.48 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
map <int,int> v;
int n,nr;
int main(){
int i, type, x;
f >> n;
while(n--){
f >> type >> x;
if(type == 1){
if(v.find(x) == v.end())
v[x] = ++nr;
}else
if(type == 2)
v.erase(x);
else
g << (v.find(x) != v.end()) << "\n";
}
return 0;
}