# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
503449 | bang627 | cmp (balkan11_cmp) | C++14 | 1273 ms | 82496 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"
#include <iostream>
using namespace std;
void remember(int a) {
int cnt2 = 4;
while (cnt2 > 0) {
bit_set(1+ (cnt2 - 1) * 8 +a % 8);
a >>= 3 , cnt2--;
}
}
int compare(int b) {
for (int i = 1; i <= 4; i++) {
int i2 = 12-3 * i;
int val = (b >> i2) % 8;
int readed = bit_get(1 + (i - 1) * 8 + val);
if (readed == 0) {
if (val < 4) {
for (int j = 0; j < val; j++) if (bit_get(1 + (i - 1) * 8 + j) == 1) return 1;
return -1;
}
else {
for (int j = 7; j > val; j--) if (bit_get(1 + (i - 1) * 8 + j) == 1) return -1;
return 1;
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |