Submission #1157712

#TimeUsernameProblemLanguageResultExecution timeMemory
1157712arkanefuryShopping (JOI21_shopping)C++20
Compilation error
0 ms0 KiB
#include "Anna.h"
#include <vector>

namespace {

int N, L, R;
int count = 0, ans = 0;
}  // namespace

void InitA(int N, int L, int R) {
  ::N = N;
  ::L = L;
  ::R = R;
  int a[105];
  for(int i = 0; i < 18; i ++){
      a[i] = (L >> i) & 1);
      sendA(a[i]);
  }
  for(int i = 0; i < 18; i ++){
      if((R >> i & 1) != (L >> i & 1) && !a[i])sendA(1);
      else if((R >> i & 1) != (L >> i & 1) && a[i])sendA(1);
      else sendA(0);
  }
}

void ReceiveA(bool x){
    if(y)ans += (1 << count);
    count ++;
}

int Answer() {
  return ans;
}
#include "Bruno.h"
#include <vector>

namespace {

int N;
int variable_example[1000000];
int count;

bool FunctionExample(bool P) {
  return !P;
}

}  // namespace

void InitB(int N, std::vector<int> P) {
  ::N = N;
  for(int i = 0; i < N; i++){
    variable_example[i] = P[i];
  }
  count = 0;
}

void ReceiveB(bool y){
    int L = 0, R = 0;
    if(count < 18){
    if(y)L += (1 << count);
    }
    int pl = 0;
    else{
        if(y)R += (1 << (count - 18));
        pl ++;
    }
    if(pl == 18){
        ans = 1e18;
        FOR(i, L, R, 1)ans = min(ans, variable_example[i]);
        FOR(i, 0, 20, 1)sendB(ans >> i & 1);
    }
    count++;
}

Compilation message (stderr)

# 1번째 컴파일 단계

Anna.cpp: In function 'void InitA(int, int, int)':
Anna.cpp:16:26: error: expected ';' before ')' token
   16 |       a[i] = (L >> i) & 1);
      |                          ^
      |                          ;
Anna.cpp:17:7: error: 'sendA' was not declared in this scope; did you mean 'SendA'?
   17 |       sendA(a[i]);
      |       ^~~~~
      |       SendA
Anna.cpp:20:48: error: 'sendA' was not declared in this scope; did you mean 'SendA'?
   20 |       if((R >> i & 1) != (L >> i & 1) && !a[i])sendA(1);
      |                                                ^~~~~
      |                                                SendA
Anna.cpp:21:52: error: 'sendA' was not declared in this scope; did you mean 'SendA'?
   21 |       else if((R >> i & 1) != (L >> i & 1) && a[i])sendA(1);
      |                                                    ^~~~~
      |                                                    SendA
Anna.cpp:22:12: error: 'sendA' was not declared in this scope; did you mean 'SendA'?
   22 |       else sendA(0);
      |            ^~~~~
      |            SendA
Anna.cpp: In function 'void ReceiveA(bool)':
Anna.cpp:27:8: error: 'y' was not declared in this scope
   27 |     if(y)ans += (1 << count);
      |        ^