19892022-12-12 21:45:46tronoraaMágikus intervallumpython3Time limit exceeded 0/100949ms23556 KiB
N = input()
string = input().split(" ")

sorozat = []
for elem in string:
    sorozat.append(int(elem))

lista = []
szam = []
L = 1

for i in range(len(sorozat)):
    osszeg = 0
    R = i
    for j in range(i+1, len(sorozat)):
        szam.append(sorozat[i:j])
        osszeg = sum(sorozat[i:j])
        R = j
        L = 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)

        szam = []

for i in range(len(lista)):
    if i == len(lista)-1:
        print(lista[i])
    else:
        print(lista[i], end=' ')
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms11196 KiB
2Time limit exceeded875ms18648 KiB
subtask20/5
3Wrong answer17ms11708 KiB
4Wrong answer17ms12276 KiB
5Wrong answer17ms12104 KiB
6Wrong answer30ms12064 KiB
7Wrong answer836ms12592 KiB
8Wrong answer842ms12516 KiB
subtask30/10
9Time limit exceeded899ms12452 KiB
10Time limit exceeded898ms12560 KiB
11Time limit exceeded879ms5252 KiB
12Wrong answer847ms12608 KiB
13Time limit exceeded945ms5360 KiB
14Time limit exceeded875ms5456 KiB
subtask40/10
15Wrong answer17ms12880 KiB
16Wrong answer29ms13056 KiB
17Time limit exceeded865ms5556 KiB
18Time limit exceeded866ms6504 KiB
19Time limit exceeded908ms22136 KiB
20Time limit exceeded884ms22736 KiB
21Time limit exceeded876ms22672 KiB
subtask50/15
22Accepted17ms12872 KiB
23Time limit exceeded901ms20860 KiB
24Time limit exceeded871ms23108 KiB
subtask60/60
25Time limit exceeded949ms20384 KiB
26Time limit exceeded865ms22508 KiB
27Time limit exceeded860ms22620 KiB
28Time limit exceeded861ms20564 KiB
29Time limit exceeded879ms20628 KiB
30Time limit exceeded884ms20588 KiB
31Time limit exceeded869ms22732 KiB
32Time limit exceeded864ms23132 KiB
33Time limit exceeded864ms22428 KiB
34Time limit exceeded867ms22076 KiB
35Time limit exceeded884ms22348 KiB
36Time limit exceeded856ms22660 KiB
37Time limit exceeded875ms19336 KiB
38Time limit exceeded879ms23556 KiB
39Wrong answer850ms13864 KiB