Cod sursa(job #2616141)

Utilizator srazvan100@gmail.comRazvan Alexandru Sandu [email protected] Data 16 mai 2020 20:06:40
Problema Hashuri Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.39 kb
#include <bits/stdc++.h>
using namespace std;

int main() {
    // ifstream cin("hashuri.in", ios::in);
    // ofstream cout("hashuri.out", ios::out);
    map<int, int> m;
    int n;
    cin >> n;
    int tip, value;

    while (n--) {
        cin >> tip >> value;
        if (tip == 1) m[value] = 1;
        if (tip == 2) m.erase(value);
        if (tip == 3) cout << (m.find(value) != m.end());
    }
}