| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 24860 | chpipis | 비교 (balkan11_cmp) | C++11 | 1640 ms | 82540 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cmp.h"
const int BLOCK = (1 << 3);
const int SIZE = 12;
void remember(int n) {
for (int i = SIZE - 3, pos = 1; i >= 0; i -= 3, pos += BLOCK) {
int cur = (n >> i) & (BLOCK - 1);
bit_set(pos + cur);
}
}
int compare(int b) {
for (int i = SIZE - 3, pos = 1; i >= 0; i -= 3, pos += BLOCK) {
int cur = (b >> i) & (BLOCK - 1);
if (!bit_get(pos + cur)) {
if (cur <= 3) {
for (int j = 0; j < cur; j++) {
if (bit_get(pos + j))
return 1;
}
return -1;
} else {
for (int j = cur + 1; j < 8; j++) {
if (bit_get(pos + j))
return -1;
}
return 1;
}
}
}
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
