답안 #445367

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
445367 2021-07-17T17:00:18 Z wind_reaper 컴퓨터 네트워크 (BOI14_network) C++17
25 / 100
117 ms 7468 KB
#include <bits/stdc++.h>
#include "network.h"

using namespace std;

int _ping(int u, int v){
	return (u == v ? -1 : ping(u, v));
}

void findRoute(int N, int u, int v){
	int dist[N + 1];
	for(int i = 1; i <= N; i++)
		dist[i] = _ping(v, i);

	int cur = u;
	for(int i = dist[u] - 1; i >= 0; --i)
		for(int j = 1; j <= N; j++){
			if(dist[j] == i && ping(cur, j) == 0){
				travelTo(j);
				cur = j;
			}
		}

	travelTo(v);
}

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 117 ms 4292 KB Output is correct
2 Correct 108 ms 7468 KB Output is correct
3 Correct 97 ms 6928 KB Output is correct
4 Correct 104 ms 6980 KB Output is correct
5 Correct 96 ms 6704 KB Output is correct
6 Correct 111 ms 6636 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 296 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 99 ms 4196 KB Route is too long
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 97 ms 4224 KB Route is too long
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 103 ms 4280 KB Route is too long
2 Halted 0 ms 0 KB -