Cod sursa(job #2981017)

Utilizator IanisBelu Ianis Ianis Data 17 februarie 2023 01:59:38
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.5 kb
#include <algorithm>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>

using namespace std;

#ifdef LOCAL
ifstream fin("input.txt");
#define fout cout
#else
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
#define endl '\n'
#endif

int n;
map<int, bool> mp;
int t, x;

int main() {
    fin >> n;
    while (n--) {
        fin >> t >> x;
        if (t == 1) mp[x] = 1;
        else if (t == 2) mp[x] = 0;
        else fout << mp[x] << endl;
    }
    return 0;
}