Cod sursa(job #2918775)
| Utilizator | Data | 12 august 2022 22:33:47 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.64 kb |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define po pop_back
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
unordered_set<int> x;
int q;
fin >> q;
int n, tmp;
while (q--)
{
fin >> n >> tmp;
if (n == 1)
{
x.insert(tmp);
}
else if (n == 2)
{
x.erase(tmp);
}
else
{
if (x.count(tmp) == 1)
{
fout << 1 << '\n';
}
else
fout << 0 << '\n';
}
}
}