Mai intai trebuie sa te autentifici.
Cod sursa(job #2450180)
Utilizator | Data | 22 august 2019 11:35:39 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.52 kb |
#include <cstdio>
#include <unordered_set>
using namespace std;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n;
scanf("%d",&n);
unordered_set <int> s;
s.rehash(n);
while(n--)
{
int t,x;
scanf("%d%d",&t,&x);
if(t==1) s.insert(x);
if(t==2) s.erase(x);
if(t==3) printf("%d\n",s.count(x));
}
return 0;
}