Submission #76644

# Submission time Handle Problem Language Result Execution time Memory
76644 2018-09-15T11:02:01 Z Vasiljko Computer Network (BOI14_network) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "network.h"
using namespace std;

typedef long long ll;
const ll MOD = 1e9+7;
const int N = 1005;

vector<int>v[N];

void findRoute(int n,int a,int b){
    int dist=ping(a,b);

    for(int i=1;i<=n;i++){
        v[ping(i,b)].push_back(i);
    }
    int cur=a;
    dist--;
    while(dist>=0){
        int i=0;
        while(ping(v[dist][i].cur)!=0)i++;

        cur=v[dist][cur];
        dist--;
        travelTo(cur);
    }
    travelTo(b);
}

Compilation message

network.cpp: In function 'void findRoute(int, int, int)':
network.cpp:21:31: error: request for member 'cur' in 'v[dist].std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}'
         while(ping(v[dist][i].cur)!=0)i++;
                               ^~~
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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~