Submission #12932

# Submission time Handle Problem Language Result Execution time Memory
12932 2015-01-21T01:58:06 Z gs14004 Computer Network (BOI14_network) C++
Compilation error
0 ms 0 KB
#include <vector>
#include "network.h"
using namespace std;

vector<int> dist[1001];

int findRoute(int N, int a, int b){
  int l = ping(a,b) + 1;
  for(int i=1; i<=N; i++){
   	int l2 = ping(b,i) + 1;
    if(l <= l2) continue;
    dist[l - l2].push_back(i);
  }
  int p = a;
  for(int i=1; i<=l; i++){
    for(int j=0; j<dist[i].size(); j++){
      if(ping(p,dist[i][j]) == 0){
        travelTo(dist[i][j]);
        p = dist[i][j];
      }
    }
  }
}

Compilation message

network.cpp: In function 'int findRoute(int, int, int)':
network.cpp:7:34: error: new declaration 'int findRoute(int, int, int)'
network.h:1:6: error: ambiguates old declaration 'void findRoute(int, int, int)'
network.cpp:16:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
network.cpp:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
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]
grader.c:51:41: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]