19872022-12-12 21:38:57tronoraaMágikus intervallumpython3Runtime error 0/100953ms24196 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(''.join(lista))
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error17ms11320 KiB
2Time limit exceeded901ms18572 KiB
subtask20/5
3Wrong answer17ms11572 KiB
4Runtime error17ms11956 KiB
5Runtime error17ms12256 KiB
6Runtime error29ms12364 KiB
7Runtime error800ms12716 KiB
8Time limit exceeded853ms12804 KiB
subtask30/10
9Time limit exceeded875ms5396 KiB
10Time limit exceeded866ms5596 KiB
11Time limit exceeded875ms5960 KiB
12Runtime error814ms13244 KiB
13Time limit exceeded862ms5920 KiB
14Time limit exceeded887ms6036 KiB
subtask40/10
15Wrong answer17ms13724 KiB
16Runtime error28ms13444 KiB
17Time limit exceeded899ms6136 KiB
18Time limit exceeded856ms7228 KiB
19Time limit exceeded876ms22788 KiB
20Time limit exceeded861ms23344 KiB
21Time limit exceeded876ms23476 KiB
subtask50/15
22Runtime error17ms13680 KiB
23Time limit exceeded861ms21468 KiB
24Time limit exceeded865ms23768 KiB
subtask60/60
25Time limit exceeded879ms20864 KiB
26Time limit exceeded876ms23028 KiB
27Time limit exceeded873ms23052 KiB
28Time limit exceeded949ms21012 KiB
29Time limit exceeded861ms20964 KiB
30Time limit exceeded871ms20964 KiB
31Time limit exceeded953ms23156 KiB
32Time limit exceeded865ms23060 KiB
33Time limit exceeded875ms22484 KiB
34Time limit exceeded867ms22576 KiB
35Time limit exceeded873ms22624 KiB
36Time limit exceeded888ms23272 KiB
37Time limit exceeded888ms19608 KiB
38Time limit exceeded944ms24196 KiB
39Time limit exceeded859ms6840 KiB