# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
26925 | sgc109 | cmp (balkan11_cmp) | C++11 | 2247 ms | 82628 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cmp.h"
void remember(int n) {
int cnt = 0;
int rev = 0;
for(int i = 0 ; i < 12; i++) {
if(n&(1<<i)) cnt++;
}
if(cnt > 6) rev = 1, bit_set(100);
for(int i = 0 ; i < 12; i++){
int cond = (n&(1<<i)) != 0;
if(rev) cond = !cond;
if(cond) bit_set(i+1);
}
}
int compare(int b) {
int rev = bit_get(100);
for(int i = 0 ; i < 12; i++){
int cond1 = (b & (1<<(11-i)));
int cond2 = bit_get(12-i);
if(rev) cond2 = !cond2;
if(cond1 && !cond2) return 1;
if(!cond1 && cond2) return -1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |