Cod sursa(job #2922809)
| Utilizator | Data | 10 septembrie 2022 10:13:43 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.42 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream a("hashuri.in");
ofstream b("hashuri.out");
unordered_set<int> s;
int n,t,x;
int main()
{
a>>n;
for( ; n; n--)
{
a>>t>>x;
if(t==1)
s.insert(x);
else if(t==2)
s.erase(x);
else if(s.find(x)==s.end())
b<<"0\n";
else
b<<"1\n";
}
return 0;
}
