Pagini recente » Cod sursa (job #26955) | Cod sursa (job #1549266) | Cod sursa (job #9098) | Cod sursa (job #1053187) | Cod sursa (job #2422691)
#include <iostream>
#include <string.h>
#include <cmath>
#include <algorithm>
#include <fstream>
#include <vector>
#define MAX 2000000
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int a[MAX], n, x, y, b[MAX];
int main(){
in >> n;
while (n != 0) {
n--;
in >> x >> y;
if (x == 1) {
if (y >= 2000000) {
b[y - 2000000] = 1;
}
else {
a[y] = 1;
}
}
if (x == 2) {
if (y >= 2000000) {
b[y - 2000000] = 0;
}
else {
a[y] = 0;
}
}
if (x == 3) {
if (y >= 2000000) {
out << b[y - 2000000] << endl;;
}
else {
out << a[y] << endl;
}
}
}
}