Submission #45097

#TimeUsernameProblemLanguageResultExecution timeMemory
45097nibnalinComputer Network (BOI14_network)C++17
100 / 100
197 ms14448 KiB
#include <iostream> #include <cstdio> #include <vector> #include "network.h" using namespace std; const int maxn = int(1e3)+5; int D[maxn]; void findRoute (int n, int a, int b) { for(int i = 1;i <= n;i++) { if(i != b) D[i] = ping(b, i)+1; //cout << i << " " << D[0][i] << " " << D[1][i] << "\n"; } int cur = a; while(cur != b) { for(int i = 1;i <= n;i++) { if(D[i] == D[cur]-1 && ping(cur, i) == 0) { travelTo(i); cur = i; break; } } } }

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