Cod sursa(job #1195607)
Utilizator | Data | 8 iunie 2014 09:19:44 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.51 kb |
#include <cstdio>
#include <unordered_map>
using namespace std;
unordered_map<int,int> hashin;
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 ){
hashin[y]=1;
continue;
}
if ( x==2 ){
hashin[y]=0;
continue;
}
fprintf(h,"%d\n",hashin[y]);
}
return 0;
}