Cod sursa(job #2896372)
| Utilizator | Data | 29 aprilie 2022 22:24:34 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 60 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.55 kb |
#include <bits/stdc++.h>
#include<iostream>
#include<fstream>
using namespace std;
ifstream fin ("hashuri.in");
ofstream fout ("hashuri.out");
unordered_map<int, int> hashul;
long long x;
int c,n,i;
int main()
{
fin>>n;
for(i=1;i<=n;i++)
{
fin>>c>>x;
if(c == 1)
hashul[x]=1;
else if(c == 2)
hashul.erase(x);
else if(c == 3)
if(hashul.find(x) != hashul.end())
fout<<1<<endl;
else
fout<<0<<endl;
}
return 0;
}
