Submission #240217

# Submission time Handle Problem Language Result Execution time Memory
240217 2020-06-18T21:48:56 Z oscarsierra12 Crocodile's Underground City (IOI11_crocodile) C++14
Compilation error
0 ms 0 KB
#include "crocodile.h"
#include <bits/stdc++.h>
using namespace std ;

const int N = 1010 ;

int dp[N];
vector <pair<int,int>> G[N] ;

int go ( int u, int p ) {
    int frMn = INT_MAX, scMn ;
    for ( auto v:G[u] ) {
        if ( p == v.ff ) continue ;
        go ( v.ff, u ) ;
        if ( dp[v.ff] + v.ss <= frMn ) frMn = dp[v.ff] + v.ss, scMn = frMn ;
        else if ( dp[v.ff] + v.ss < scMn ) scMn = dp[v.ff] + v.ss ;
    }
    dp[u] = scMn ;
}

int travel_plan(int N, int M, int R[][2], int L[], int K, int P[])
{
  for ( int i = 0 ; i < M; ++i ) G[R[i][0]].pb ( { R[i][1], L[i] } ), G[R[i][1]].pb({R[i][0],L[i]}) ;
  return go(0,-1);
}


Compilation message

crocodile.cpp: In function 'int go(int, int)':
crocodile.cpp:13:21: error: 'struct std::pair<int, int>' has no member named 'ff'
         if ( p == v.ff ) continue ;
                     ^~
crocodile.cpp:14:16: error: 'struct std::pair<int, int>' has no member named 'ff'
         go ( v.ff, u ) ;
                ^~
crocodile.cpp:15:19: error: 'struct std::pair<int, int>' has no member named 'ff'
         if ( dp[v.ff] + v.ss <= frMn ) frMn = dp[v.ff] + v.ss, scMn = frMn ;
                   ^~
crocodile.cpp:15:27: error: 'struct std::pair<int, int>' has no member named 'ss'
         if ( dp[v.ff] + v.ss <= frMn ) frMn = dp[v.ff] + v.ss, scMn = frMn ;
                           ^~
crocodile.cpp:15:52: error: 'struct std::pair<int, int>' has no member named 'ff'
         if ( dp[v.ff] + v.ss <= frMn ) frMn = dp[v.ff] + v.ss, scMn = frMn ;
                                                    ^~
crocodile.cpp:15:60: error: 'struct std::pair<int, int>' has no member named 'ss'
         if ( dp[v.ff] + v.ss <= frMn ) frMn = dp[v.ff] + v.ss, scMn = frMn ;
                                                            ^~
crocodile.cpp:16:24: error: 'struct std::pair<int, int>' has no member named 'ff'
         else if ( dp[v.ff] + v.ss < scMn ) scMn = dp[v.ff] + v.ss ;
                        ^~
crocodile.cpp:16:32: error: 'struct std::pair<int, int>' has no member named 'ss'
         else if ( dp[v.ff] + v.ss < scMn ) scMn = dp[v.ff] + v.ss ;
                                ^~
crocodile.cpp:16:56: error: 'struct std::pair<int, int>' has no member named 'ff'
         else if ( dp[v.ff] + v.ss < scMn ) scMn = dp[v.ff] + v.ss ;
                                                        ^~
crocodile.cpp:16:64: error: 'struct std::pair<int, int>' has no member named 'ss'
         else if ( dp[v.ff] + v.ss < scMn ) scMn = dp[v.ff] + v.ss ;
                                                                ^~
crocodile.cpp:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
crocodile.cpp: In function 'int travel_plan(int, int, int (*)[2], int*, int, int*)':
crocodile.cpp:23:45: error: 'class std::vector<std::pair<int, int> >' has no member named 'pb'
   for ( int i = 0 ; i < M; ++i ) G[R[i][0]].pb ( { R[i][1], L[i] } ), G[R[i][1]].pb({R[i][0],L[i]}) ;
                                             ^~
crocodile.cpp:23:82: error: 'class std::vector<std::pair<int, int> >' has no member named 'pb'
   for ( int i = 0 ; i < M; ++i ) G[R[i][0]].pb ( { R[i][1], L[i] } ), G[R[i][1]].pb({R[i][0],L[i]}) ;
                                                                                  ^~