Submission #1144655

#TimeUsernameProblemLanguageResultExecution timeMemory
1144655qqusayy22Broken Device (JOI17_broken_device)C++20
Compilation error
0 ms0 KiB
#include "Annalib.h"

void Anna(int N, long long X, int K, int P[]){
    if (p[0] > 150/2) {
        Set(0, 1);
        for (int i = 0; i <= 60; i++) {
            if (x&(1<<i)) Set(i + 1, 1);
            else Set(i + 1, 0);
        }
        for (int i = 61; i < N; i++) Set(i, 0);
    } if (p[0] >= 150/2) {
        Set(p[0] + 1, 1);
        for (int i = p[0] + 1; i < N; i++) {
            if (x&(1<<i)) Set(i, 1);
            else Set(i, 0);
        }
        for (int i = 0; i <= p[0]; i++) Set(i, 0);
    }
}
#include "Brunolib.h"

long long Bruno(int N, int A[]) {
    bool f = 0;
    long long x, cnt = 0;
    for (int i = 0; i < N; i++) {
        if (f && A[i]) x |= 1 << (i - cnt);
        else {
            f |= A[i];
            cnt = i + 1;
        }
    }

    
    return x;
}

Compilation message (stderr)

# 1번째 컴파일 단계

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:4:9: error: 'p' was not declared in this scope
    4 |     if (p[0] > 150/2) {
      |         ^
Anna.cpp:7:17: error: 'x' was not declared in this scope
    7 |             if (x&(1<<i)) Set(i + 1, 1);
      |                 ^
Anna.cpp:11:11: error: 'p' was not declared in this scope
   11 |     } if (p[0] >= 150/2) {
      |           ^
Anna.cpp:14:17: error: 'x' was not declared in this scope
   14 |             if (x&(1<<i)) Set(i, 1);
      |                 ^