# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
17511 | gs14004 | 비교 (balkan11_cmp) | C++14 | 919 ms | 104952 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cmp.h"
#include <vector>
#include <algorithm>
using namespace std;
void remember(int n) {
n += 4096;
while(n){
bit_set(n);
n >>= 1;
}
}
int compare(int b) {
b += 4096;
if(bit_get(b)) return 0;
vector<int> v;
while(b){
v.push_back(b);
b >>= 1;
}
reverse(v.begin(), v.end());
int s = 0, e = v.size() - 2;
while(s != e){
int m = (s+e)/2;
if(!bit_get(v[m])) e = m;
else s = m+1;
}
if(v[s]%2) return 1;
return -1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |