Submission #16054

# Submission time Handle Problem Language Result Execution time Memory
16054 2015-08-11T05:13:31 Z kaTkaHr Computer Network (BOI14_network) C++
25 / 100
130 ms 5072 KB
#include "network.h"
#include<vector>

using namespace std;

const int MX = 1005;

int ans[MX];

void findRoute (int N, int a, int b)
{
	int D = ping(a, b) + 1;
	ans[0] = a, ans[D] = b;
	for (int i = 1; i <= N; i++){
		if (i == a || i == b) continue;
		int x = ping(a, i) + 1, y = ping(i, b) + 1;
		if (x + y == D) ans[x] = i;
	}
	for (int i = 1; i <= D; i++) travelTo(ans[i]);
}
# Verdict Execution time Memory Grader output
1 Correct 123 ms 5072 KB Output is correct
2 Correct 130 ms 5072 KB Output is correct
3 Correct 94 ms 5072 KB Output is correct
4 Correct 114 ms 5072 KB Output is correct
5 Correct 46 ms 5072 KB Output is correct
6 Correct 112 ms 5072 KB Output is correct
7 Correct 0 ms 5072 KB Output is correct
8 Correct 0 ms 5072 KB Output is correct
9 Correct 0 ms 5072 KB Output is correct
10 Correct 0 ms 5072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 51 ms 5072 KB Output isn't correct - Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 106 ms 5072 KB Output isn't correct - Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 113 ms 5072 KB Output isn't correct - Travelling to nonadjacent computer
2 Halted 0 ms 0 KB -