結果
問題 | No.1104 オンライン点呼 |
ユーザー |
![]() |
提出日時 | 2025-03-26 15:43:15 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 729 bytes |
コンパイル時間 | 138 ms |
コンパイル使用メモリ | 82,292 KB |
実行使用メモリ | 102,816 KB |
最終ジャッジ日時 | 2025-03-26 15:43:46 |
合計ジャッジ時間 | 2,963 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 1 |
ソースコード
n, k = map(int, input().split())a = list(map(int, input().split()))b = list(map(int, input().split()))if n == 1:print(0)else:max_time = 0t_prev_prev = 0 # T1t_prev = a[0] + b[1] # T2max_time = max(t_prev_prev, t_prev)for j in range(3, n + 1):idx_j = j - 1 # 0-based index for b# candidate1 is T_{j-1} + A_{j-1} + B_jcandidate1 = t_prev + a[j-2] + b[idx_j]# candidate2 is T_{j-2} + A_{j-2} + B_j + Kcandidate2 = t_prev_prev + a[j-3] + b[idx_j] + kcurrent = min(candidate1, candidate2)max_time = max(max_time, current)# update prev_prev and prevt_prev_prev, t_prev = t_prev, currentprint(max_time)