Submission #20821

# Submission time Handle Problem Language Result Execution time Memory
20821 2017-02-17T15:32:42 Z jjwdi0 Computer Network (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]);
                                         ^
# Verdict Execution time Memory 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
# Verdict Execution time Memory Grader output
1 Incorrect 106 ms 5112 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 103 ms 5112 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 109 ms 5112 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -