43832023-03-27 11:45:24DohajovDanielLeghosszabb nyaralás (75 pont)python3Wrong answer 3/7583ms33856 KiB
def main():
    napdb,penz=[int(i) for i in input().split()]
    napL=[int(i) for i in input().split()]
    jpenz=penz
    mxido=0;mido=0
    for i in range(len(napL)):
        jpenz-=napL[i]
        if jpenz>0: mido+=1
        if jpenz==0 :
            mxido=max(mxido,mido)
            jpenz=penz
            mido=0
        if jpenz<0 or i==len(napL)-1 :
            mxido=max(mxido,mido)
            jpenz=penz
            mido=0
    print(mxido+1)
main()
SubtaskSumTestVerdictTimeMemory
base3/75
1Accepted0/017ms11136 KiB
2Wrong answer0/079ms32300 KiB
3Wrong answer0/317ms11520 KiB
4Wrong answer0/317ms11852 KiB
5Accepted3/317ms12052 KiB
6Wrong answer0/317ms12228 KiB
7Wrong answer0/317ms12260 KiB
8Wrong answer0/417ms12112 KiB
9Wrong answer0/417ms12344 KiB
10Wrong answer0/517ms12448 KiB
11Wrong answer0/524ms13748 KiB
12Wrong answer0/524ms14316 KiB
13Wrong answer0/771ms16864 KiB
14Wrong answer0/776ms26560 KiB
15Wrong answer0/782ms33004 KiB
16Wrong answer0/879ms28396 KiB
17Wrong answer0/883ms33856 KiB