# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
31925 | 2017-09-15T21:13:11 Z | chonka | 컴퓨터 네트워크 (BOI14_network) | C++ | 129 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 ) ; dist -- ; sort ( v[ dist ].begin ( ) , v[ dist ].end ( ) , cmp ) ; int sz = v[ dist ].size ( ) ; int lst = -1 ; for ( i = 0 ; i < sz ; i ++ ) { if ( st[ v[ dist ][ i ] ] == lst + 1 ) { travelTo ( v[ dist ][ i ] ) ; lst = st[ v[ dist ][ i ] ] ; } } travelTo ( b ) ; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 123 ms | 6060 KB | Output is correct |
2 | Correct | 126 ms | 6060 KB | Output is correct |
3 | Correct | 129 ms | 6060 KB | Output is correct |
4 | Correct | 106 ms | 6060 KB | Output is correct |
5 | Correct | 99 ms | 6060 KB | Output is correct |
6 | Correct | 106 ms | 6060 KB | Output is correct |
7 | Correct | 0 ms | 6060 KB | Output is correct |
8 | Correct | 0 ms | 6060 KB | Output is correct |
9 | Correct | 0 ms | 6060 KB | Output is correct |
10 | Correct | 0 ms | 6060 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 106 ms | 6060 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 113 ms | 6060 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 113 ms | 6060 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |