Submission #752364

#TimeUsernameProblemLanguageResultExecution timeMemory
752364jamielimComputer Network (BOI14_network)C++14
25 / 100
100 ms7948 KiB
#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; if(d>(N-2)/2){ for(int i=0;i<d;i++){ for(int j:dista[i]){ if(ping(j,b)+i+1==d){ cur=j; travelTo(j); break; } } } travelTo(b); }else{ 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 (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...