Cod sursa(job #2715835)
Utilizator | Data | 4 martie 2021 12:02:19 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.41 kb |
#include <bits/stdc++.h>
#define N 50001
#define pb push_back
#define INF 1<<30
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
set <int> m;
int n,c,x;
int main()
{
f>>n;
while(n--)
{
f>>c>>x;
if(c==1)
m.insert(x);
if(c==2)
m.erase(x);
if(c==3)
g<<m.count(x)<<"\n";
}
return 0;
}