Cod sursa(job #3177736)

Utilizator Razvan23Razvan Mosanu Razvan23 Data 29 noiembrie 2023 21:08:23
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.45 kb
#include <bits/stdc++.h>
using namespace std;

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

unordered_map<int, bool> fr;

int main()
{
    ios_base::sync_with_stdio(false);
    fin.tie(NULL);
    int n, x, p;
    fin >> n;
    while(n--)
    {
        fin >> p >> x;
        if(p == 1) fr[x] = 1;
        else if(p == 2) fr[x] = 0;
        else fout << fr[x] << "\n";
    }
    fin.close();
    fout.close();
    return 0;
}