답안 #47316

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
47316 2018-04-30T13:41:09 Z rajarshi_basu 컴퓨터 네트워크 (BOI14_network) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

#define FOR(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define mp make_pair
#define pb push_back
#define iii pair<int, pair<int,int> >
#define vi vector<int>

using namespace std;

void findRoute(int N,int a,int b){
  int dist[N];

  for(int i = 0;i<N; i++){
    if(i == b)dist[i] = 0;
    else{
      dist[i] = ping(i,b) + 1;
    }  
  }

  int node = a;
  while(true){
    for(int i=1;i<=N;i++){
      if((dist[i] == dist[node] - 1) and (ping(node,i) == 0)){
        travelTo(node);
      }
      if(node == b)break;
    }
  }
}

Compilation message

network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:18:17: error: 'ping' was not declared in this scope
       dist[i] = ping(i,b) + 1;
                 ^~~~
network.cpp:18:17: note: suggested alternative: 'uint'
       dist[i] = ping(i,b) + 1;
                 ^~~~
                 uint
network.cpp:25:43: error: 'ping' was not declared in this scope
       if((dist[i] == dist[node] - 1) and (ping(node,i) == 0)){
                                           ^~~~
network.cpp:25:43: note: suggested alternative: 'uint'
       if((dist[i] == dist[node] - 1) and (ping(node,i) == 0)){
                                           ^~~~
                                           uint
network.cpp:26:9: error: 'travelTo' was not declared in this scope
         travelTo(node);
         ^~~~~~~~
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]
     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]
             scanf("%d", &distance[u][v]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~