Submission #445365

#TimeUsernameProblemLanguageResultExecution timeMemory
445365wind_reaperComputer Network (BOI14_network)C++17
0 / 100
109 ms7876 KiB
#include <bits/stdc++.h>
#include "network.h"

using namespace std;

int _ping(int u, int v){
	return (u == v ? -1 : ping(u, v));
}

void findRoute(int N, int u, int v){
	int dist[N + 1];
	for(int i = 1; i <= N; i++)
		dist[i] = _ping(v, i);

	int cur = u;
	for(int i = dist[u] - 1; i >= 0; --i)
		for(int j = 1; j <= N; j++){
			if(dist[j] == i && ping(cur, i) == 0){
				travelTo(i);
				cur = i;
			}
		}
}

Compilation message (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...