Cod sursa(job #3160100)

Utilizator not_anduAndu Scheusan not_andu Data 22 octombrie 2023 21:46:37
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.9 kb
/**
 * Author: Andu Scheusan (not_andu)
 * Created: 22.10.2023 21:42:39
*/

#include <bits/stdc++.h>
#include <unordered_map>
#pragma GCC optimize("O3")

using namespace std;

#define INFILE "hashuri.in"
#define OUTFILE "hashuri.out"

#define all(x) (x).begin(), (x).end()
#define MP make_pair
#define F first
#define S second

typedef long long ll;

void solve(){

    int n;
    unordered_map<int, bool> fr;

    cin >> n;

    for(int i = 0; i < n; ++i){

        int tip, numar;

        cin >> tip >> numar;

        if(tip == 1){
            fr[numar] = true;
        }
        else if(tip == 2){
            fr[numar] = false;
        }
        else{
            cout << fr[numar] << '\n';
        }

    }

}

int main(){
    
    ios_base::sync_with_stdio(false);

    freopen(INFILE, "r", stdin);
    freopen(OUTFILE, "w", stdout);

    cin.tie(nullptr);
    cout.tie(nullptr);

    solve();

    return 0;
}