Submission #223026

# Submission time Handle Problem Language Result Execution time Memory
223026 2020-04-14T13:49:32 Z dolphingarlic cmp (balkan11_cmp) C++14
55 / 100
1700 ms 94840 KB
#include "cmp.h"

const int K = 2;

void remember(int n) {
    for (int i = 12 - K, j = 1; i > -1; i -= K, j *= (1 << K) + 1) {
        int curr = ((n >> i) & ((1 << K) - 1)) + 1;
        bit_set(curr + j);
    }
}

int compare(int b) {
    for (int i = 12 - K, j = 1; i > -1; i -= K, j *= (1 << K) + 1) {
        int curr = ((b >> i) & ((1 << K) - 1)) + 1;
        if (bit_get(curr + j)) continue;

        for (int k = 1; k < curr; k++) if (bit_get(k + j)) return 1;
        return -1;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Partially correct 1700 ms 94840 KB Output is partially correct - maxAccess = 15, score = 55