Cod sursa(job #1021269)

Utilizator RobertSSamoilescu Robert RobertS Data 3 noiembrie 2013 16:26:06
Problema Hashuri Scor 30
Compilator cpp Status done
Runda Arhiva educationala Marime 0.51 kb
#include<iostream>
#include<fstream>
using namespace std;

#define MAX_N 10000001

bool h[MAX_N];
long n;

int main(){
    ifstream fin("hashuri.in");
    ofstream fout ("hashuri.out");
    fin >> n;
    long cmd, x;
    for(int i=1; i<=n; i++){
        fin >> cmd >> x;
        if(cmd == 1){
            h[x] = true;
        }else if(cmd == 2){
            h[x] = false;
        }else{
            if(h[x]) fout << 1 << '\n';
            else fout << 0 << '\n';
        }
    }

return 0;
}