# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
39453 |
2018-01-15T14:09:47 Z |
smu201111192 |
cmp (balkan11_cmp) |
C++14 |
|
2327 ms |
99796 KB |
#include "cmp.h"
void remember(int n){
int a[4]; int pos = 3;
while(pos >= 0){
a[pos--] = (n % 8); n/=8;
}
int cur = 1;
for(int i=0;i<4;i++){
cur = cur * 8 + a[i];
bit_set(cur);
}
}
int compare(int b) {
int n = b;
int a[4]; int pos = 3;
while(pos >= 0){
a[pos--] = (n % 8); n/=8;
}
int cur = 1; int i = 0;
for(;i<4;i++){
cur = cur * 8 + a[i];
int bit = bit_get(cur);
if(!bit) break;
}
if(i == 4)return 0;
cur /= 8;
int chk = 0;
for(int k = 1; k < 8 ;k++){
int bit = bit_get(cur * 8+k);
if(bit == 1) chk = k;
}
if(chk > a[i]) return -1;
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
2327 ms |
99796 KB |
Output is partially correct - maxAccess = 15, score = 55 |