205462026-01-07 17:48:04algoproLeggyorsabb pénzkeresés (50)pypy3Wrong answer 0/50112ms31996 KiB
# UUID: 2cf1a6ce-6b46-403b-bc7c-df64fafbb9fc
c, b = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
mini = c
most = 1
ossz = 0
k = 0
x = 0
for j in range(c):
    k += 1
    if ossz < b:
        ossz += a[k]
        most += 1
    else:
        if most < mini:
            mini = most
        while ossz >= b:
            ossz -= a[x]
            x += 1
            most -= 1
        ossz += a[k]
        k -= 1
print(mini)
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/043ms19540 KiB
2Runtime error0/090ms31968 KiB
3Wrong answer0/243ms19540 KiB
4Runtime error0/265ms22740 KiB
5Wrong answer0/245ms19432 KiB
6Runtime error0/275ms23524 KiB
7Runtime error0/275ms23528 KiB
8Runtime error0/275ms23436 KiB
9Runtime error0/282ms23272 KiB
10Runtime error0/275ms23564 KiB
11Runtime error0/289ms31808 KiB
12Runtime error0/296ms31800 KiB
13Runtime error0/2101ms31852 KiB
14Runtime error0/290ms31976 KiB
15Runtime error0/294ms31976 KiB
16Runtime error0/2100ms31976 KiB
17Runtime error0/290ms31976 KiB
18Runtime error0/2112ms31976 KiB
19Runtime error0/293ms31984 KiB
20Runtime error0/289ms31792 KiB
21Runtime error0/2103ms31980 KiB
22Runtime error0/290ms31960 KiB
23Runtime error0/292ms31980 KiB
24Runtime error0/2111ms31992 KiB
25Runtime error0/290ms31976 KiB
26Runtime error0/2108ms31996 KiB
27Runtime error0/294ms31984 KiB