Submission #392343

# Submission time Handle Problem Language Result Execution time Memory
392343 2021-04-20T20:07:43 Z ritul_kr_singh Computer Network (BOI14_network) C++17
100 / 100
134 ms 7880 KB
#include <bits/stdc++.h>
using namespace std;
#define sp << ' ' <<
#define nl << '\n'
#include "network.h"

void findRoute (int N, int a, int b){
	int dist = ping(a, b);
	vector<int> at[dist];
	for(int i=1; i<=N; ++i){
		if(i == a or i == b) continue;
		int k = ping(b, i);
		if(k < dist) at[k].push_back(i);
	}

	int u = a;

	for(int i=dist-1; i>=0; --i){
		for(int j : at[i]){
			if(!ping(u, j)){
				travelTo(u = j);
				break;
			}
		}
	}
	travelTo(b);
}

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 Correct 104 ms 4168 KB Output is correct
2 Correct 107 ms 4292 KB Output is correct
3 Correct 113 ms 4296 KB Output is correct
4 Correct 99 ms 4364 KB Output is correct
5 Correct 98 ms 4344 KB Output is correct
6 Correct 98 ms 4284 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 100 ms 4132 KB Output is correct
2 Correct 26 ms 2756 KB Output is correct
3 Correct 109 ms 7880 KB Output is correct
4 Correct 96 ms 6080 KB Output is correct
5 Correct 112 ms 7876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 132 ms 4124 KB Output is correct
2 Correct 26 ms 2756 KB Output is correct
3 Correct 111 ms 7748 KB Output is correct
4 Correct 96 ms 6112 KB Output is correct
5 Correct 108 ms 7880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 102 ms 4236 KB Output is correct
2 Correct 26 ms 2752 KB Output is correct
3 Correct 134 ms 7816 KB Output is correct
4 Correct 95 ms 6180 KB Output is correct
5 Correct 113 ms 7860 KB Output is correct