// 入力制約チェック // #define _GLIBCXX_DEBUG #include using namespace std; #define CIN( LL , A ) LL A; cin >> A #define UNTIE ios_base::sync_with_stdio( false ); cin.tie( nullptr ) #define FOR( VAR , INITIAL , FINAL_PLUS_ONE ) for( remove_const::type >::type VAR = INITIAL ; VAR < FINAL_PLUS_ONE ; VAR ++ ) #define QUIT return 0 #define RETURN( ANSWER ) cout << ( ANSWER ) << "\n"; QUIT int main() { UNTIE; constexpr const int bound = 100001; CIN( int , N_V ); assert( 0 <= N_V && N_V < bound ); CIN( int , N_E ); assert( 0 <= N_E && N_E < bound && ( N_V < 317 ? N_E <= N_V * ( N_V - 1 ) / 2 : true ) ); set > E{}; FOR( j , 0 , N_E ){ CIN( int , i0 ); CIN( int , i1 ); CIN( int , w ); assert( 0 <= i0 && i0 < i1 && i1 < N_V ); assert( 0 < w && w < bound ); E.insert( { i0 , i1 } ); } assert( int( E.size() ) == N_E ); CIN( int , T ); assert( 1 <= T && T < bound ); FOR( t , 0 , T ){ CIN( int , Rt ); assert( 0 <= Rt && Rt < bound ); } cout << "入力制約OK!"; QUIT; }