Submission #16053

#TimeUsernameProblemLanguageResultExecution timeMemory
16053kaTkaHrComputer Network (BOI14_network)C++98
0 / 100
127 ms5072 KiB
#include "network.h" #include<vector> using namespace std; const int MX = 1005; int ans[MX]; void findRoute (int N, int a, int b) { int D = ping(a, b) + 1; ans[0] = a, ans[D] = b; for (int i = 1; i <= N; i++){ if (i == a || i == b) continue; int x = ping(a, i) + 1, y = ping(i, b) + 1; if (x + y == D) ans[x] = i; } for (int i = 1; i <= N; i++) travelTo(ans[i]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...