Submission #752367

# Submission time Handle Problem Language Result Execution time Memory
752367 2023-06-03T01:21:30 Z jamielim Computer Network (BOI14_network) C++14
50 / 100
91 ms 7920 KB
#include "network.h"
#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> ii;
const int INF=1012345678;

map<int,vector<int> > dista;

void findRoute (int N, int a, int b){
	int d=ping(a,b);
    for(int i=1;i<=N;i++){
		if(i==a||i==b)continue;
		int x=ping(i,a);
		dista[x].pb(i);
	}
	int cur=a;

	for(int i=0;i<d;i++){
		for(int j:dista[i]){
			if(i==0||ping(cur,j)==0){
				if(ping(j,b)+i+1==d){
					cur=j;
					travelTo(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 Incorrect 71 ms 4348 KB Too many calls to ping
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 71 ms 4212 KB Output is correct
2 Correct 18 ms 2200 KB Output is correct
3 Correct 91 ms 4284 KB Output is correct
4 Correct 72 ms 6172 KB Output is correct
5 Correct 86 ms 7920 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 85 ms 4176 KB Output is correct
2 Correct 19 ms 2296 KB Output is correct
3 Correct 73 ms 4180 KB Output is correct
4 Correct 67 ms 6128 KB Output is correct
5 Correct 74 ms 7896 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 81 ms 4160 KB Output is correct
2 Correct 18 ms 2328 KB Output is correct
3 Incorrect 79 ms 4216 KB Too many calls to ping
4 Halted 0 ms 0 KB -