結果
問題 |
No.45 回転寿司
|
ユーザー |
|
提出日時 | 2018-03-04 16:25:31 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 595 bytes |
コンパイル時間 | 89 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-08 00:22:50 |
合計ジャッジ時間 | 2,201 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 2 WA * 28 |
ソースコード
def main(): N = int(input()) V = tuple(map(int, input().split())) if N < 3: print(max(V)) return vlen = len(V) ans = [] for i in (0, 1): v = V[i] while 1: if i + 2 < vlen: v1 = V[i+2] else: break if i + 3 < vlen: v2 = V[i+3] else: v2 = 0 if v1 > v2: v += v1 i += 2 else: v += v2 i += 3 ans.append(v) print(max(ans)) main()