Submission #1173257

#TimeUsernameProblemLanguageResultExecution timeMemory
1173257SmuggingSpunShopping (JOI21_shopping)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "Anna.h"
using namespace std;
int n, l, r, ans;
vector<bool>bit;
void InitA(int N, int L, int R){
    l = L;
    r = R;
    if((n = N) <= 10000){
        for(int i = 13; i > -1; i--){
            SendA(l >> i & 1);
        }
        return;
    }    
}
void ReceiveA(bool x){
    bit.emplace_back(x);
    if(bit.size() == n - l){
        for(int i = r - l; i > -1; i--){
            if(bit[i]){
                ans = i + l;
                break;
            }
        }
    }
}
int Answer(){
    return ans;
}
#include<bits/stdc++.h>
#include "Bruno.h"
using namespace std;
int L = 0, cnt_receive = 0;
vector<int>a;
void InitB(int N, vector<int>P){
    a = P;
}
void ReceiveB(bool y){
    L = (L << 1) + int(y);
    if(++cnt_receive == 14){
        SendB(true);
        for(int i = L + 1, min_i = L; i < n; i++){
            if(a[i] < a[min_i]){
                min_i = i;
                SendB(true);
            }
            else{
                SendB(false);
            }
        }
    }
}

Compilation message (stderr)

# 2번째 컴파일 단계

Bruno.cpp: In function 'void ReceiveB(bool)':
Bruno.cpp:13:43: error: 'n' was not declared in this scope
   13 |         for(int i = L + 1, min_i = L; i < n; i++){
      |                                           ^