# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
530863 | KoD | 비교 (balkan11_cmp) | C++17 | 1770 ms | 102192 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cmp.h"
void remember(int n) {
n += 4096;
for (int i = 0; i < 6; ++i) {
bit_set(n);
n >>= 2;
}
}
#include <iostream>
int compare(int b) {
b += 4096;
int ok = 6, ng = -1;
while (ok - ng > 1) {
const int md = (ok + ng) / 2;
if (bit_get((b >> (2 * md)))) {
ok = md;
} else {
ng = md;
}
}
if (ok == 0) {
return 0;
}
const int same = b >> (2 * ok);
const int bit = (b >> (2 * ng)) & 3;
if (bit <= 1) {
return bit_get(4 * same + 0) ? 1 : -1;
} else {
return bit_get(4 * same + 3) ? -1 : 1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |