結果
| 問題 |
No.2601 Very Poor
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2024-01-12 21:33:43 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 357 bytes |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 30,036 KB |
| 最終ジャッジ日時 | 2024-09-29 12:06:54 |
| 合計ジャッジ時間 | 24,285 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 WA * 1 |
ソースコード
from collections import deque
N,X=map(int,input().split())
A=list(map(int,input().split()))
A=A+A+A
Q=deque()
ANS=0
ind=0
SUM=0
for i in range(3*N):
while ind<len(A) and SUM+A[ind]<=X and len(Q)<=N-1:
Q.append(A[ind])
SUM+=A[ind]
ind+=1
ANS=max(ANS,SUM)
if Q:
x=Q.popleft()
SUM-=x
print(ANS)
titia