205532026-01-07 17:50:13algoproLeggyorsabb pénzkeresés (50)pypy3Wrong answer 0/50109ms31980 KiB
# UUID: 8ca02f1a-613f-44db-85bc-4e8170d27e4f
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/043ms19576 KiB
2Runtime error0/0104ms31880 KiB
3Wrong answer0/239ms19432 KiB
4Runtime error0/274ms22652 KiB
5Wrong answer0/245ms19432 KiB
6Runtime error0/275ms23404 KiB
7Runtime error0/285ms23580 KiB
8Runtime error0/283ms23480 KiB
9Runtime error0/274ms23512 KiB
10Runtime error0/275ms23520 KiB
11Runtime error0/2101ms31800 KiB
12Runtime error0/2109ms31900 KiB
13Runtime error0/2104ms31852 KiB
14Runtime error0/289ms31944 KiB
15Runtime error0/2108ms31824 KiB
16Runtime error0/289ms31804 KiB
17Runtime error0/2101ms31960 KiB
18Runtime error0/294ms31916 KiB
19Runtime error0/2108ms31976 KiB
20Runtime error0/290ms31832 KiB
21Runtime error0/289ms31980 KiB
22Runtime error0/2103ms31892 KiB
23Runtime error0/2108ms31800 KiB
24Runtime error0/294ms31824 KiB
25Runtime error0/2101ms31828 KiB
26Runtime error0/2108ms31976 KiB
27Runtime error0/2104ms31976 KiB