Submission #161868

#TimeUsernameProblemLanguageResultExecution timeMemory
161868AQTComputer Network (BOI14_network)C++14
100 / 100
120 ms8196 KiB
#include <bits/stdc++.h> #include "network.h" using namespace std; vector<int> dist[1005]; void findRoute(int N, int A, int B){ int D = ping(A, B)+1; for(int n = 1; n<=N; n++){ if(n != A && n != B){ int k = ping(n, B); dist[k+1].push_back(n); } } int crnt = A; for(int d = D-1; d; d--){ int lst = crnt; for(int n : dist[d]){ if(ping(crnt, n) == 0){ crnt = n; travelTo(n); break; } } assert(crnt != lst); } 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...