Submission #1200115

#TimeUsernameProblemLanguageResultExecution timeMemory
1200115moha1111Finding Routers (IOI20_routers)C++20
Compilation error
0 ms0 KiB
#include "bits/stdc++.h"
using namespace std;

map<int , int> askd;

int ask(int i)
{
    if(askd.find(i) != askd.end())
        return askd[i];
    
    return askd[i] = use_detector(i);
}

vector<int> find_routers(int l , int n , int q)
{
    vector<int> ans;
    ans.push_back(0);
    while(ans.size() < n)
    {
        int st = ans.back() , en = l;
        while(st <= en)
        {
            int mid = (st + en) / 2;
            if(ask(mid) != ans.back())
                en = mid - 1;

            else
                st = mid + 1;
        }
        ans.push_back(2 * st);
    }
    return ans;
}

Compilation message (stderr)

routers.cpp: In function 'int ask(int)':
routers.cpp:11:22: error: 'use_detector' was not declared in this scope
   11 |     return askd[i] = use_detector(i);
      |                      ^~~~~~~~~~~~