Pagini recente » Cod sursa (job #2546443) | Cod sursa (job #1592305) | Cod sursa (job #2448363) | Cod sursa (job #1622442) | Cod sursa (job #2550389)
#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;
auto it=a.find(y);
bool ok=(it!=a.end());
if(x==1 and !ok)
a[y]=y;
if(x==2 and ok)
a.erase(it);
if(x==3 and ok)
fout << 1 << "\n";
if(x==3 and !ok)
fout << 0 << "\n";
}
return 0;
}