Cod sursa(job #2173538)

Utilizator infomaxInfomax infomax Data 15 martie 2018 22:40:32
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.47 kb
#include <bits/stdc++.h>

using namespace std;

FILE *F=fopen("hashuri.in", "r"), *G=fopen("hasuri.out", "w");

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

int main()
{
    fscanf(F, "%d", &n);
    while(n--){
        fscanf(F, "%d%d", &q, &x);
        if(q==1){
            m[x]=1;
        }
        else{
            if(q==2){
                if(m[x]) m[x]=0;
            }
            else fprintf(G, "%d\n", m[x]);
        }
    }
    return 0;
}