답안 #392334

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
392334 2021-04-20T19:58:34 Z ritul_kr_singh 컴퓨터 네트워크 (BOI14_network) C++17
25 / 100
139 ms 8028 KB
#include <bits/stdc++.h>
using namespace std;
// #define int long long
#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(a, i);
		if(k < dist) at[k].push_back(i);
	}
 
	for(int i=0; i<dist; ++i){
		for(int j : at[i]){
			if(i + 1 + ping(j, b) == dist){
				travelTo(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 135 ms 8028 KB Output is correct
2 Correct 113 ms 7356 KB Output is correct
3 Correct 123 ms 6936 KB Output is correct
4 Correct 139 ms 6960 KB Output is correct
5 Correct 121 ms 6612 KB Output is correct
6 Correct 110 ms 6724 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 304 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 121 ms 6652 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 116 ms 6596 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 113 ms 6628 KB Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -