112982024-08-04 22:32:46probaLeghosszabb nyaralás (75 pont)python3Time limit exceeded 25/75298ms13848 KiB
#nyaralás
#sor1 = '8 10'; sor2 = '3 6 4 2 3 7 2 9'
sor1 = input(); sor2 = input()

l1 = list(map(int, sor1.split(' ')))
N, m = l1[0], l1[1]
nap = list(map(int, sor2.split(' ')))

hossz = 1
for i in range(N):
    d = hossz
    while i+d < N and sum(nap[i:i+d+1]) < m:
        d += 1
    if d > hossz:
        hossz = d
        
print(hossz)        
SubtaskSumTestVerdictTimeMemory
base25/75
1Accepted0/018ms2960 KiB
2Time limit exceeded0/0294ms13848 KiB
3Accepted3/317ms2920 KiB
4Accepted3/317ms3064 KiB
5Accepted3/317ms2964 KiB
6Accepted3/317ms2912 KiB
7Wrong answer0/317ms2916 KiB
8Accepted4/417ms3044 KiB
9Accepted4/418ms3044 KiB
10Accepted5/520ms3192 KiB
11Time limit exceeded0/5296ms3716 KiB
12Time limit exceeded0/5214ms3968 KiB
13Time limit exceeded0/7296ms5524 KiB
14Time limit exceeded0/7298ms10420 KiB
15Time limit exceeded0/7298ms13540 KiB
16Time limit exceeded0/8298ms11188 KiB
17Time limit exceeded0/8296ms13800 KiB