結果
| 問題 | No.45 回転寿司 |
| ユーザー |
|
| 提出日時 | 2018-03-04 16:25:31 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 595 bytes |
| 記録 | |
| コンパイル時間 | 286 ms |
| コンパイル使用メモリ | 21,408 KB |
| 実行使用メモリ | 15,996 KB |
| 最終ジャッジ日時 | 2026-08-11 23:33:05 |
| 合計ジャッジ時間 | 5,418 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()