Submission #16066

# Submission time Handle Problem Language Result Execution time Memory
16066 2015-08-15T11:16:15 Z paruru Computer Network (BOI14_network) C++
Compilation error
0 ms 0 KB
#include "network.h"
#include<vector>
using namespace std;
vector<int> V[1200];
int arr[1002];
void findRoute (int N, int a, int b)
{
    int t=ping(a,b);
    for(int i=1;i<=N;i++)
    {
        if(i!=a&&i!=b)
        {
            int k=ping(i,b);
            V[k].push_back(i);
        }
    }
    int cur=a;
    for(int i=t-1;i>=0;i++)
    {
        for(int k=0;k<V[i].size();k++)
        {
            if(ping(cur,V[i][k])==0)
            {
                cur=V[i][k];
                travel_to(V[i][k]);
                break;
            }
        }
    }
    travel_to(b);
    
}

Compilation message

network.cpp: In function ‘void findRoute(int, int, int)’:
network.cpp:20:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int k=0;k<V[i].size();k++)
                      ^
network.cpp:25:34: error: ‘travel_to’ was not declared in this scope
                 travel_to(V[i][k]);
                                  ^
network.cpp:30:16: error: ‘travel_to’ was not declared in this scope
     travel_to(b);
                ^
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]);
                                         ^