19902022-12-12 21:55:06tronoraaMágikus intervallumpython3Time limit exceeded 0/100939ms24444 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 = []
            lista.append(L)
            lista.append(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
1Accepted18ms11256 KiB
2Time limit exceeded862ms18336 KiB
subtask20/5
3Wrong answer17ms11588 KiB
4Wrong answer17ms11856 KiB
5Accepted17ms11980 KiB
6Accepted17ms12112 KiB
7Wrong answer20ms12304 KiB
8Wrong answer20ms12552 KiB
subtask30/10
9Wrong answer20ms12664 KiB
10Wrong answer20ms12776 KiB
11Wrong answer20ms12988 KiB
12Wrong answer20ms13272 KiB
13Wrong answer32ms13328 KiB
14Wrong answer32ms13748 KiB
subtask40/10
15Wrong answer17ms13204 KiB
16Wrong answer17ms13448 KiB
17Wrong answer35ms13832 KiB
18Time limit exceeded865ms7424 KiB
19Time limit exceeded856ms23104 KiB
20Time limit exceeded864ms24076 KiB
21Time limit exceeded939ms23996 KiB
subtask50/15
22Accepted17ms14052 KiB
23Time limit exceeded901ms21760 KiB
24Time limit exceeded880ms24444 KiB
subtask60/60
25Time limit exceeded856ms21224 KiB
26Time limit exceeded869ms23396 KiB
27Time limit exceeded888ms23692 KiB
28Time limit exceeded888ms21704 KiB
29Time limit exceeded856ms21852 KiB
30Time limit exceeded856ms21680 KiB
31Time limit exceeded875ms23648 KiB
32Time limit exceeded856ms23532 KiB
33Time limit exceeded884ms23100 KiB
34Time limit exceeded867ms23068 KiB
35Time limit exceeded869ms23124 KiB
36Time limit exceeded888ms23828 KiB
37Time limit exceeded875ms20248 KiB
38Time limit exceeded864ms24296 KiB
39Wrong answer21ms14780 KiB