제출 #445364

#제출 시각아이디문제언어결과실행 시간메모리
445364wind_reaper컴퓨터 네트워크 (BOI14_network)C++17
컴파일 에러
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; } } }

컴파일 시 표준 에러 (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]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~