답안 #16039

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
16039 2015-08-10T11:40:17 Z hongjun7 컴퓨터 네트워크 (BOI14_network) C++
50 / 100
120 ms 5076 KB
#include "network.h"
int d[2005];
void findRoute(int N, int a, int b) {
	int dist = ping(a, b);
	for (int i = 1; i <= N; i++) d[i] = 0;
	for (int i = 1; i <= N; i++) {
		if (i != a)
			d[i] = ping(a, i) + 1;
	}
	for (int i = 1; i <= dist; i++) {
		for (int j = 1; j <= N; j++) {
			if (d[j] - d[a] == 1) {
				int v = ping(j, b);
				if (dist == v + d[a] + 1 && ping(a, j) == 0) {
					a = j;
					travelTo(j);
					break;
				}
			}
		}
	}
	travelTo(b);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 118 ms 5076 KB Output isn't correct - Too many calls to ping
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 75 ms 5076 KB Output is correct
2 Correct 32 ms 5076 KB Output is correct
3 Correct 77 ms 5076 KB Output is correct
4 Correct 98 ms 5076 KB Output is correct
5 Correct 117 ms 5076 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 102 ms 5076 KB Output is correct
2 Correct 32 ms 5076 KB Output is correct
3 Correct 120 ms 5076 KB Output is correct
4 Correct 103 ms 5076 KB Output is correct
5 Correct 112 ms 5076 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 96 ms 5076 KB Output isn't correct - Too many calls to ping
2 Halted 0 ms 0 KB -