202482026-01-05 17:46:21algoproLeggyorsabb pénzkeresés (50)pypy3Wrong answer 0/5079ms32000 KiB
# UUID: 307e5cff-016a-4acc-8e52-6bf8452669f5
n, p = map(int, input().split())
napok = list(map(int, input().split()))

l = 0
cur_sum = 0
min_len = n + 1

for i in range(n):
    cur_sum += napok[i]
    while cur_sum >= p:
        min_len = i - l + 1
        cur_sum -= napok[l]
        l += 1

print(min_len if min_len <= n else 0)
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/043ms19348 KiB
2Runtime error0/075ms32000 KiB
3Wrong answer0/239ms19412 KiB
4Wrong answer0/239ms19408 KiB
5Wrong answer0/245ms19468 KiB
6Wrong answer0/259ms21596 KiB
7Wrong answer0/257ms22452 KiB
8Wrong answer0/252ms22200 KiB
9Wrong answer0/261ms22248 KiB
10Wrong answer0/259ms22240 KiB
11Runtime error0/265ms32000 KiB
12Runtime error0/267ms32000 KiB
13Runtime error0/278ms32000 KiB
14Runtime error0/279ms32000 KiB
15Runtime error0/268ms32000 KiB
16Runtime error0/275ms32000 KiB
17Runtime error0/278ms32000 KiB
18Runtime error0/278ms32000 KiB
19Runtime error0/275ms32000 KiB
20Runtime error0/267ms32000 KiB
21Runtime error0/275ms32000 KiB
22Runtime error0/267ms32000 KiB
23Runtime error0/278ms32000 KiB
24Runtime error0/265ms32000 KiB
25Runtime error0/278ms32000 KiB
26Runtime error0/275ms32000 KiB
27Runtime error0/264ms32000 KiB