# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
113939 |
2019-05-29T09:14:11 Z |
Kastanda |
cmp (balkan11_cmp) |
C++11 |
|
2185 ms |
82592 KB |
#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 |
1 |
Correct |
2185 ms |
82592 KB |
Output is correct - maxAccess = 10, score = 100 |