Cod sursa(job #3312860)

Utilizator depevladVlad Dumitru-Popescu depevlad Data 30 septembrie 2025 15:07:55
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.65 kb
#include <bits/stdc++.h>

using namespace std;

#define i32 int32_t
#define i64 int64_t

int main() {
#ifndef LOCAL
  freopen("hashuri.in", "r", stdin);
  freopen("hashuri.out", "w", stdout);
#endif
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  unordered_set<int> h;
  for (; n--;) {
    int o;
    int x;
    cin >> o >> x;
    auto i = h.find(x);
    switch (--o) {
      case 0:
        if (i == h.end()) {
          h.insert(x);
        }
        break;
      case 1:
        if (i != h.end()) {
          h.erase(x);
        }
        break;
      case 2:
        cout << (i != h.end()) << endl;
        break;
    }
  }
  return 0;
}