답안 #482971

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
482971 2021-10-27T06:58:15 Z PoPularPlusPlus 컴퓨터 네트워크 (BOI14_network) C++17
100 / 100
95 ms 7968 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 95 ms 7968 KB Output is correct
2 Correct 80 ms 7348 KB Output is correct
3 Correct 73 ms 6980 KB Output is correct
4 Correct 76 ms 6956 KB Output is correct
5 Correct 80 ms 6672 KB Output is correct
6 Correct 83 ms 6676 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 352 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 Correct 87 ms 6620 KB Output is correct
2 Correct 24 ms 2784 KB Output is correct
3 Correct 81 ms 7804 KB Output is correct
4 Correct 84 ms 6184 KB Output is correct
5 Correct 76 ms 7856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 82 ms 6596 KB Output is correct
2 Correct 22 ms 2760 KB Output is correct
3 Correct 80 ms 7828 KB Output is correct
4 Correct 82 ms 6124 KB Output is correct
5 Correct 77 ms 7848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 83 ms 6696 KB Output is correct
2 Correct 23 ms 2716 KB Output is correct
3 Correct 80 ms 7732 KB Output is correct
4 Correct 81 ms 6180 KB Output is correct
5 Correct 77 ms 7884 KB Output is correct