19882022-12-12 21:40:52tronoraaMágikus intervallumpython3Runtime error 0/100953ms24112 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) > len(lista):
            lista = []
            lista.append(L)
            lista.append(R)

        szam = []

ki = ' '.join(lista)
print(ki)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error17ms11232 KiB
2Time limit exceeded901ms18568 KiB
subtask20/5
3Wrong answer17ms11688 KiB
4Runtime error17ms11932 KiB
5Runtime error17ms12140 KiB
6Runtime error29ms12268 KiB
7Runtime error794ms12656 KiB
8Runtime error842ms12756 KiB
subtask30/10
9Time limit exceeded859ms5412 KiB
10Time limit exceeded892ms13284 KiB
11Time limit exceeded862ms5500 KiB
12Runtime error794ms13196 KiB
13Time limit exceeded926ms5604 KiB
14Time limit exceeded950ms5956 KiB
subtask40/10
15Wrong answer17ms13492 KiB
16Runtime error28ms13424 KiB
17Time limit exceeded875ms6052 KiB
18Time limit exceeded859ms7328 KiB
19Time limit exceeded860ms22548 KiB
20Time limit exceeded944ms23120 KiB
21Time limit exceeded884ms23184 KiB
subtask50/15
22Runtime error17ms13624 KiB
23Time limit exceeded901ms21260 KiB
24Time limit exceeded953ms24012 KiB
subtask60/60
25Time limit exceeded865ms21072 KiB
26Time limit exceeded880ms23184 KiB
27Time limit exceeded864ms23176 KiB
28Time limit exceeded861ms21124 KiB
29Time limit exceeded871ms21100 KiB
30Time limit exceeded861ms21220 KiB
31Time limit exceeded869ms23148 KiB
32Time limit exceeded856ms23276 KiB
33Time limit exceeded876ms22724 KiB
34Time limit exceeded879ms22572 KiB
35Time limit exceeded948ms22764 KiB
36Time limit exceeded876ms23440 KiB
37Time limit exceeded867ms19516 KiB
38Time limit exceeded888ms24112 KiB
39Runtime error847ms14452 KiB