1991 | 2022-12-12 21:56:51 | tronoraa | Mágikus intervallum | python3 | Time limit exceeded 0/100 | 953ms | 24264 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 = [L, 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=' ')
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 11424 KiB | ||||
2 | Time limit exceeded | 883ms | 18456 KiB | ||||
subtask2 | 0/5 | ||||||
3 | Wrong answer | 17ms | 11756 KiB | ||||
4 | Wrong answer | 16ms | 11684 KiB | ||||
5 | Accepted | 17ms | 12032 KiB | ||||
6 | Accepted | 17ms | 12248 KiB | ||||
7 | Wrong answer | 20ms | 12596 KiB | ||||
8 | Wrong answer | 20ms | 12896 KiB | ||||
subtask3 | 0/10 | ||||||
9 | Wrong answer | 21ms | 12924 KiB | ||||
10 | Wrong answer | 21ms | 13036 KiB | ||||
11 | Wrong answer | 20ms | 13116 KiB | ||||
12 | Wrong answer | 21ms | 13436 KiB | ||||
13 | Wrong answer | 32ms | 13516 KiB | ||||
14 | Wrong answer | 32ms | 13668 KiB | ||||
subtask4 | 0/10 | ||||||
15 | Wrong answer | 17ms | 13556 KiB | ||||
16 | Wrong answer | 17ms | 13736 KiB | ||||
17 | Wrong answer | 35ms | 13812 KiB | ||||
18 | Time limit exceeded | 945ms | 7548 KiB | ||||
19 | Time limit exceeded | 884ms | 23060 KiB | ||||
20 | Time limit exceeded | 873ms | 23680 KiB | ||||
21 | Time limit exceeded | 884ms | 23944 KiB | ||||
subtask5 | 0/15 | ||||||
22 | Accepted | 17ms | 14052 KiB | ||||
23 | Time limit exceeded | 901ms | 21768 KiB | ||||
24 | Time limit exceeded | 880ms | 24264 KiB | ||||
subtask6 | 0/60 | ||||||
25 | Time limit exceeded | 953ms | 21104 KiB | ||||
26 | Time limit exceeded | 867ms | 23240 KiB | ||||
27 | Time limit exceeded | 933ms | 23264 KiB | ||||
28 | Time limit exceeded | 875ms | 21240 KiB | ||||
29 | Time limit exceeded | 871ms | 21312 KiB | ||||
30 | Time limit exceeded | 944ms | 21252 KiB | ||||
31 | Time limit exceeded | 876ms | 23392 KiB | ||||
32 | Time limit exceeded | 864ms | 23276 KiB | ||||
33 | Time limit exceeded | 867ms | 22824 KiB | ||||
34 | Time limit exceeded | 867ms | 23068 KiB | ||||
35 | Time limit exceeded | 869ms | 22956 KiB | ||||
36 | Time limit exceeded | 856ms | 23404 KiB | ||||
37 | Time limit exceeded | 933ms | 19468 KiB | ||||
38 | Time limit exceeded | 869ms | 24132 KiB | ||||
39 | Wrong answer | 20ms | 14492 KiB |