Submission #752448

# Submission time Handle Problem Language Result Execution time Memory
752448 2023-06-03T03:31:24 Z jamezzz Computer Network (BOI14_network) C++17
100 / 100
116 ms 7808 KB
#include "network.h"

int d[1005];

void findRoute (int N,int a,int b){
    int cur=a;
    for(int i=1;i<=N;++i)d[i]=i==b?-1:ping(i,b);
    while(cur!=b){
		for(int i=1;i<=N;++i){
			if(d[i]==d[cur]-1&&ping(cur,i)==0){
				travelTo(i);
				cur=i;
				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 Correct 116 ms 4344 KB Output is correct
2 Correct 92 ms 4332 KB Output is correct
3 Correct 96 ms 4344 KB Output is correct
4 Correct 88 ms 4268 KB Output is correct
5 Correct 98 ms 4284 KB Output is correct
6 Correct 92 ms 4312 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 108 ms 4256 KB Output is correct
2 Correct 25 ms 2376 KB Output is correct
3 Correct 114 ms 4340 KB Output is correct
4 Correct 88 ms 4556 KB Output is correct
5 Correct 97 ms 4524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 104 ms 4244 KB Output is correct
2 Correct 22 ms 2404 KB Output is correct
3 Correct 105 ms 4328 KB Output is correct
4 Correct 102 ms 4580 KB Output is correct
5 Correct 105 ms 4520 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 101 ms 4276 KB Output is correct
2 Correct 32 ms 2368 KB Output is correct
3 Correct 106 ms 4248 KB Output is correct
4 Correct 90 ms 6084 KB Output is correct
5 Correct 90 ms 7808 KB Output is correct