답안 #495027

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
495027 2021-12-18T02:57:10 Z uHyHn 컴퓨터 네트워크 (BOI14_network) C++14
100 / 100
89 ms 8016 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>=0; --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 Correct 74 ms 8016 KB Output is correct
2 Correct 73 ms 7380 KB Output is correct
3 Correct 76 ms 6944 KB Output is correct
4 Correct 69 ms 7024 KB Output is correct
5 Correct 74 ms 6696 KB Output is correct
6 Correct 78 ms 6632 KB Output is correct
7 Correct 1 ms 308 KB Output is correct
8 Correct 0 ms 336 KB Output is correct
9 Correct 0 ms 208 KB Output is correct
10 Correct 1 ms 328 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 76 ms 6580 KB Output is correct
2 Correct 22 ms 2760 KB Output is correct
3 Correct 77 ms 7752 KB Output is correct
4 Correct 79 ms 6096 KB Output is correct
5 Correct 76 ms 8004 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 83 ms 6700 KB Output is correct
2 Correct 27 ms 2736 KB Output is correct
3 Correct 73 ms 7744 KB Output is correct
4 Correct 77 ms 6128 KB Output is correct
5 Correct 73 ms 7944 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 89 ms 6640 KB Output is correct
2 Correct 21 ms 2744 KB Output is correct
3 Correct 75 ms 7824 KB Output is correct
4 Correct 79 ms 6072 KB Output is correct
5 Correct 76 ms 7992 KB Output is correct