Submission #205036

# Submission time Handle Problem Language Result Execution time Memory
205036 2020-02-27T17:43:51 Z alexandra_udristoiu cmp (balkan11_cmp) C++14
Compilation error
0 ms 0 KB
#include<iostream>
#include "cmp.h"
using namespace std;
int v[] = {0, 10, 10, 8, 6};
int p[] = {0, 6400, 640 ,64 ,6, 1}
void remember(int a){
    for(int i = 4; i >= 1; i--){
        bit_set(a);
        a /= v[i];
    }
}
int compare(int b){
    int i, x, st, dr;
    for(i = 1; i <= 4; i++){
        x = b / p[i + 1];
        if(bit_get(x) == 0){
            break;
        }
    }
    if(i == 5){
        return 0;
    }
    st = x - x % v[i];
    dr = st + v[i] - 1;
    if(x - st < dr - x){
        for(i = st; i < x; i++){
            if(bit_get(i) == 1){
                return 1;
            }
        }
        return -1;
    }
    else{
        for(i = dr; i > x; i--){
            if(bit_get(i) == 1){
                return -1;
            }
        }
        return 1;
    }
}

Compilation message

cmp.cpp:6:1: error: expected ',' or ';' before 'void'
 void remember(int a){
 ^~~~