답안 #448568

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
448568 2021-07-30T19:21:15 Z Aryan_Raina 컴퓨터 네트워크 (BOI14_network) C++17
25 / 100
99 ms 4408 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 && da[i]+db[i]+1 == da[b]) 
                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 97 ms 4212 KB Output is correct
2 Correct 99 ms 4192 KB Output is correct
3 Correct 93 ms 4188 KB Output is correct
4 Correct 95 ms 4224 KB Output is correct
5 Correct 93 ms 4176 KB Output is correct
6 Correct 97 ms 4408 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 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 93 ms 4172 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 94 ms 4288 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 94 ms 4152 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -