Cod sursa(job #2195976)

Utilizator Constantin.Dragancea Constantin Constantin. Data 17 aprilie 2018 22:10:36
Problema Hashuri Scor 20
Compilator cpp Status done
Runda Arhiva educationala Marime 0.4 kb
#include <bits/stdc++.h>
using namespace std;

map <int,int> M;
int n;

int main(){
    ifstream cin ("hashuri.in");
    ofstream cout ("hashuri.out");
    cin >> n;
    while (n--){
        int o, x;
        cin >> o >> x;
        if (o == 1 && M.find(x) == M.end()) M[x] = 1;
        else if (o == 2) M.erase(x);
        else cout << (M.find(x) != M.end()) << "\n";
    }
    return 0;
}