# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
668396 |
2022-12-03T19:41:04 Z |
finn__ |
cmp (balkan11_cmp) |
C++17 |
|
920 ms |
96040 KB |
#include <bits/stdc++.h>
#include "cmp.h"
size_t y[6] = {
1,
4097,
5121,
5377,
5441,
5457};
void remember(int n)
{
for (size_t i = 0; i < 6; i++)
bit_set((n >> (2 * i)) + y[i]);
}
int compare(int b)
{
size_t u = 0, v = 5;
while (u < v)
{
size_t m = (u + v + 1) / 2;
if (bit_get(b >> (2 * m)))
u = m;
else
v = m - 1;
}
if (!((b >> (2 * (u - 1))) & 3))
return -1;
if (((b >> (2 * (u - 1))) & 3) == 3)
return 1;
if (((b >> (2 * (u - 1))) & 3) == 1)
return bit_get(4 * (b >> (2 * u))) ? 1 : -1;
return bit_get(4 * (b >> (2 * u)) + 3) ? -1 : 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
920 ms |
96040 KB |
ZERO POINTS: For a=3040 and b=3318, correct answer is 1, got -1 |