Submission #104705

# Submission time Handle Problem Language Result Execution time Memory
104705 2019-04-09T01:17:53 Z TAMREF Computer Network (BOI14_network) C++11
100 / 100
153 ms 8080 KB
#include "network.h"

int dist[1005];
void findRoute (int N, int a, int b)
{
    for(int i = 1; i <= N; i++) if(i != b) dist[i] = ping(i, b);
    dist[b] = -1;
    for(int now = a; now != b;){
        for(int k = 1; k <= N; k++){
            if(dist[k] + 1 == dist[now] && ping(k, now) == 0){
                now = k;
                travelTo(k);
                break;
            }
        }
    }
    return;
}

Compilation message

grader.c: In function 'int main()':
grader.c:48:11: 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:18: 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 153 ms 4348 KB Output is correct
2 Correct 112 ms 7544 KB Output is correct
3 Correct 118 ms 7032 KB Output is correct
4 Correct 136 ms 7096 KB Output is correct
5 Correct 107 ms 6836 KB Output is correct
6 Correct 105 ms 6664 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Correct 3 ms 640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 98 ms 4348 KB Output is correct
2 Correct 34 ms 2808 KB Output is correct
3 Correct 102 ms 7932 KB Output is correct
4 Correct 86 ms 6324 KB Output is correct
5 Correct 110 ms 8080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 92 ms 4216 KB Output is correct
2 Correct 31 ms 3064 KB Output is correct
3 Correct 112 ms 7916 KB Output is correct
4 Correct 115 ms 6264 KB Output is correct
5 Correct 129 ms 8004 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 106 ms 4216 KB Output is correct
2 Correct 25 ms 2936 KB Output is correct
3 Correct 108 ms 7672 KB Output is correct
4 Correct 95 ms 6264 KB Output is correct
5 Correct 104 ms 7928 KB Output is correct