結果
| 問題 | No.92 逃走経路 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-16 20:50:11 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 5,000 ms |
| + 962µs | |
| コード長 | 433 bytes |
| 記録 | |
| コンパイル時間 | 61 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 7,168 KB |
| 最終ジャッジ日時 | 2026-07-17 16:39:52 |
| 合計ジャッジ時間 | 2,125 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#!/usr/bin/python
from collections import defaultdict
n, m, k = map(int, raw_input().split())
G = defaultdict(list)
for _ in xrange(m):
a, b, c = map(int, raw_input().split())
G[c].append((a-1, b-1))
G[c].append((b-1, a-1))
d = map(int, raw_input().split())
arr = set(xrange(n))
for x in d:
arr = {to for fra, to in G[x] if fra in arr}
res = list(map(lambda e: e+1, arr))
print len(res)
print ' '.join(map(str, res))