답안 #392342

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
392342 2021-04-20T20:06:43 Z ritul_kr_singh 컴퓨터 네트워크 (BOI14_network) C++17
0 / 100
105 ms 4332 KB
#include <bits/stdc++.h>
using namespace std;
#define sp << ' ' <<
#define nl << '\n'
#include "network.h"

void findRoute (int N, int a, int b){
	int dist = ping(a, b);
	vector<int> at[dist];
	for(int i=1; i<=N; ++i){
		if(i == a or i == b) continue;
		int k = ping(b, i);
		if(k < dist) at[k].push_back(i);
	}

	int u = a;

	for(int i=dist-1; i; --i){
		for(int j : at[i]){
			if(!ping(u, j)){
				travelTo(u = j);
				break;
			}
		}
	}
	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]
   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 Incorrect 105 ms 4292 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 100 ms 4280 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 100 ms 4332 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 99 ms 4292 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -