Cod sursa(job #3329450)
| Utilizator | Data | 13 decembrie 2025 10:56:28 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.4 kb |
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main() {
int n;
set<int> st;
fin >> n;
for (int i = 0; i < n; i++) {
int t, x;
fin >> t >> x;
if (t == 1)
st.insert(x);
if (t == 2)
if (st.count(x))
st.erase(x);
if (t == 3)
fout << (st.count(x) ? 1 : 0) << "\n";
}
return 0;
}
