Cod sursa(job #1973312)
Utilizator | Data | 24 aprilie 2017 20:25:27 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include <stdio.h>
#include <map>
FILE *f1 = fopen("hashuri.in","r");
FILE *f2 = fopen("hashuri.out","w");
std::map<int,bool> h;
int n,op,el;
int main()
{
fscanf(f1,"%d",&n);
while(n--)
{
fscanf(f1,"%d%d",&op,&el);
if(op == 1)
h[el] = true;
if(op == 2)
h[el] = false;
if(op == 3)
fprintf(f2,"%d\n",h[el]);
}
return 0;
}