Cod sursa(job #2574347)

Utilizator bogdanvladmihaiBogdan Vlad-Mihai bogdanvladmihai Data 5 martie 2020 21:41:38
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.49 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("hashuri.in");
ofstream fout("hashuri.out");

int n;

unordered_map <int, bool> mp;

int main() {
  int op, value;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  fin >> n;
  mp.reserve(n);
  while (n --) {
    fin >> op >> value;
    if (op == 1) {
      mp[value] = 1;
    } else if (op == 2) {
      mp[value] = 0;
    } else {
      fout << mp[value] << "\n";
    }
  }
  return 0;
}