43842023-03-27 11:47:35DohajovDanielLeghosszabb nyaralás (75 pont)python3Wrong answer 3/7568ms33576 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)):
        
        if jpenz>0: mido+=1
        if jpenz==0 :
            mxido=max(mxido,mido)
            jpenz=penz
            mido=0
        if jpenz<0 :
            mxido=max(mxido,mido)
            jpenz=penz
            mido=0
        jpenz-=napL[i]
    print(mxido)
main()
SubtaskSumTestVerdictTimeMemory
base3/75
1Accepted0/017ms10868 KiB
2Wrong answer0/068ms32112 KiB
3Accepted3/317ms11616 KiB
4Wrong answer0/317ms11764 KiB
5Wrong answer0/317ms11812 KiB
6Wrong answer0/317ms12008 KiB
7Wrong answer0/317ms12164 KiB
8Wrong answer0/417ms12392 KiB
9Wrong answer0/417ms12392 KiB
10Wrong answer0/517ms12380 KiB
11Wrong answer0/521ms13308 KiB
12Wrong answer0/521ms14380 KiB
13Wrong answer0/759ms17236 KiB
14Wrong answer0/765ms26444 KiB
15Wrong answer0/768ms33024 KiB
16Wrong answer0/868ms28444 KiB
17Wrong answer0/868ms33576 KiB