Submission #1137597

#TimeUsernameProblemLanguageResultExecution timeMemory
1137597Muhammad_AneeqCOVID tests (CEOI24_covid)C++20
Compilation error
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;
}

Compilation message (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);
      |                 ^