Submission #107945

# Submission time Handle Problem Language Result Execution time Memory
107945 2019-04-26T09:44:15 Z tjd229 Computer Network (BOI14_network) C++14
100 / 100
143 ms 8056 KB
#include "network.h"
#include <vector>
using namespace std;
vector<int> candi[1000];
int path[1000];
void findRoute (int N, int a, int b)
{
	int len = ping(a, b);
	for (int i = 1; i <= N; ++i) {
		if (a == i || b == i) continue;
		int d = ping(a, i);
		candi[d].push_back(i);
	}
	path[len] = b;
	for (int i = len-1; i >= 0; --i) {
		for (auto x : candi[i]) {
			if (ping(x, b) == 0) {
				b = x;
				path[i] = b;
				break;
			}
		}
	}
	for (int i = 0; i <= len; ++i) travelTo(path[i]);
	
}

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]
     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]
             scanf("%d", &distance[u][v]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 128 ms 4316 KB Output is correct
2 Correct 136 ms 7544 KB Output is correct
3 Correct 84 ms 7160 KB Output is correct
4 Correct 104 ms 7032 KB Output is correct
5 Correct 99 ms 6792 KB Output is correct
6 Correct 111 ms 6776 KB Output is correct
7 Correct 3 ms 384 KB Output is correct
8 Correct 3 ms 384 KB Output is correct
9 Correct 2 ms 384 KB Output is correct
10 Correct 3 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 87 ms 4268 KB Output is correct
2 Correct 22 ms 2304 KB Output is correct
3 Correct 105 ms 4344 KB Output is correct
4 Correct 81 ms 4344 KB Output is correct
5 Correct 114 ms 4344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 103 ms 4264 KB Output is correct
2 Correct 30 ms 2296 KB Output is correct
3 Correct 97 ms 4344 KB Output is correct
4 Correct 80 ms 4344 KB Output is correct
5 Correct 98 ms 4344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 120 ms 4268 KB Output is correct
2 Correct 26 ms 2424 KB Output is correct
3 Correct 143 ms 4344 KB Output is correct
4 Correct 95 ms 6264 KB Output is correct
5 Correct 118 ms 8056 KB Output is correct