Cod sursa(job #1095784)

Utilizator andreifirstCioara Andrei Ioan andreifirst Data 31 ianuarie 2014 21:17:17
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.73 kb
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <unordered_map>
#include <iomanip>
#include <cmath>

#define e '\n'

using namespace std;

#define FILE "hashuri"

#define INF 1023456789
#define ll long long

#ifdef FILE
	ifstream f(string (string(FILE) + ".in").c_str());
	ofstream g(string (string(FILE) + ".out").c_str());
#endif
#ifndef FILE
	#define f cin
	#define g cout
#endif

unordered_map <int, bool> mp;
int i, j, n, m, x, y;
int v[18];

#define NMOD 1999999973


int main() {

	f >> n;

	while (n--) {
		f >> x >> y;
		if (x==1) {
			mp[y] = 1;
		} else if (x==2) {
			mp[y] = 0;
		} else if (x==3) {
			if (mp[y]) {
				g << 1 << e;
			} else {
				g << 0 << e;
			}
		}
	}

}