Cod sursa(job #2173530)

Utilizator infomaxInfomax infomax Data 15 martie 2018 22:38:11
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.44 kb
#include <bits/stdc++.h>

using namespace std;

ifstream F("hashuri.in");
ofstream G("hashuri.out");

int n, q, x, ok;
unordered_map<int, int>m;

int main()
{
    F.tie(0);G.tie(0);
    F >> n;
    while(n--){
        F >> q >> x;
        if(q==1){
            m[x]=1;
        }
        else{
            if(q==2){
                if(m[x]) m[x]=0;
            }
            else G<<m[x]<<'\n';
        }
    }
    return 0;
}