답안 #161868

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
161868 2019-11-05T01:24:03 Z AQT 컴퓨터 네트워크 (BOI14_network) C++14
100 / 100
120 ms 8196 KB
#include <bits/stdc++.h>
#include "network.h"

using namespace std;

vector<int> dist[1005];

void findRoute(int N, int A, int B){
    int D = ping(A, B)+1;
    for(int n = 1; n<=N; n++){
        if(n != A && n != B){
            int k = ping(n, B);
            dist[k+1].push_back(n);
        }
    }
    int crnt = A;
    for(int d = D-1; d; d--){
        int lst = crnt;
        for(int n : dist[d]){
            if(ping(crnt, n) == 0){
                crnt = n;
                travelTo(n);
                break;
            }
        }
        assert(crnt != lst);
    }
    travelTo(B);
}

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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 119 ms 4344 KB Output is correct
2 Correct 115 ms 7544 KB Output is correct
3 Correct 103 ms 7240 KB Output is correct
4 Correct 103 ms 7160 KB Output is correct
5 Correct 117 ms 7064 KB Output is correct
6 Correct 101 ms 6712 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 108 ms 4348 KB Output is correct
2 Correct 27 ms 2884 KB Output is correct
3 Correct 120 ms 8056 KB Output is correct
4 Correct 92 ms 6264 KB Output is correct
5 Correct 119 ms 8196 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 107 ms 4344 KB Output is correct
2 Correct 27 ms 2920 KB Output is correct
3 Correct 118 ms 7900 KB Output is correct
4 Correct 92 ms 6392 KB Output is correct
5 Correct 119 ms 8056 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 105 ms 4344 KB Output is correct
2 Correct 27 ms 2852 KB Output is correct
3 Correct 118 ms 7928 KB Output is correct
4 Correct 92 ms 6264 KB Output is correct
5 Correct 119 ms 8120 KB Output is correct