Submission #31382

#TimeUsernameProblemLanguageResultExecution timeMemory
31382imaxblueComputer Network (BOI14_network)C++14
100 / 100
156 ms5180 KiB
#include "network.h" #include<vector> #include<algorithm> using namespace std; #define pb push_back int d[1005], t, n; vector<int> v[1005], ans; int get(int i, int j){ if (i==j) return 0; return ping(i, j)+1; } void findRoute (int N, int a, int b){ for (int l=1; l<=N; ++l){ v[d[l]=get(a, l)].pb(l); } n=N; while(b!=a){ for(auto i:v[d[b]-1]){ if (get(b, i)==1){ ans.pb(b); b=i; break; } } } reverse(ans.begin(), ans.end()); for (int l=0; l<ans.size(); ++l){ travelTo(ans[l]); } }

Compilation message (stderr)

network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:28:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int l=0; l<ans.size(); ++l){
                    ^
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...