Submission #574117

# Submission time Handle Problem Language Result Execution time Memory
574117 2022-06-07T21:54:48 Z imsifile Computer Network (BOI14_network) C++17
0 / 100
89 ms 4192 KB
#include "network.h"

int dd[1010];

int ping(int, int);
void travelTo(int);

void findRoute(int N, int a, int b)
{
	for (int i = 1; i <= N; i++)
		dd[i] = i != b ? ping(i, b) : 0;
	int pv = a;
	for (int i = 1; i <= N; i++)
	{
		for (int j = 1; j <= N; j++)
		{
			if (dd[pv] != dd[j] + 1)
				continue;
			if (ping(pv, j) == 1)
			{
				travelTo(j);
				pv = j;
				break;
			}
		}
		if (pv == b)
			break;
	}
}

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]
   48 |     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]
   51 |             scanf("%d", &distance[u][v]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 82 ms 4192 KB Message has not reached its target
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 81 ms 4188 KB Message has not reached its target
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 88 ms 4144 KB Too many calls to ping
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 89 ms 4148 KB Too many calls to ping
2 Halted 0 ms 0 KB -