# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
503449 | bang627 | 비교 (balkan11_cmp) | C++14 | 1273 ms | 82496 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cmp.h"
#include <iostream>
using namespace std;
void remember(int a) {
int cnt2 = 4;
while (cnt2 > 0) {
bit_set(1+ (cnt2 - 1) * 8 +a % 8);
a >>= 3 , cnt2--;
}
}
int compare(int b) {
for (int i = 1; i <= 4; i++) {
int i2 = 12-3 * i;
int val = (b >> i2) % 8;
int readed = bit_get(1 + (i - 1) * 8 + val);
if (readed == 0) {
if (val < 4) {
for (int j = 0; j < val; j++) if (bit_get(1 + (i - 1) * 8 + j) == 1) return 1;
return -1;
}
else {
for (int j = 7; j > val; j--) if (bit_get(1 + (i - 1) * 8 + j) == 1) return -1;
return 1;
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |