1989 | 2022-12-12 21:45:46 | tronoraa | Mágikus intervallum | python3 | Time limit exceeded 0/100 | 949ms | 23556 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[i:j]) > len(lista):
lista = []
lista.append(L)
lista.append(R)
szam = []
for i in range(len(lista)):
if i == len(lista)-1:
print(lista[i])
else:
print(lista[i], end=' ')
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 18ms | 11196 KiB | ||||
2 | Time limit exceeded | 875ms | 18648 KiB | ||||
subtask2 | 0/5 | ||||||
3 | Wrong answer | 17ms | 11708 KiB | ||||
4 | Wrong answer | 17ms | 12276 KiB | ||||
5 | Wrong answer | 17ms | 12104 KiB | ||||
6 | Wrong answer | 30ms | 12064 KiB | ||||
7 | Wrong answer | 836ms | 12592 KiB | ||||
8 | Wrong answer | 842ms | 12516 KiB | ||||
subtask3 | 0/10 | ||||||
9 | Time limit exceeded | 899ms | 12452 KiB | ||||
10 | Time limit exceeded | 898ms | 12560 KiB | ||||
11 | Time limit exceeded | 879ms | 5252 KiB | ||||
12 | Wrong answer | 847ms | 12608 KiB | ||||
13 | Time limit exceeded | 945ms | 5360 KiB | ||||
14 | Time limit exceeded | 875ms | 5456 KiB | ||||
subtask4 | 0/10 | ||||||
15 | Wrong answer | 17ms | 12880 KiB | ||||
16 | Wrong answer | 29ms | 13056 KiB | ||||
17 | Time limit exceeded | 865ms | 5556 KiB | ||||
18 | Time limit exceeded | 866ms | 6504 KiB | ||||
19 | Time limit exceeded | 908ms | 22136 KiB | ||||
20 | Time limit exceeded | 884ms | 22736 KiB | ||||
21 | Time limit exceeded | 876ms | 22672 KiB | ||||
subtask5 | 0/15 | ||||||
22 | Accepted | 17ms | 12872 KiB | ||||
23 | Time limit exceeded | 901ms | 20860 KiB | ||||
24 | Time limit exceeded | 871ms | 23108 KiB | ||||
subtask6 | 0/60 | ||||||
25 | Time limit exceeded | 949ms | 20384 KiB | ||||
26 | Time limit exceeded | 865ms | 22508 KiB | ||||
27 | Time limit exceeded | 860ms | 22620 KiB | ||||
28 | Time limit exceeded | 861ms | 20564 KiB | ||||
29 | Time limit exceeded | 879ms | 20628 KiB | ||||
30 | Time limit exceeded | 884ms | 20588 KiB | ||||
31 | Time limit exceeded | 869ms | 22732 KiB | ||||
32 | Time limit exceeded | 864ms | 23132 KiB | ||||
33 | Time limit exceeded | 864ms | 22428 KiB | ||||
34 | Time limit exceeded | 867ms | 22076 KiB | ||||
35 | Time limit exceeded | 884ms | 22348 KiB | ||||
36 | Time limit exceeded | 856ms | 22660 KiB | ||||
37 | Time limit exceeded | 875ms | 19336 KiB | ||||
38 | Time limit exceeded | 879ms | 23556 KiB | ||||
39 | Wrong answer | 850ms | 13864 KiB |