Submission #448568

#TimeUsernameProblemLanguageResultExecution timeMemory
448568Aryan_RainaComputer Network (BOI14_network)C++17
25 / 100
99 ms4408 KiB
#include "network.h" #include <bits/stdc++.h> using namespace std; void findRoute (int N, int a, int b) { int da[N+1], db[N+1]; for (int i = 1; i <= N; i++) if (a != i) da[i] = ping(a, i); for (int i = 1; i <= N; i++) if (b != i) db[i] = ping(b, i); da[a] = db[b] = -1; int cur = a; while (cur != b) for (int i = 1; i <= N; i++) if (da[i] == da[cur]+1 && da[i]+db[i]+1 == da[b]) travelTo(cur = 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...