Cod sursa(job #1233368)

Utilizator usermeBogdan Cretu userme Data 25 septembrie 2014 10:58:39
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.5 kb
#include <cstdio>
#include <unordered_map>

using namespace std;

unordered_map <int,int> hashhash;

FILE*f=fopen("hash.in","r");
FILE*h=fopen("hash.out","w");

int main(){
    int n;
    fscanf(f,"%d",&n);
    for ( int i=1;i<=n;++i ){
        int x,y;
        fscanf(f,"%d%d",&x,&y);
        if ( x==1 ){
            hashhash[y]=1;
            continue;
        }
        if ( x==2 ){
            hashhash[y]=0;
            continue;
        }
        fprintf(h,"%d\n",hashhash[y]);
    }
    return 0;
}