Cod sursa(job #2577036)
Utilizator | Oanta Cristian cristian51090 | Data | 8 martie 2020 01:27:56 |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.62 kb |
#define _CRT_SECURE_NO_WARNINGS
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
register int n,i,j,l;
unordered_map<int,int> x;
fin>>n;
for(l=1;l<=n;l++){
fin>>i>>j;
if(i==1)
x.insert(x.begin(),{j,1});
else if(i==2)
x.erase(j);
else{
if(x.find(j)!=x.end())
fout << "1\n";
else fout << "0\n";
}
}
return 0;
}