제출 #16034

#제출 시각아이디문제언어결과실행 시간메모리
16034hongjun7컴퓨터 네트워크 (BOI14_network)C++98
25 / 100
150 ms5084 KiB
#include "network.h"
int da[2005], db[2005];
void findRoute(int N, int a, int b) {
	int dist = ping(a, b);
	for (int i = 1; i <= N; i++) if (i != a) da[i] = ping(a, i);
	for (int i = 1; i <= N; i++) if (i != b) db[i] = ping(b, i);
	for (int i = 1; i <= dist; ++i) {
		for (int j = 1; j <= N; j++) {
			if (j != a && da[j] == i - 1 && db[j] == dist - i) {
				travelTo(j);
				break;
			}
		}
	}
	travelTo(b);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...