Submission #1314800

#TimeUsernameProblemLanguageResultExecution timeMemory
1314800mantaggezComputer Network (BOI14_network)C++20
100 / 100
53 ms4344 KiB
#include "network.h"
#include <bits/stdc++.h>
using namespace std;

void findRoute (int N, int a, int b)
{
	int dist = ping(a, b), prev = a;
	vector<int> tob(N + 1, -1), vs(N + 1, 0);
	
	for(int i=0;i<=dist;i++)
	{
		for(int j=1;j<=N;j++)
		{
			if(vs[j]) continue;
			if(tob[j] == -1 && j != b) tob[j] = ping(j, b);
	
			if(tob[j] == dist - i - 1 && ping(prev, j) == 0)
			{
				travelTo(j);
				vs[j] = 1;
				prev = j;
				break;			
			}			
		}
	}
}

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...