답안 #752889

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
752889 2023-06-04T07:55:54 Z 125259 컴퓨터 네트워크 (BOI14_network) C++17
25 / 100
83 ms 7848 KB
#include "network.h"
#include <bits/stdc++.h>
using namespace std;

void findRoute (int n, int a, int b){
	int arr[n+1],arr1[n+1];
    for(int i=1; i<=n; i++){
		if(i==a or i==b) continue;
		arr[i]=ping(a,i);
		arr1[i]=ping(b,i);
	}
	int dist=ping(a,b);
	for(int i=0; i<dist; i++){
		for(int j=1; j<=n; j++){
			if(j==a or j==b)continue;
			if(arr[j]==i and arr1[j]==dist-1-i) travelTo(j);
		}
	}
	travelTo(b);
    /*int dist = ping(a, b);
    for (int i = 1; i <= dist; ++i)
        travelTo (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 83 ms 7848 KB Output is correct
2 Correct 72 ms 7388 KB Output is correct
3 Correct 77 ms 6984 KB Output is correct
4 Correct 70 ms 6944 KB Output is correct
5 Correct 77 ms 6600 KB Output is correct
6 Correct 71 ms 6632 KB Output is correct
7 Correct 1 ms 312 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 70 ms 6652 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 74 ms 6592 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 82 ms 6608 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -