답안 #240217

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
240217 2020-06-18T21:48:56 Z oscarsierra12 악어의 지하 도시 (IOI11_crocodile) C++14
컴파일 오류
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]}) ;
                                                                                  ^~