結果

問題 No.2601 Very Poor
ユーザー tassei903tassei903
提出日時 2024-01-17 18:50:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 113,260 KB
最終ジャッジ日時 2024-09-30 06:39:54
合計ジャッジ時間 3,982 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,832 KB
testcase_01 AC 31 ms
53,232 KB
testcase_02 AC 36 ms
52,736 KB
testcase_03 AC 32 ms
53,444 KB
testcase_04 AC 33 ms
53,560 KB
testcase_05 AC 41 ms
61,868 KB
testcase_06 AC 43 ms
62,964 KB
testcase_07 AC 43 ms
63,432 KB
testcase_08 AC 43 ms
63,100 KB
testcase_09 AC 40 ms
61,728 KB
testcase_10 AC 41 ms
62,036 KB
testcase_11 AC 44 ms
64,280 KB
testcase_12 AC 44 ms
63,400 KB
testcase_13 AC 43 ms
63,760 KB
testcase_14 AC 43 ms
62,648 KB
testcase_15 AC 98 ms
112,852 KB
testcase_16 AC 96 ms
112,940 KB
testcase_17 AC 97 ms
112,788 KB
testcase_18 AC 101 ms
113,080 KB
testcase_19 AC 98 ms
113,128 KB
testcase_20 AC 96 ms
112,848 KB
testcase_21 AC 96 ms
112,892 KB
testcase_22 AC 96 ms
112,836 KB
testcase_23 AC 98 ms
112,720 KB
testcase_24 AC 97 ms
112,700 KB
testcase_25 AC 101 ms
112,936 KB
testcase_26 AC 97 ms
113,260 KB
testcase_27 AC 99 ms
112,844 KB
testcase_28 AC 101 ms
112,948 KB
testcase_29 AC 98 ms
112,900 KB
testcase_30 AC 99 ms
112,832 KB
testcase_31 AC 96 ms
113,040 KB
testcase_32 AC 99 ms
112,884 KB
testcase_33 AC 97 ms
112,660 KB
testcase_34 AC 99 ms
112,672 KB
testcase_35 AC 41 ms
61,400 KB
testcase_36 AC 43 ms
63,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
n,x = na()

a = na()
a = [0] + a + a
for i in range(2*n):
    a[i+1] += a[i]

ans = 0
j = 0
for i in range(n*2):
    while j < 2 * n and a[j+1] - a[i] <= x:
        j += 1
    ans = max(ans,a[j]-a[i])
print(min(ans, a[n]))

0