19962022-12-12 22:14:09tronoraaMágikus intervallumpython3Time limit exceeded 0/100952ms24328 KiB
N = int(input())
sorozat = [int(elem) for elem in input().split(" ")]

lista, szam = [], []
L, R = 1, 1

for i in range(len(sorozat)):
    osszeg = 0
    for j in range(i+1, len(sorozat)):
        osszeg = sum(sorozat[i:j])
        R, L = j, i+1
        m = max(sorozat[i:j])
        if m * 2 >= osszeg and len(sorozat[i:j]) > len(lista):
            lista = [L, R]

print(f"{lista[0]} {lista[1]}")
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms11220 KiB
2Time limit exceeded874ms18328 KiB
subtask20/5
3Runtime error17ms11408 KiB
4Wrong answer17ms11924 KiB
5Wrong answer17ms11912 KiB
6Wrong answer28ms11932 KiB
7Wrong answer763ms12092 KiB
8Wrong answer746ms12316 KiB
subtask30/10
9Wrong answer795ms12716 KiB
10Wrong answer799ms12492 KiB
11Wrong answer811ms12468 KiB
12Wrong answer741ms12716 KiB
13Time limit exceeded945ms5276 KiB
14Time limit exceeded866ms5548 KiB
subtask40/10
15Runtime error17ms13116 KiB
16Wrong answer27ms13060 KiB
17Time limit exceeded865ms5928 KiB
18Time limit exceeded866ms7092 KiB
19Time limit exceeded866ms22356 KiB
20Time limit exceeded952ms23200 KiB
21Time limit exceeded867ms23336 KiB
subtask50/15
22Accepted17ms13424 KiB
23Time limit exceeded901ms21056 KiB
24Time limit exceeded862ms23896 KiB
subtask60/60
25Time limit exceeded875ms20644 KiB
26Time limit exceeded867ms22832 KiB
27Time limit exceeded865ms22656 KiB
28Time limit exceeded856ms20652 KiB
29Time limit exceeded870ms20640 KiB
30Time limit exceeded952ms20504 KiB
31Time limit exceeded952ms23048 KiB
32Time limit exceeded927ms23004 KiB
33Time limit exceeded901ms22532 KiB
34Time limit exceeded875ms22576 KiB
35Time limit exceeded875ms22680 KiB
36Time limit exceeded952ms23276 KiB
37Time limit exceeded870ms19456 KiB
38Time limit exceeded859ms24328 KiB
39Wrong answer746ms14652 KiB