제출 #428296

#제출 시각아이디문제언어결과실행 시간메모리
428296Popax21Finding Routers (IOI20_routers)C++14
37 / 100
2 ms284 KiB
#include <stdio.h> #include "routers.h" std::vector<int> find_routers(int l, int n, int q) { std::vector<int> rs(n); rs[0] = 0; int pr = 0; for(int p = 1; p <= l; p++) { int r = use_detector(p); if(r != pr) { //Calculate distance between routers rs[r] = 2*p - rs[pr]; if(r > pr) rs[r] -= 2; //printf("pr %d r %d p %d pp %d p' %d\n", pr, r, p, rs[pr], rs[r]); pr = r; p = rs[r] + 1; } } return rs; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...