Submission #42634

#TimeUsernameProblemLanguageResultExecution timeMemory
42634XmtosXComputer Network (BOI14_network)C++14
100 / 100
146 ms58644 KiB
#include <bits/stdc++.h> using namespace std; void findRoute(int N,int a,int b); int ping(int i,int j); void travelTo(int k); int n,dis[1004]; vector <int> v; void findRoute(int N,int a,int b) { n=N; for (int i=1;i<=n;i++) { if (i==b) continue; dis[i]=ping(i,b); } int x=dis[a],last=a; while (x) { for (int i=1;i<=n;i++) { if (dis[i]==x-1&&ping(i,last)==0) { last=i; x--; v.push_back(i); break; } } } for (int i=0;i<v.size();i++) { travelTo(v[i]); } travelTo(b); }

Compilation message (stderr)

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