Cod sursa(job #2550425)
Utilizator | Data | 18 februarie 2020 19:50:30 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map <int,int> a;
int n;
int main()
{
fin >> n;
for(;n;n--)
{
int x,y;
fin >> x >> y;
if(x==1)
a[y]=y;
if(x==2 and a.find(y)!=a.end())
a.erase(a.find(y));
if(x==3)
fout << (a.find(y)!=a.end()) << "\n";
}
return 0;
}