Submission #26784

#TimeUsernameProblemLanguageResultExecution timeMemory
26784baactreecmp (balkan11_cmp)C++14
Compilation error
0 ms0 KiB
#include "cmp.h"

void remember(int n) {
    bit_set(10240-n);
    n++;
    while(n<5000){
        bit_set(n);
        n+=n&(-n);
    }
}

int compare(int b) {
    if(bit_set(10240-b))
        return 0;
    int ret=0;
    b++;
    while(b){
        ret+=bit_set(b);
        b-=b&(-b);
    }    
    if(ret>0)
        return 1;
    return -1;
}

Compilation message (stderr)

cmp.cpp: In function 'int compare(int)':
cmp.cpp:13:15: error: could not convert 'bit_set((10240 - b))' from 'void' to 'bool'
     if(bit_set(10240-b))
        ~~~~~~~^~~~~~~~~
cmp.cpp:18:12: error: invalid operands of types 'int' and 'void' to binary 'operator+'
         ret+=bit_set(b);
         ~~~^~~~~~~~~~~~
cmp.cpp:18:23: error:   in evaluation of 'operator+=(int, void)'
         ret+=bit_set(b);
                       ^