結果
問題 | No.92 逃走経路 |
ユーザー |
![]() |
提出日時 | 2017-08-21 13:03:57 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 759 bytes |
コンパイル時間 | 1,428 ms |
コンパイル使用メモリ | 166,720 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 00:48:29 |
合計ジャッジ時間 | 2,361 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main(){ | ^~~~
ソースコード
#include<bits/stdc++.h> typedef long long ll; using namespace std; int INF = 1e9; int MOD = 1e9+7; int p[1010][110]; main(){ int N,M,K,A[1000],B[1000],C[1000],D[1000]; cin >> N >> M >> K; for(int i = 0;i < M;i++)cin >> A[i] >> B[i] >> C[i]; for(int i = 0;i < K;i++)cin >> D[i]; for(int i = 0;i < M;i++){ if(D[0] == C[i]){ p[0][A[i]] = 1; p[0][B[i]] = 1; } } for(int i = 1;i < K;i++){ for(int j = 0;j < M;j++){ if(D[i] == C[j]){ if(p[i-1][A[j]])p[i][B[j]] = 1; if(p[i-1][B[j]])p[i][A[j]] = 1; } } } cout << accumulate(p[K-1],p[K-1]+101,0) << endl; for(int i = 1;i <= 100;i++)if(p[K-1][i])cout << i << endl; }