Submission #165064

#TimeUsernameProblemLanguageResultExecution timeMemory
165064LawlietComputer Network (BOI14_network)C++14
100 / 100
126 ms8144 KiB
#include <bits/stdc++.h> #include "network.h" using namespace std; const int MAXN = 1010; vector< int > ord[MAXN]; void findRoute (int N, int S, int T) { int minDist = ping( S , T ); ord[ minDist ].push_back( S ); for(int i = 1 ; i <= N ; i++) { if( i == S || i == T ) continue; int cur = ping( i , T ); ord[ cur ].push_back( i ); } int curNode = S; int curDist = minDist; while( curDist > 0 ) { curDist--; for(int j = 0 ; j < ord[ curDist ].size() ; j++) { int viz = ord[ curDist ][ j ]; if( ping( curNode , viz ) == 0 ) { curNode = viz; break; } } travelTo( curNode ); } travelTo( T ); }

Compilation message (stderr)

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