답안 #16055

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
16055 2015-08-12T06:00:31 Z tonyjjw 컴퓨터 네트워크 (BOI14_network) C++14
컴파일 오류
0 ms 0 KB
#include<vector>
#define MN 1000

using namespace std;

vector<int> A[MN+1];
int d[MN+1];

void findRoute(int N,int a,int b){
  for(int i=1;i<=N;i++){
    d[i]=ping(i,b)+1;
    if(i==b)d[i]=0;
    A[d[i]].push_back(i);
  }
  while(a!=b){
    for(auto n:A[d[a]-1]){
      if(ping(a,n)==0){
        travelTo(n);
        a=n;
        break;
      }
    }
  }
}

Compilation message

network.cpp: In function ‘void findRoute(int, int, int)’:
network.cpp:11:18: error: ‘ping’ was not declared in this scope
     d[i]=ping(i,b)+1;
                  ^
network.cpp:17:18: error: ‘ping’ was not declared in this scope
       if(ping(a,n)==0){
                  ^
network.cpp:18:19: error: ‘travelTo’ was not declared in this scope
         travelTo(n);
                   ^
grader.c: In function ‘int main()’:
grader.c:48:39: 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:41: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &distance[u][v]);
                                         ^