19862022-12-12 21:37:43tronoraaMágikus intervallumpython3Runtime error 0/100948ms23924 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 = []

print(lista[0] + " " + lista[1])
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error17ms11108 KiB
2Time limit exceeded901ms18596 KiB
subtask20/5
3Runtime error17ms11824 KiB
4Runtime error17ms12040 KiB
5Runtime error17ms11992 KiB
6Runtime error29ms12432 KiB
7Runtime error796ms12700 KiB
8Runtime error839ms12892 KiB
subtask30/10
9Time limit exceeded888ms13092 KiB
10Time limit exceeded864ms5524 KiB
11Time limit exceeded862ms5648 KiB
12Runtime error799ms13232 KiB
13Time limit exceeded883ms6000 KiB
14Time limit exceeded855ms6092 KiB
subtask40/10
15Runtime error17ms13696 KiB
16Runtime error28ms13636 KiB
17Time limit exceeded899ms6260 KiB
18Time limit exceeded875ms7260 KiB
19Time limit exceeded869ms22628 KiB
20Time limit exceeded869ms23584 KiB
21Time limit exceeded873ms23684 KiB
subtask50/15
22Runtime error17ms13720 KiB
23Time limit exceeded901ms21240 KiB
24Time limit exceeded876ms23844 KiB
subtask60/60
25Time limit exceeded860ms20972 KiB
26Time limit exceeded940ms23188 KiB
27Time limit exceeded879ms23356 KiB
28Time limit exceeded873ms21236 KiB
29Time limit exceeded879ms21260 KiB
30Time limit exceeded867ms21252 KiB
31Time limit exceeded873ms23296 KiB
32Time limit exceeded856ms23256 KiB
33Time limit exceeded888ms22684 KiB
34Time limit exceeded948ms22724 KiB
35Time limit exceeded864ms22632 KiB
36Time limit exceeded873ms23224 KiB
37Time limit exceeded861ms19264 KiB
38Time limit exceeded879ms23924 KiB
39Runtime error846ms14396 KiB