Submission #16041

# Submission time Handle Problem Language Result Execution time Memory
16041 2015-08-10T11:44:27 Z hongjun7 Computer Network (BOI14_network) C++
0 / 100
151 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 + 1; i++) {
		for (int j = 1; j <= N; j++) {
			if (d[j] - d[a] == 1) {
				if (ping(a, j) == 0) {
					a = j;
					travelTo(j);
					break;
				}
			}
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 151 ms 5076 KB Output is correct
2 Incorrect 106 ms 5076 KB Output isn't correct - Message has not reached its target
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 70 ms 5076 KB Output is correct
2 Incorrect 21 ms 5076 KB Output isn't correct - Message has not reached its target
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 54 ms 5076 KB Output is correct
2 Incorrect 32 ms 5076 KB Output isn't correct - Message has not reached its target
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 113 ms 5076 KB Output is correct
2 Incorrect 18 ms 5076 KB Output isn't correct - Message has not reached its target
3 Halted 0 ms 0 KB -