답안 #448567

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
448567 2021-07-30T19:11:24 Z Aryan_Raina 컴퓨터 네트워크 (BOI14_network) C++17
25 / 100
109 ms 7888 KB
#include "network.h"
#include <bits/stdc++.h>

using namespace std;

void findRoute (int N, int a, int b) {
    int da[N+1], db[N+1];
    for (int i = 1; i <= N; i++) 
        if (a != i) da[i] = ping(a, i);
    for (int i = 1; i <= N; i++) 
        if (b != i) db[i] = ping(b, i);

    da[a] = db[b] = -1;

    int cur = a;
    while (cur != b) 
        for (int i = 1; i <= N; i++) 
            if (da[i] == da[cur]+1 && db[i]+1 == db[cur]) 
                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]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 109 ms 7888 KB Output is correct
2 Correct 101 ms 7420 KB Output is correct
3 Correct 99 ms 6996 KB Output is correct
4 Correct 93 ms 6932 KB Output is correct
5 Correct 97 ms 6588 KB Output is correct
6 Correct 93 ms 6588 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 106 ms 6580 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 97 ms 6612 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 103 ms 6680 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -