# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
31924 | 2017-09-15T20:51:58 Z | chonka | Computer Network (BOI14_network) | C++ | 146 ms | 6060 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 146 ms | 6060 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 116 ms | 6060 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 109 ms | 6060 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 93 ms | 6060 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |