Submission #107932

#TimeUsernameProblemLanguageResultExecution timeMemory
107932tjd229Computer Network (BOI14_network)C++14
50 / 100
129 ms8056 KiB
#include "network.h" #include <vector> using namespace std; vector<int> candi[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); } for (int i = 0; i < len; ++i) { for (auto x : candi[i]) { if (i != 0) { if (ping(a, x)) continue; } if (ping(x, b) + i + 1 == len) { a = x; travelTo(a); break; } } } travelTo(b); }

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...