Submission #16046

#TimeUsernameProblemLanguageResultExecution timeMemory
16046hongjun7Computer Network (BOI14_network)C++98
100 / 100
167 ms5076 KiB
#include "network.h" int d[2005]; void findRoute(int N, int a, int b) { int dist = ping(a, b); for (int i = 1; i <= N; i++) d[i] = 0; for (int i = 1; i <= N; i++) { if (i != b) d[i] = ping(b, i) + 1; } for (int i = 1; i <= dist + 1; i++) { for (int j = 1; j <= N; j++) { if (d[j] - d[a] == -1) { if (ping(a, j) == 0) { a = j; travelTo(j); break; } } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...