19932022-12-12 22:08:22tronoraaMágikus intervallumpython3Time limit exceeded 0/100953ms23856 KiB
N = input()
string = input().split(" ")

sorozat = [int(elem) for elem in string]

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 = []
            lista.append(L)
            lista.append(R)



print(f"{lista[0]} {lista[1]}")
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11352 KiB
2Time limit exceeded901ms18404 KiB
subtask20/5
3Runtime error17ms11928 KiB
4Wrong answer17ms12276 KiB
5Wrong answer17ms12228 KiB
6Wrong answer28ms12284 KiB
7Wrong answer753ms12644 KiB
8Wrong answer744ms12760 KiB
subtask30/10
9Wrong answer790ms12616 KiB
10Wrong answer796ms12904 KiB
11Wrong answer806ms12912 KiB
12Wrong answer749ms12976 KiB
13Time limit exceeded949ms6052 KiB
14Time limit exceeded935ms6016 KiB
subtask40/10
15Runtime error17ms13324 KiB
16Wrong answer27ms13416 KiB
17Time limit exceeded865ms6032 KiB
18Time limit exceeded879ms6976 KiB
19Time limit exceeded953ms22684 KiB
20Time limit exceeded867ms23220 KiB
21Time limit exceeded952ms23236 KiB
subtask50/15
22Accepted17ms13596 KiB
23Time limit exceeded901ms21116 KiB
24Time limit exceeded860ms23596 KiB
subtask60/60
25Time limit exceeded869ms20496 KiB
26Time limit exceeded879ms22672 KiB
27Time limit exceeded867ms22684 KiB
28Time limit exceeded876ms20792 KiB
29Time limit exceeded864ms20744 KiB
30Time limit exceeded867ms20804 KiB
31Time limit exceeded864ms22912 KiB
32Time limit exceeded871ms22720 KiB
33Time limit exceeded879ms22512 KiB
34Time limit exceeded867ms22512 KiB
35Time limit exceeded864ms22432 KiB
36Time limit exceeded871ms23352 KiB
37Time limit exceeded901ms19024 KiB
38Time limit exceeded869ms23856 KiB
39Wrong answer750ms14244 KiB