답안 #20821

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
20821 2017-02-17T15:32:42 Z jjwdi0 컴퓨터 네트워크 (BOI14_network) C++11
25 / 100
129 ms 5112 KB
#include "network.h"

int A[1005];
int dist, B[1005][2];

void findRoute (int N, int a, int b) {
    dist = ping(a, b);
    for(int i=1; i<=N; i++) {
        if(i == a || i == b) continue;
        B[i][0] = ping(a, i), B[i][1] = ping(i, b);
    }
    for(int i=1; i<=N; i++) {
        if(i == a || i == b) continue;
        if(B[i][0] + B[i][1] + 1 == dist) A[B[i][0]] = i;
    }
    for(int i=0; i<dist; i++) travelTo(A[i]);
    travelTo(b);
}

Compilation message

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]);
                                         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 129 ms 5112 KB Output is correct
2 Correct 106 ms 5112 KB Output is correct
3 Correct 93 ms 5112 KB Output is correct
4 Correct 96 ms 5112 KB Output is correct
5 Correct 106 ms 5112 KB Output is correct
6 Correct 89 ms 5112 KB Output is correct
7 Correct 0 ms 5112 KB Output is correct
8 Correct 0 ms 5112 KB Output is correct
9 Correct 0 ms 5112 KB Output is correct
10 Correct 0 ms 5112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 106 ms 5112 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 103 ms 5112 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 109 ms 5112 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -