# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
24168 | yys11631 | cmp (balkan11_cmp) | C++14 | 2099 ms | 83704 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<algorithm>
using namespace std;
void remember(int n) {
static int d[5],l=0,i;
d[0] = n % 6;
n /= 6;
d[1] = n % 8;
n /= 8;
d[2] = n % 10;
n /= 10;
d[3] = n % 12;
n /= 12;
bit_set(100+d[3]);
bit_set(200+d[2]);
bit_set(300 + d[1]);
bit_set(400 + d[0]);
}
int compare(int b) {
static int a[5], l = 0, i;
a[0] = b % 6;
b /= 6;
a[1] = b % 8;
b /= 8;
a[2] = b % 10;
b /= 10;
a[3] = b % 12;
b /= 12;
if (!bit_get(a[3] + 100)) {
if (a[3] >= 6) {
for (i = a[3] + 1; i < 12; i++) {
if (bit_get(i+100))
return -1;
}
return 1;
}
else {
for (i = a[3] - 1; i >= 0; i--) {
if (bit_get(i+100))
return 1;
}
return -1;
}
}
else if (!bit_get(a[2] + 200)) {
if (a[2]>= 5) {
for (i = a[2]+1; i < 10; i++) {
if (bit_get(i+200))
return -1;
}
return 1;
}
else {
for (i = a[2] - 1; i >= 0; i--) {
if (bit_get(i+200))
return 1;
}
return -1;
}
}
else if (!bit_get(a[1] + 300)) {
if (a[1]>= 4) {
for (i = a[1] + 1; i < 8; i++) {
if (bit_get(i+300))
return -1;
}
return 1;
}
else {
for (i = a[1] - 1; i >= 0; i--) {
if (bit_get(i+300))
return 1;
}
return -1;
}
}
else if (!bit_get(a[0] + 400)) {
if (a[0] >= 3) {
for (i = a[0] + 1; i <6; i++) {
if (bit_get(i+400))
return -1;
}
return 1;
}
else {
for (i = a[0] - 1; i >= 0; i--) {
if (bit_get(i+400))
return 1;
}
return -1;
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |