114372024-09-24 10:20:54probaLeghosszabb nyaralás (75 pont)python3Runtime error 0/7548ms13676 KiB
N,P=[int(i) for i in input().split()]
A=[int(i) for i in input().split()]
a=0; b=0; ossz=0; mx=0
while b<N:
    if ossz>P:
        ossz-=A[a]
        a+=1
    else:
        ossz+=A[b]
        b+=1
    if db>b-a+1 and ossz<=P:
        mx=db
print(mx)
SubtaskSumTestVerdictTimeMemory
base0/75
1Runtime error0/017ms3080 KiB
2Runtime error0/048ms13676 KiB
3Runtime error0/317ms3088 KiB
4Runtime error0/317ms2972 KiB
5Runtime error0/317ms2988 KiB
6Runtime error0/317ms3228 KiB
7Runtime error0/317ms3192 KiB
8Runtime error0/416ms3192 KiB
9Runtime error0/417ms3012 KiB
10Runtime error0/517ms3220 KiB
11Runtime error0/519ms3820 KiB
12Runtime error0/518ms4084 KiB
13Runtime error0/737ms5452 KiB
14Runtime error0/745ms10420 KiB
15Runtime error0/748ms13436 KiB
16Runtime error0/845ms10972 KiB
17Runtime error0/846ms13672 KiB