Submission #445364

#TimeUsernameProblemLanguageResultExecution timeMemory
445364wind_reaperComputer Network (BOI14_network)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "network.h" using namespace std; int _ping(int u, int v){ return (u == v ? -1 : ping(i, j)); } void findRoute(int N, int u, int v){ int dist[N + 1]; for(int i = 1; i <= N; i++) dist[i] = _ping(v, i); int cur = u; for(int i = dist[u] - 1; i >= 0; --i) for(int j = 1; j <= N; j++){ if(dist[j] == i && ping(cur, i) == 0){ travelTo(i); cur = i; } } }

Compilation message (stderr)

network.cpp: In function 'int _ping(int, int)':
network.cpp:7:29: error: 'i' was not declared in this scope
    7 |  return (u == v ? -1 : ping(i, j));
      |                             ^
network.cpp:7:32: error: 'j' was not declared in this scope
    7 |  return (u == v ? -1 : ping(i, j));
      |                                ^
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]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~