Submission #41128

#TimeUsernameProblemLanguageResultExecution timeMemory
4112814kgComputer Network (BOI14_network)C++11
100 / 100
150 ms58656 KiB
#include "network.h" #include <algorithm> using namespace std; int out_len, d_len, out[1001]; pair<int,int> d[1001]; void findRoute(int n, int s, int e){ int out_w; out_len=ping(s,e)+1; out_w=out_len-1, out[out_w+1]=e; for(int i=1; i<=n; i++) if(i!=s && i!=e) d[++d_len]={ping(s,i),i}; sort(d+1,d+d_len+1); for(int i=d_len; i>=1; i--){ if(out_w<=d[i].first) continue; if(d[i].first+ping(d[i].second,out[out_w+1])==out_w-1){ out[out_w]=d[i].second, out_w--; } } for(int i=1; i<=out_len; i++) travelTo(out[i]); }

Compilation message (stderr)

grader.c: In function 'int main()':
grader.c:48:39: 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:41: 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...