Submission #740066

#TimeUsernameProblemLanguageResultExecution timeMemory
740066veehzComputer Network (BOI14_network)C++17
100 / 100
94 ms7984 KiB
#include "network.h" #include <bits/stdc++.h> using namespace std; void findRoute(int n, int a, int b) { vector<vector<int>> dist(n); dist[0].push_back(b); for(int i=1;i<=n;i++){ if(i == b) continue; dist[ping(i,b)+1].push_back(i); } int cur = a, d = ping(a,b)+1; while(d){ for(auto& i : dist[d-1]){ if(ping(cur,i) == 0){ travelTo(i); cur = i; d--; 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...