Cod sursa(job #2417576)
| Utilizator | Data | 30 aprilie 2019 14:25:51 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.52 kb |
#include <bits/stdc++.h>
using namespace std;
int n, t, x;
unordered_set<int>st;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%d",&n);
for (int i=1;i<=n;++i)
{
scanf("%d %d",&t,&x);
if (t == 1)
st.insert(x);
else
if (t == 2)
st.erase(x);
else
{
printf("%d\n",(st.find(x)!=st.end()));
}
}
fclose(stdin);
fclose(stdout);
return 0;
}
