Submission #397596

#TimeUsernameProblemLanguageResultExecution timeMemory
397596lycComputer Network (BOI14_network)C++14
100 / 100
119 ms7900 KiB
#include "network.h" #include <bits/stdc++.h> using namespace std; int _ping(int a, int b) { if (a == b) return -1; return ping(a,b); } void findRoute (int N, int a, int b) { int dist[N+1]; for (int i = 1; i <= N; ++i) { dist[i] = _ping(a,i); } vector<int> v = {b}; for (int d = dist[b]-1; d >= 0; --d) { for (int i = 1; i <= N; ++i) if (dist[i] == d && _ping(v.back(),i) == 0) { v.push_back(i); break; } } for (int i = (int)v.size()-1; i >= 0; --i) { travelTo(v[i]); } }

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