Cod sursa(job #1769947)

Utilizator mariusadamMarius Adam mariusadam Data 3 octombrie 2016 15:01:17
Problema Hashuri Scor 30
Compilator cpp Status done
Runda Arhiva educationala Marime 0.35 kb
#include <fstream>

using namespace std;

int fq[1000001];

int main() {
	int n, type, nr;
	ifstream r("hashuri.in");
	ofstream w("hashuri.out");
	r >> n;
	for(; n; n--) {
		r >> type >> nr;
		if (type == 1) {
			fq[nr] = 1;
		} else if (type == 2 ) {
			fq[nr] = 0;
		} else {
			w << (fq[nr] ? 1 : 0) << "\n";	
		}
	}
	r.close();
	w.close();
	return 0;
}