# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
728010 | rainboy | cmp (balkan11_cmp) | C11 | 1883 ms | 102184 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cmp.h"
#define A 4096
void remember(int a) {
for (a += A; a > 1; a >>= 2)
bit_set(a);
}
int compare(int b) {
int lower = -1, upper = 6, h;
while (upper - lower > 1) {
h = (lower + upper) / 2;
if (bit_get(A + b >> h * 2))
upper = h;
else
lower = h;
}
if (lower == -1)
return 0;
switch ((A + b >> lower * 2 & 3)) {
case 0:
return -1;
case 1:
return bit_get((A + b >> lower * 2) - 1) ? 1 : -1;
case 2:
return bit_get((A + b >> lower * 2) + 1) ? -1 : 1;
case 3:
return 1;
default:
return 0;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |