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