Submission #1225605

#TimeUsernameProblemLanguageResultExecution timeMemory
1225605tamzidFinding Routers (IOI20_routers)C++20
0 / 100
2096 ms320 KiB
#include <bits/stdc++.h>
#include "routers.h"
using namespace std;

vector<int> find_routers(int l, int n, int q) 
{
    vector<int> ans;
    ans.push_back(0);

    int low = 1;
    int high = l - 1;
    while(low <= high)
    {
      int m = low + (high - low) / 2;
      if(m & 1)
        ++m;
      if(m >= l)
        break;
      if(use_detector(m) == 1)
      {
        low = m + 1;
        ans.push_back(low);
      }
      else
      {
        high = m - 1;
      }
    }
    return {0,ans.back()};
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...