Submission #107945

#TimeUsernameProblemLanguageResultExecution timeMemory
107945tjd229Computer Network (BOI14_network)C++14
100 / 100
143 ms8056 KiB
#include "network.h" #include <vector> using namespace std; vector<int> candi[1000]; int path[1000]; void findRoute (int N, int a, int b) { int len = ping(a, b); for (int i = 1; i <= N; ++i) { if (a == i || b == i) continue; int d = ping(a, i); candi[d].push_back(i); } path[len] = b; for (int i = len-1; i >= 0; --i) { for (auto x : candi[i]) { if (ping(x, b) == 0) { b = x; path[i] = b; break; } } } for (int i = 0; i <= len; ++i) travelTo(path[i]); }

Compilation message (stderr)

grader.c: In function 'int main()':
grader.c:48:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf ("%d%d%d%d", &N, &a, &b, &M);
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
grader.c:51:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &distance[u][v]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...