# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
793603 | khshg | 비교 (balkan11_cmp) | C++14 | 695 ms | 96028 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cmp.h"
#include<bits/stdc++.h>
using namespace std;
const int arr[] = {1, 1 + 4, 1 + 4 + 4 * 4, 1 + 4 + 4 * 4 + 4 * 4 * 4, 1 + 4 + 4 * 4 + 4 * 4 * 4 + 4 * 4 * 4 * 4, 1 + 4 + 4 * 4 + 4 * 4 * 4 + 4 * 4 * 4 * 4 + 4 * 4 * 4 * 4 * 4};
void remember(int a) {
for(int i = 0; i < 6; ++i) {
bit_set(arr[i] + (a >> (10 - 2 * i)));
}
}
int compare(int b) {
int tl = 0, tr = 6;
while(tl < tr) {
int tm = (tl + tr) / 2;
if(bit_get(arr[tm] + (b >> (10 - 2 * tm)))) {
tl = tm + 1;
} else {
tr = tm;
}
}
if(tl == 6) return 0;
b >>= (10 - 2 * tl);
int t = b;
b &= 3;
t -= b;
/* if(b == 3) return 1;
if(b == 0) return -1;
if(b == 1) bit_get(t) ? 1 : -1;
return bit_get(t + 3) ? -1 : 1;*/
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |