답안 #1063168

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1063168 2024-08-17T14:49:09 Z Unforgettablepl Broken Device (JOI17_broken_device) C++17
컴파일 오류
0 ms 0 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

void Anna(int N, long long X, int K, int P[]){
    vector<bool> bad(N);
    for(int i=0;i<K;i++)bad[P[i]]=true;
    int bit = 0;
    for(int i=0;i<N;i++) {
        if(bad[i] or bit==60){Set(i,0);continue;}
        if(X&(1ll<<bit) and bad[i+1])continue;
        Set(i,1);
        Set(i+1,min(1ll,X&(1ll<<bit)));
        i++;bit++;
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;

long long Bruno(int N, int A[]) {
    vector<bool> bad(N);
    for(int i=0;i<K;i++)bad[P[i]]=true;
    int bit = 0;
    long long X = 0;
    for(int i=0;i<N;i++) {
        if(A[i]==0 or bit==60)continue;
        if(A[i+1])X|=(1ll<<bit);
        i++;bit++;
    }
}

Compilation message

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:7:19: error: 'K' was not declared in this scope
    7 |     for(int i=0;i<K;i++)bad[P[i]]=true;
      |                   ^
Bruno.cpp:7:29: error: 'P' was not declared in this scope
    7 |     for(int i=0;i<K;i++)bad[P[i]]=true;
      |                             ^
Bruno.cpp:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^