結果
| 問題 | No.92 逃走経路 |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2022-01-20 10:19:02 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 71 ms / 5,000 ms |
| + 959µs | |
| コード長 | 473 bytes |
| 記録 | |
| コンパイル時間 | 96 ms |
| コンパイル使用メモリ | 65,088 KB |
| 実行使用メモリ | 60,128 KB |
| 最終ジャッジ日時 | 2026-10-13 12:03:41 |
| 合計ジャッジ時間 | 3,184 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 |
ソースコード
n, m, k = map(int, input().split())
edges = [[] for _ in range(n)]
for _ in range(m):
a, b, c = map(int, input().split())
a -= 1
b -= 1
edges[a].append((b, c))
edges[b].append((a, c))
D = list(map(int, input().split()))
se = set(range(n))
for d in D:
se2 = set()
for pos in se:
for npos, c in edges[pos]:
if c == d:
se2.add(npos)
se = se2
print(len(se))
lst = sorted(se)
print(*(l + 1 for l in lst))