Submission #31924

#TimeUsernameProblemLanguageResultExecution timeMemory
31924chonkaComputer Network (BOI14_network)C++98
0 / 100
146 ms6060 KiB
#include "network.h" #include<iostream> #include<stdio.h> #include<vector> #include<algorithm> using namespace std ; #define MAXN 1007 int n ; int st[ MAXN ] ; int en[ MAXN ] ; vector < int > v[ 2 * MAXN ]; bool cmp ( int x , int y ) { return ( st[ x ] < st[ y ] ) ; } void findRoute ( int N, int a, int b ) { int i ; n = N ; for ( i = 1 ; i <= n ; i ++ ) { if ( i == a || i == b ) { continue ; } st[ i ] = ping ( a , i ) ; en[ i ] = ping ( i , b ) ; v[ st[ i ] + en[ i ] ].push_back ( i ) ; } int dist = ping ( a , b ) ; sort ( v[ dist ].begin ( ) , v[ dist ].end ( ) , cmp ) ; int sz = 0 ; int lst = -1 ; for ( i = 0 ; i < sz ; i ++ ) { if ( st[ v[ dist ][ i ] ] == lst + 1 ) { travelTo ( v[ dist ][ i ] ) ; } } travelTo ( b ) ; }

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...