# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
927871 | MuntherCarrot | cmp (balkan11_cmp) | C++14 | 4 ms | 4696 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "cmp.h"
using namespace std;
// void bit_set(int add)
// int bit_get(int add);
void remember(int a){
for(int i = 0; i < 6; i++){
int x = 4 * i;
bit_set(a / x * x + 1);
}
}
int compare(int b){
int l = 0, r = 5, res = -1;
while(l <= r){
int mid = (l + r) / 2;
int x = 4 * mid;
if(bit_get(b / x * x + 1) == 0){
l = mid + 1;
res = mid;
}
else{
r = mid - 1;
}
}
if(res == -1){
return 0;
}
// int dig = (b >> (res * 2));
int dig = b / (res * 4) * (res * 4) + 1;
if(dig % 4 == 3){
return 1;
}
if(dig % 4 == 2){
int x = bit_get(dig + 3);
return x == 1 ? -1 : 1;
}
if(dig % 4 == 1){
int x = bit_get(dig);
return x == 1 ? 1 : -1;
}
if(dig % 4 == 0){
return -1;
}
return 0;
}
// by me
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |