結果

問題 No.45 回転寿司
ユーザー nktankta
提出日時 2022-06-15 15:06:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 531 ms / 5,000 ms
コード長 239 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,448 KB
最終ジャッジ日時 2024-04-14 23:47:41
合計ジャッジ時間 20,060 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 531 ms
43,936 KB
testcase_01 AC 517 ms
44,200 KB
testcase_02 AC 520 ms
43,936 KB
testcase_03 AC 516 ms
44,196 KB
testcase_04 AC 523 ms
44,188 KB
testcase_05 AC 517 ms
43,944 KB
testcase_06 AC 519 ms
43,932 KB
testcase_07 AC 518 ms
44,044 KB
testcase_08 AC 521 ms
44,324 KB
testcase_09 AC 523 ms
43,932 KB
testcase_10 AC 520 ms
44,180 KB
testcase_11 AC 521 ms
44,196 KB
testcase_12 AC 521 ms
43,940 KB
testcase_13 AC 520 ms
44,196 KB
testcase_14 AC 518 ms
44,192 KB
testcase_15 AC 524 ms
43,932 KB
testcase_16 AC 519 ms
43,928 KB
testcase_17 AC 517 ms
44,196 KB
testcase_18 AC 521 ms
44,044 KB
testcase_19 AC 523 ms
43,932 KB
testcase_20 AC 521 ms
44,300 KB
testcase_21 AC 520 ms
43,936 KB
testcase_22 AC 522 ms
43,932 KB
testcase_23 AC 521 ms
44,316 KB
testcase_24 AC 515 ms
43,932 KB
testcase_25 AC 518 ms
44,040 KB
testcase_26 AC 522 ms
43,940 KB
testcase_27 AC 523 ms
44,448 KB
testcase_28 AC 521 ms
44,320 KB
testcase_29 AC 519 ms
43,976 KB
testcase_30 AC 520 ms
44,288 KB
testcase_31 AC 525 ms
44,192 KB
testcase_32 AC 521 ms
44,324 KB
testcase_33 AC 521 ms
44,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import numpy as np

N = int(input())
V = np.array([0,0,0]+[int(i) for i in input().split(" ")]+[0,0,0])
V_MAX = np.zeros_like(V)

for i in range(V.shape[0]-4,-1,-1):
    V_MAX[i] = V[i]+max(V_MAX[i+2],V_MAX[i+3])
print(V_MAX[0])
0