結果

問題 No.45 回転寿司
ユーザー Woo-CieWoo-Cie
提出日時 2019-03-23 02:47:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 331 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,512 KB
実行使用メモリ 29,672 KB
最終ジャッジ日時 2023-08-27 16:55:11
合計ジャッジ時間 6,633 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
29,452 KB
testcase_01 AC 125 ms
29,568 KB
testcase_02 AC 126 ms
29,484 KB
testcase_03 AC 126 ms
29,596 KB
testcase_04 AC 126 ms
29,488 KB
testcase_05 AC 123 ms
29,444 KB
testcase_06 AC 124 ms
29,528 KB
testcase_07 AC 125 ms
29,512 KB
testcase_08 AC 123 ms
29,596 KB
testcase_09 AC 125 ms
29,628 KB
testcase_10 AC 123 ms
29,580 KB
testcase_11 AC 123 ms
29,596 KB
testcase_12 AC 125 ms
29,484 KB
testcase_13 AC 126 ms
29,608 KB
testcase_14 AC 123 ms
29,600 KB
testcase_15 AC 125 ms
29,624 KB
testcase_16 AC 123 ms
29,448 KB
testcase_17 AC 125 ms
29,576 KB
testcase_18 AC 124 ms
29,560 KB
testcase_19 AC 125 ms
29,528 KB
testcase_20 AC 123 ms
29,520 KB
testcase_21 AC 126 ms
29,492 KB
testcase_22 AC 125 ms
29,528 KB
testcase_23 AC 124 ms
29,448 KB
testcase_24 AC 124 ms
29,416 KB
testcase_25 AC 124 ms
29,540 KB
testcase_26 AC 128 ms
29,452 KB
testcase_27 AC 126 ms
29,448 KB
testcase_28 AC 125 ms
29,536 KB
testcase_29 AC 126 ms
29,672 KB
testcase_30 AC 127 ms
29,572 KB
testcase_31 AC 126 ms
29,536 KB
testcase_32 AC 125 ms
29,572 KB
testcase_33 AC 126 ms
29,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# -*- coding: utf-8-*-
import numpy as np
if __name__ == '__main__':
    n = int(input())
    v = np.array(list(map(int, input().split(" "))))
    a = np.zeros((n+1))
    b = np.zeros((n+1))
    for i in range(n):
        a[i+1] = b[i] + v[i]
        b[i+1] = max(a[i], b[i])
    print(int(max(a[n], b[n])))
0