19852022-12-12 21:36:41tronoraaMágikus intervallumpython3Wrong answer 0/100952ms23952 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 = []

for elem in lista:
    print(elem, end=" ")
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer18ms11224 KiB
2Time limit exceeded857ms18348 KiB
subtask20/5
3Wrong answer17ms11460 KiB
4Wrong answer17ms11552 KiB
5Wrong answer17ms11652 KiB
6Wrong answer29ms12180 KiB
7Wrong answer797ms12320 KiB
8Wrong answer839ms12544 KiB
subtask30/10
9Time limit exceeded876ms5292 KiB
10Time limit exceeded859ms5512 KiB
11Time limit exceeded859ms5664 KiB
12Wrong answer794ms13232 KiB
13Time limit exceeded934ms5604 KiB
14Time limit exceeded926ms5668 KiB
subtask40/10
15Wrong answer17ms12904 KiB
16Wrong answer29ms13304 KiB
17Time limit exceeded899ms5844 KiB
18Time limit exceeded883ms7096 KiB
19Time limit exceeded888ms22640 KiB
20Time limit exceeded888ms23472 KiB
21Time limit exceeded867ms23496 KiB
subtask50/15
22Wrong answer17ms13496 KiB
23Time limit exceeded901ms21192 KiB
24Time limit exceeded952ms23632 KiB
subtask60/60
25Time limit exceeded884ms20804 KiB
26Time limit exceeded873ms22832 KiB
27Time limit exceeded884ms22708 KiB
28Time limit exceeded865ms20744 KiB
29Time limit exceeded856ms20736 KiB
30Time limit exceeded869ms20608 KiB
31Time limit exceeded879ms23020 KiB
32Time limit exceeded867ms23256 KiB
33Time limit exceeded856ms22720 KiB
34Time limit exceeded871ms22808 KiB
35Time limit exceeded880ms22804 KiB
36Time limit exceeded856ms23500 KiB
37Time limit exceeded864ms19584 KiB
38Time limit exceeded864ms23952 KiB
39Wrong answer847ms14512 KiB