Cod sursa(job #1233373)

Utilizator usermeBogdan Cretu userme Data 25 septembrie 2014 11:04:41
Problema Secventa 5 Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <cstdio>
#include <unordered_map>

using namespace std;

unordered_map <int,int> har;

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 ){
            har[y]=1;
            continue;
        }
        if ( x==2 ){
            har[y]=0;
            continue;
        }

        fprintf(h,"%d\n",har[y]);
    }
    return 0;
}