# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
113939 | Kastanda | cmp (balkan11_cmp) | C++11 | 2185 ms | 82592 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<bits/stdc++.h>
#include "cmp.h"
using namespace std;
int d[4] = {6, 8, 10, 12};
void remember(int a)
{
for (int i = 0, j = 1; i < 4; j += d[i], i++)
bit_set(j + a % d[i]), a /= d[i];
}
int compare(int b)
{
int r[4] = {0, 0, 0, 0};
for (int i = 0, j = 1; i < 4; j += d[i], i++)
r[i] = b % d[i], b /= d[i];
int nw = 6 + 8 + 10 + 12 + 1;
for (int i = 3; ~ i; i--)
{
nw -= d[i];
if (!bit_get(nw + r[i]))
{
if (r[i] < d[i] / 2)
{
for (int j = 0; j < r[i]; j++)
if (bit_get(nw + j))
return 1;
return -1;
}
else
{
for (int j = r[i] + 1; j < d[i]; j++)
if (bit_get(nw + j))
return -1;
return 1;
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |