| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 42851 | kinssang | 비교 (balkan11_cmp) | C++14 | 2063 ms | 102252 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cmp.h"
void remember(int n)
{
n += 4096;
while (n > 1)
{
bit_set(n);
n >>= 2;
}
}
int compare(int b)
{
b += 4096;
int low = 0, high = 6;
while (low <= high)
{
int mid = (low + high) / 2;
if (mid == 6)
{
high = mid - 1;
continue;
}
int temp = bit_get(b >> (2*mid));
if (temp == 1) high = mid - 1;
else low = mid + 1;
}
if (high + 1 == 0) return 0;
if (b >> (2*high) == ((b >> (2*high+2)) * 4)) return -1;
if (b >> (2*high) == ((b >> (2*high+2)) * 4 + 3)) return 1;
if (b >> (2*high) == ((b >> (2*high + 2)) * 4 + 1)) return bit_get((b >> (2*high + 2)) * 4) ? 1 : -1;
if (b >> (2*high) == ((b >> (2*high + 2)) * 4 + 2)) return bit_get((b >> (2*high + 2)) * 4 + 3) ? -1 : 1;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
