結果
| 問題 | No.45 回転寿司 |
| ユーザー |
CsTarepanda
|
| 提出日時 | 2017-05-04 19:06:56 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 231 bytes |
| 記録 | |
| コンパイル時間 | 537 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 21,756 KB |
| 最終ジャッジ日時 | 2026-04-04 11:07:37 |
| 合計ジャッジ時間 | 12,952 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | TLE * 1 -- * 29 |
ソースコード
n = int(input())
a = list(map(int, input().split()))
def solve(d, i, w):
if -1 < i - 2 < n:
w += a[i - 2]
if i >= n:
return w
return max(solve(i, i + 2, w), solve(i, i + 3, w))
print(solve(0, 0, 0))
CsTarepanda