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

L, R = 1, 1
l_sol, r_sol = 0, 0

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(sorozat[l_sol:r_sol]):
            r_sol, l_sol = R, L

print(f"{l_sol} {r_sol}")
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11080 KiB
2Time limit exceeded865ms18200 KiB
subtask20/5
3Wrong answer17ms11252 KiB
4Accepted17ms11664 KiB
5Wrong answer17ms12136 KiB
6Accepted28ms12024 KiB
7Accepted839ms12088 KiB
8Wrong answer750ms12248 KiB
subtask30/10
9Wrong answer795ms12316 KiB
10Wrong answer800ms12880 KiB
11Wrong answer805ms12468 KiB
12Accepted833ms12632 KiB
13Time limit exceeded869ms5204 KiB
14Time limit exceeded887ms5456 KiB
subtask40/10
15Wrong answer17ms12640 KiB
16Accepted27ms12760 KiB
17Time limit exceeded861ms5888 KiB
18Time limit exceeded879ms7172 KiB
19Time limit exceeded870ms22628 KiB
20Time limit exceeded875ms23856 KiB
21Time limit exceeded867ms23856 KiB
subtask50/15
22Accepted17ms13964 KiB
23Time limit exceeded865ms21448 KiB
24Time limit exceeded864ms24116 KiB
subtask60/60
25Time limit exceeded948ms20888 KiB
26Time limit exceeded867ms22892 KiB
27Time limit exceeded867ms23052 KiB
28Time limit exceeded875ms21068 KiB
29Time limit exceeded871ms21072 KiB
30Time limit exceeded871ms21048 KiB
31Time limit exceeded931ms23180 KiB
32Time limit exceeded867ms23136 KiB
33Time limit exceeded860ms22668 KiB
34Time limit exceeded884ms22864 KiB
35Time limit exceeded871ms23032 KiB
36Time limit exceeded952ms23184 KiB
37Time limit exceeded864ms19408 KiB
38Time limit exceeded867ms23956 KiB
39Wrong answer754ms14244 KiB