| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 4738 | kipa00 | 비교 (balkan11_cmp) | C++98 | 2 ms | 760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cmp.h"
void remember (int value) {
int a[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int c = 12, cnt = 0;
while (c--) {
a[c] = value & 1;
if (value & 1) {
++cnt;
}
value >>= 1;
}
if (cnt > 6) {
bit_set(0);
for (c=0; c<12; ++c) {
if (!a[c]) bit_set(c + 1);
}
} else for (c=0; c<12; ++c) {
if (a[c]) bit_set(c + 1);
}
}
int compare (int value) {
int inverse = bit_get(0);
int i, num = 0;
for (i=0; i<12; ++i) {
num <<= 1;
num |= inverse ^ bit_get(i + 1);
}
if (value < num) {
return -1;
} else if (value == num) {
return 0;
}
return 1;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
