結果
| 問題 | No.92 逃走経路 |
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2021-02-07 19:36:21 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 74 ms / 5,000 ms |
| + 377µs | |
| コード長 | 385 bytes |
| 記録 | |
| コンパイル時間 | 84 ms |
| コンパイル使用メモリ | 64,612 KB |
| 実行使用メモリ | 59,436 KB |
| 最終ジャッジ日時 | 2026-11-06 14:17:28 |
| 合計ジャッジ時間 | 2,936 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
from collections import defaultdict
N,M,K=map(int,input().split())
E=defaultdict(list)
for _ in range(M):
a,b,c=map(int,input().split())
E[c].append((a,b))
D=map(int,input().split())
S=set(range(1,N+1))
for d in D:
T=set()
for u,v in E[d]:
if u in S:
T.add(v)
if v in S:
T.add(u)
S=T.copy()
print(len(S))
print(*sorted(S))
Kazun