Submission #151896

#TimeUsernameProblemLanguageResultExecution timeMemory
151896Ruxandra985Computer Network (BOI14_network)C++14
100 / 100
115 ms4816 KiB
#include <cstdio> #include "network.h" void findRoute (int n,int a,int b){ int db[n+1]; int i,curr,nxt; for (i=1;i<=n;i++){ if (i!=b) db[i] = ping(b,i); } curr = a; db[b] = -1; while (curr!=b){ for (i=1;i<=n;i++){ if (db[i]+1 == db[curr] && ping(i,curr) == 0){ nxt = i; break; } } travelTo(nxt); curr = nxt; } }

Compilation message (stderr)

network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:13:16: warning: 'nxt' may be used uninitialized in this function [-Wmaybe-uninitialized]
     while (curr!=b){
            ~~~~^~~
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...