제출 #1137597

#제출 시각아이디문제언어결과실행 시간메모리
1137597Muhammad_AneeqCOVID tests (CEOI24_covid)C++20
컴파일 에러
0 ms0 KiB
#include <iostream> #include <vector> // #include "grader.cpp" using namespace std; vector<bool>vals; vector<bool> answer; bool ask(int l,int r) { for (int i=l;i<=r;i++) vals[i]=1; int f=test_students(vals); for (int i=l;i<=r;i++) vals[i]=0; return f; } void divi(int l,int r) { int mid=(l+r)/2; if (l==r) { answer[l]=1; return; } if (ask(l,mid)) divi(l,r); if (ask(mid+1,r)) divi(mid+1,r); } vector<bool> find_positive() { vals.resize(N); answer=vals; divi(0,N-1); return answer; }

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

Main.cpp: In function 'bool ask(int, int)':
Main.cpp:11:11: error: 'test_students' was not declared in this scope
   11 |     int f=test_students(vals);
      |           ^~~~~~~~~~~~~
Main.cpp: In function 'std::vector<bool> find_positive()':
Main.cpp:31:17: error: 'N' was not declared in this scope
   31 |     vals.resize(N);
      |                 ^