Cod sursa(job #2695029)
Utilizator | Data | 11 ianuarie 2021 16:03:09 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
bool t;
int x,c,n;
unordered_set<int> v;
int main()
{
f>>n;
for(int i=1;i<=n;i++)
{
f>>c>>x;
if(c == 1)
{
v.insert(x);
}
else if(c == 2)
{
v.erase(x);
}
else
{
g<<v.count(x)<<endl;
}
}
}