19912022-12-12 21:56:51tronoraaMágikus intervallumpython3Time limit exceeded 0/100953ms24264 KiB
N = input()
string = input().split(" ")

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

lista = []
szam = []
L, R = 1, 1
sol = False
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]
            sol = True
    if sol:
        break


for i in range(len(lista)):
    if i == len(lista)-1:
        print(lista[i])
    else:
        print(lista[i], end=' ')
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11424 KiB
2Time limit exceeded883ms18456 KiB
subtask20/5
3Wrong answer17ms11756 KiB
4Wrong answer16ms11684 KiB
5Accepted17ms12032 KiB
6Accepted17ms12248 KiB
7Wrong answer20ms12596 KiB
8Wrong answer20ms12896 KiB
subtask30/10
9Wrong answer21ms12924 KiB
10Wrong answer21ms13036 KiB
11Wrong answer20ms13116 KiB
12Wrong answer21ms13436 KiB
13Wrong answer32ms13516 KiB
14Wrong answer32ms13668 KiB
subtask40/10
15Wrong answer17ms13556 KiB
16Wrong answer17ms13736 KiB
17Wrong answer35ms13812 KiB
18Time limit exceeded945ms7548 KiB
19Time limit exceeded884ms23060 KiB
20Time limit exceeded873ms23680 KiB
21Time limit exceeded884ms23944 KiB
subtask50/15
22Accepted17ms14052 KiB
23Time limit exceeded901ms21768 KiB
24Time limit exceeded880ms24264 KiB
subtask60/60
25Time limit exceeded953ms21104 KiB
26Time limit exceeded867ms23240 KiB
27Time limit exceeded933ms23264 KiB
28Time limit exceeded875ms21240 KiB
29Time limit exceeded871ms21312 KiB
30Time limit exceeded944ms21252 KiB
31Time limit exceeded876ms23392 KiB
32Time limit exceeded864ms23276 KiB
33Time limit exceeded867ms22824 KiB
34Time limit exceeded867ms23068 KiB
35Time limit exceeded869ms22956 KiB
36Time limit exceeded856ms23404 KiB
37Time limit exceeded933ms19468 KiB
38Time limit exceeded869ms24132 KiB
39Wrong answer20ms14492 KiB