Cod sursa(job #3329451)

Utilizator DariusJohnDarius Dumitrescu DariusJohn Data 13 decembrie 2025 10:57:28
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.41 kb
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main() {
  int n;
  unordered_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;
}