Mai intai trebuie sa te autentifici.
Cod sursa(job #2933207)
Utilizator | Data | 4 noiembrie 2022 20:35:49 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
#include <bits/stdc++.h>
using namespace std;
map<long long, bool>m;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
void ins(int x)
{
m[x] = true;
}
void ers(int x)
{
m[x] = false;
}
void ct(int x)
{
fout << m[x] << '\n';
}
int main()
{
int nrop, op, x;
fin >> nrop;
for(int j = 1; j <= nrop; ++ j)
{
fin >> op >> x;
if(op == 1)
ins(x);
else if(op == 2)
ers(x);
else
ct(x);
}
return 0;
}