Pagini recente » Cod sursa (job #405150) | Solutii ONIS 2014, Runda 2 | Cod sursa (job #2952768) | Cod sursa (job #3201345) | Cod sursa (job #1095784)
#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;
}
}
}
}