#include<bits/stdc++.h>
#include "cmp.h"
using namespace std;
void remember(int a)
{
for (int i = 0; i < 4; i++)
bit_set(i * 8 + a % 8 + 1), a /= 8;
}
int compare(int b)
{
int r[4] = {0, 0, 0, 0};
for (int i = 0; i < 12; i++)
if ((b >> i) & 1)
r[i / 3] |= 1 << (i % 3);
for (int i = 3; ~ i; i--)
if (!bit_get(i * 8 + r[i] + 1))
{
if (r[i] <= 4)
{
for (int j = 0; j < r[i]; j++)
if (bit_get(i * 8 + j + 1))
return 1;
return -1;
}
else
{
for (int j = r[i] + 1; j < 8; j++)
if (bit_get(i * 8 + j + 1))
return -1;
return 1;
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
2632 ms |
82552 KB |
Output is partially correct - maxAccess = 12, score = 82 |