Submission #26783

# Submission time Handle Problem Language Result Execution time Memory
26783 2017-07-05T15:45:32 Z baactree cmp (balkan11_cmp) C++14
10 / 100
2141 ms 82624 KB
#include "cmp.h"

void remember(int n) {
    int k=n/64;
    bit_set(k+1);
    for(int i=0;i<12;i++){
        if(n&1)
            bit_set(64+i+1);
        n/=2;
    }
}

int compare(int b) {
    int k=b/64;
    if(bit_get(k+1)){
        b%=64;
        int r=1;
        int a=0;
        for(int i=0;i<6;i++){
            if(bit_get(64+i+1))
                a+=r;
            r*=2;
        }
        if(b<a)
            return -1;
        if(b==a)
            return 0;
        return 1;
    }
    b/=64;
    int r=1;
    int a=0;
    for(int i=6;i<12;i++){
        if(bit_get(64+i+1))
            a+=r;
        r*=2;
    }
    if(b<a)
        return -1;
    else if(b==a)
        return 0;
    return 1;
}

# Verdict Execution time Memory Grader output
1 Partially correct 2141 ms 82624 KB Output is partially correct - maxAccess = 20, score = 10