Pagini recente » Cod sursa (job #658861) | Cod sursa (job #1405390) | Cod sursa (job #2164821) | Cod sursa (job #1096451) | Cod sursa (job #2983185)
#include <bits/stdc++.h>
using namespace std;
const int nmax = 62500;
unsigned int vf[nmax+5];
int main() {
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n; f >> n;
for(int i=1; i<=n; i++) {
int type, x; f >> type >> x;
int ind = x / 32;
int bind = x % 32;
if(type == 1 and (vf[ind] & (1<<bind)) == 0) vf[ind] += (1<<bind);
else if(type == 2 and (vf[ind] & (1<<bind)) != 0) vf[ind] -= (1<<bind);
else if(type == 3) {
if((vf[ind] & (1<<bind))) g << "1\n";
else g << "0\n";
}
}
return 0;
}