Submission #154159

#TimeUsernameProblemLanguageResultExecution timeMemory
154159nicolaalexandraComputer Network (BOI14_network)C++14
100 / 100
124 ms8056 KiB
#include <iostream> #include "network.h" #include <cstring> using namespace std; int f[1010],dist_b[1010]; void findRoute (int n, int a, int b){ memset (f,0,sizeof f); memset (dist_b,0,sizeof dist_b); for (int i=1;i<=n;i++){ if (i == b) continue; dist_b[i] = ping (i,b); } int dist = dist_b[a]; int nod = a; f[a] = 1; for (;;){ dist--; if (dist == -1){ travelTo(b); break; } for (int i=1;i<=n;i++){ if (f[i]) continue; if (dist_b[i] != dist) continue; if (ping(nod,i) == 0){ travelTo(i); nod = i; f[nod] = 1; 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...