#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
2247 ms |
82628 KB |
Output is partially correct - maxAccess = 19, score = 19 |