Submission #448570

# Submission time Handle Problem Language Result Execution time Memory
448570 2021-07-30T19:29:14 Z Aryan_Raina Computer Network (BOI14_network) C++17
25 / 100
118 ms 4224 KB
#include "network.h"
#include <bits/stdc++.h>
 
using namespace std;
 
void findRoute (int N, int a, int b) {
    int d[N+1];
    for (int i = 1; i <= N; i++) 
        if (b != i) d[i] = ping(b, i);
 
    d[b] = -1;
 
    int cur = a;
    for (int steps = 1; cur != b; steps++) 
        for (int i = 1; i <= N; i++) 
            if (d[i] == d[a] - steps && !ping(cur, i)) 
                travelTo(cur = i);
}

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]
   48 |     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]
   51 |             scanf("%d", &distance[u][v]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 101 ms 4136 KB Output is correct
2 Correct 96 ms 4144 KB Output is correct
3 Correct 90 ms 4148 KB Output is correct
4 Correct 90 ms 4196 KB Output is correct
5 Correct 94 ms 4148 KB Output is correct
6 Correct 116 ms 4120 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 95 ms 4208 KB Route is too long
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 94 ms 4164 KB Route is too long
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 118 ms 4224 KB Route is too long
2 Halted 0 ms 0 KB -