Submission #741685

#TimeUsernameProblemLanguageResultExecution timeMemory
741685TheOpChickenComputer Network (BOI14_network)C++17
0 / 100
108 ms7884 KiB
#include <iostream> #include <vector> #include "network.h" using namespace std; void findRoute(int n, int a, int b){ vector<vector<int> > dist(n+5, vector<int>()); vector<int> length(n+5); dist[0].push_back(a); for (int i = 1; i <= n; i++){ if (i == a) continue; int len = ping(a, i); dist[len].push_back(a); length[i] = len; } int cur_node = b; vector<int> ans; for (int i = length[b]; i >= 1; i--){ ans.push_back(cur_node); for (int node: dist[i-1]){ int len = ping(cur_node, node); if (len == 1){ cur_node = node; break; } } } for (int i = ans.size()-1; i >= 0; i--) travelTo(ans[i]); return; }

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...