# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
23508 | 0xrgb | 비교 (balkan11_cmp) | C++14 | 1914 ms | 82552 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cmp.h"
static const int base_num[4] = {480, 48, 6, 1};
static const int base_bas[4] = {12, 10, 8, 6};
static const int base_idx[4] = {1, 13, 23, 31};
void remember(int n) {
for (int i = 0; i < 4; ++i) {
bit_set(base_idx[i] + n / base_num[i]);
n %= base_num[i];
}
}
int compare(int b) {
for (int i = 0; i < 4; ++i) {
const int bb = b / base_num[i];
b %= base_num[i];
if (bit_get(base_idx[i] + bb)) continue;
else if (bb < base_bas[i] / 2) {
for (int j = bb - 1; j >= 0; --j) {
if (bit_get(base_idx[i] + j))
return +1;
}
return -1;
} else {
for (int j = bb + 1; j < base_bas[i]; ++j) {
if (bit_get(base_idx[i] + j))
return -1;
}
return +1;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |