結果
| 問題 | No.1148 土偶Ⅲ |
| ユーザー |
|
| 提出日時 | 2022-01-20 13:58:02 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 191 ms / 2,000 ms |
| + 39µs | |
| コード長 | 318 bytes |
| 記録 | |
| コンパイル時間 | 53 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 16,244 KB |
| 最終ジャッジ日時 | 2026-09-28 17:44:23 |
| 合計ジャッジ時間 | 4,869 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
from collections import defaultdict,deque
n,w=map(int,input().split())
d=defaultdict(int)
ans=0
now=0
q=deque()
for _ in range(n):
a=int(input())
now+=a
q.append(a)
d[a]+=1
while (d[a]>1 or now>w) and q:
out=q.popleft()
now-=out
d[out]-=1
ans=max(ans,len(q))
print(ans)