# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
39761 | krauch | cmp (balkan11_cmp) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cmp.h"
#define forn(x, a, b) for (int x = a; x <= b; ++x)
#define for1(x, a, b) for (int x = a; x >= b; --x)
bool bit(int mask, int i) {
return (mask >> i) & 1;
}
void remember(int n) {
forn(i, 0, 11) {
if (bit(n, i)) bit_set(i + 1);
else bit_set(12 + i + 1);
}
}
int compare(int b) {
int cnt = 0;
forn(i, 0, 11) {
cnt += bit(b, i);
}
int q = 1, pos = 0;
if (cnt > 6) {
q = -1;
pos = 12;
b ^= (1 << 12) - 1;
}
forn(i, pos, pos + 11) {
a += (bit_get(i + 1) << i);
}
if (a == b) return -1;
}