Submission #855828

# Submission time Handle Problem Language Result Execution time Memory
855828 2023-10-02T02:21:01 Z Hard_slipper Computer Network (BOI14_network) C++14
25 / 100
70 ms 11856 KB
#include "network.h"
//#include "grader.cpp"
#include<bits/stdc++.h>
using namespace std;

int path[1005][1005] = {};

void findRoute (int N, int a, int b)
{
    int dist = ping(a, b)+1;

    for(int i =1; i <= N; i++)
    {
        if(i == a || i == b) continue;
        int cur_dist = ping(a, i)+1;
        int final_dist = ping(i, b)+1;
        //cout << cur_dist << ' ' << final_dist << '\n';
        if(cur_dist+final_dist == dist)
        {
            path[cur_dist][final_dist] = i;
        }
    }
    path[dist][0] = b;
    int cur_dist = 1;
    int final_dist = dist-1;
    while(cur_dist <= dist)
    {
        travelTo(path[cur_dist][final_dist]);
        final_dist--;
        cur_dist++;
    }
}

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 65 ms 11856 KB Output is correct
2 Correct 70 ms 11296 KB Output is correct
3 Correct 61 ms 8800 KB Output is correct
4 Correct 64 ms 8788 KB Output is correct
5 Correct 62 ms 8596 KB Output is correct
6 Correct 62 ms 8688 KB Output is correct
7 Correct 0 ms 2648 KB Output is correct
8 Correct 1 ms 2392 KB Output is correct
9 Correct 0 ms 2396 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 63 ms 8616 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 64 ms 8528 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 64 ms 8484 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -