結果
問題 | No.2999 Long Long Friedrice |
ユーザー |
👑 |
提出日時 | 2024-12-25 20:31:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 63 ms / 2,000 ms |
コード長 | 329 bytes |
コンパイル時間 | 311 ms |
コンパイル使用メモリ | 81,892 KB |
実行使用メモリ | 63,232 KB |
最終ジャッジ日時 | 2024-12-25 20:31:38 |
合計ジャッジ時間 | 3,679 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 33 |
ソースコード
n = int(input())A = list(map(int, input().split()))B = list(map(int, input().split()))edges = {}for a, b in zip(A, B):edges.setdefault(a, []).append(a + b)st = [1]se = {1}while st:u = st.pop()for v in edges.get(u, []):if v not in se:st.append(v)se.add(v)print(max(se))