Submission #403209

#TimeUsernameProblemLanguageResultExecution timeMemory
403209iraira655Finding Routers (IOI20_routers)C++17
16 / 100
3 ms204 KiB
#include "routers.h" using namespace std; vector<int> find_routers(int l, int n, int q) { vector<int> ans; ans.push_back(0); int prev = 0, c = 0, prevPos = 0; for(int i=1; i<=l; i++){ int next = use_detector(i); c++; if(next!=prev){ prev = next; prevPos = 2*(c-1) ; ans.push_back(prevPos); c = 1; int s = ans.size(); if(s == n) break; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...