19952022-12-12 22:13:01tronoraaMágikus intervallumpython3Time limit exceeded 0/100952ms23948 KiB
N = int(input())
sorozat = [int(elem) for elem in input().split(" ")]

lista, szam = [], []
L, R = 1, 1

for i in range(N):
    osszeg = 0
    for j in range(i+1, N):
        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
1Accepted17ms11076 KiB
2Time limit exceeded882ms18440 KiB
subtask20/5
3Runtime error17ms11564 KiB
4Wrong answer17ms12276 KiB
5Wrong answer17ms12248 KiB
6Wrong answer28ms12796 KiB
7Wrong answer754ms12432 KiB
8Wrong answer750ms12816 KiB
subtask30/10
9Wrong answer794ms12720 KiB
10Wrong answer796ms12840 KiB
11Wrong answer800ms12752 KiB
12Wrong answer759ms13016 KiB
13Time limit exceeded929ms5508 KiB
14Time limit exceeded870ms5776 KiB
subtask40/10
15Runtime error17ms13244 KiB
16Wrong answer27ms13572 KiB
17Time limit exceeded880ms6140 KiB
18Time limit exceeded879ms7136 KiB
19Time limit exceeded871ms22724 KiB
20Time limit exceeded867ms23460 KiB
21Time limit exceeded888ms23632 KiB
subtask50/15
22Accepted17ms13880 KiB
23Time limit exceeded901ms21368 KiB
24Time limit exceeded888ms23652 KiB
subtask60/60
25Time limit exceeded867ms20452 KiB
26Time limit exceeded875ms22988 KiB
27Time limit exceeded952ms22684 KiB
28Time limit exceeded948ms20564 KiB
29Time limit exceeded879ms20796 KiB
30Time limit exceeded866ms20864 KiB
31Time limit exceeded935ms23216 KiB
32Time limit exceeded867ms23188 KiB
33Time limit exceeded871ms22780 KiB
34Time limit exceeded875ms22772 KiB
35Time limit exceeded948ms22840 KiB
36Time limit exceeded856ms23460 KiB
37Time limit exceeded871ms19456 KiB
38Time limit exceeded871ms23948 KiB
39Wrong answer753ms14436 KiB