제출 #1223287

#제출 시각아이디문제언어결과실행 시간메모리
1223287thangdz2k7Shopping (JOI21_shopping)C++20
컴파일 에러
0 ms0 KiB
#include "Anna.h" #include <bits/stdc++.h> const int LG = 18; int n, l, r; void InitA(int N, int L, int R){ n = N, l = L, r = R; for (int i = 0; i < LG; ++ i) SendA((L >> i) & 1); } int cnt = 0, res = -1; void ReceiveA(bool x){ if (x && l + cnt <= R) res = l + cnt; ++ cnt; } int Answer(){ return res; }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; const int LG = 18; int l = 0, n; vector <int> p; void InitB(int N, vector <int> P){ p = P; n = N; } int cnt = 0; void ReceiveB(bool y){ if (y) l |= (1 << cnt); cnt ++; if (cnt == LG){ int Max = 0; for (int i = l; i < n; ++ i){ if (p[i] > Max) { SendB(1); Max = p[i]; } else SendB(0); } } }

컴파일 시 표준 에러 (stderr) 메시지

# 1번째 컴파일 단계

Anna.cpp: In function 'void ReceiveA(bool)':
Anna.cpp:17:29: error: 'R' was not declared in this scope
   17 |         if (x && l + cnt <= R) res = l + cnt;
      |                             ^