Submission #1322346

#TimeUsernameProblemLanguageResultExecution timeMemory
1322346edocmp (balkan11_cmp)C++20
0 / 100
526 ms99772 KiB
#include "cmp.h"
#include <bits/stdc++.h>

void remember(int n) {
    n += 4096;
    while(n) {
        bit_set(n);
        n >>= 3;
    }
}

int compare(int b) {
    b += 4096;
    for(int lvl = 4; ~lvl; --lvl) {
        int node = b >> (lvl * 3);
        if(!bit_get(node)) {
            int d = node % 8;
            if(d <= 2) return -1;
            if(d >= 5) return 1;
            if(d == 3) 
                return bit_get(node) ? 1 : -1;
            else 
                return bit_get(node + 7) ? -1 : 1;
        }
    }
}

Compilation message (stderr)

cmp.cpp: In function 'int compare(int)':
cmp.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...