# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
26925 |
2017-07-07T07:23:21 Z |
sgc109 |
cmp (balkan11_cmp) |
C++11 |
|
2247 ms |
82628 KB |
#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 |
1 |
Partially correct |
2247 ms |
82628 KB |
Output is partially correct - maxAccess = 19, score = 19 |