1996 | 2022-12-12 22:14:09 | tronoraa | Mágikus intervallum | python3 | Time limit exceeded 0/100 | 952ms | 24328 KiB |
N = int(input())
sorozat = [int(elem) for elem in input().split(" ")]
lista, szam = [], []
L, R = 1, 1
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]
print(f"{lista[0]} {lista[1]}")
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 18ms | 11220 KiB | ||||
2 | Time limit exceeded | 874ms | 18328 KiB | ||||
subtask2 | 0/5 | ||||||
3 | Runtime error | 17ms | 11408 KiB | ||||
4 | Wrong answer | 17ms | 11924 KiB | ||||
5 | Wrong answer | 17ms | 11912 KiB | ||||
6 | Wrong answer | 28ms | 11932 KiB | ||||
7 | Wrong answer | 763ms | 12092 KiB | ||||
8 | Wrong answer | 746ms | 12316 KiB | ||||
subtask3 | 0/10 | ||||||
9 | Wrong answer | 795ms | 12716 KiB | ||||
10 | Wrong answer | 799ms | 12492 KiB | ||||
11 | Wrong answer | 811ms | 12468 KiB | ||||
12 | Wrong answer | 741ms | 12716 KiB | ||||
13 | Time limit exceeded | 945ms | 5276 KiB | ||||
14 | Time limit exceeded | 866ms | 5548 KiB | ||||
subtask4 | 0/10 | ||||||
15 | Runtime error | 17ms | 13116 KiB | ||||
16 | Wrong answer | 27ms | 13060 KiB | ||||
17 | Time limit exceeded | 865ms | 5928 KiB | ||||
18 | Time limit exceeded | 866ms | 7092 KiB | ||||
19 | Time limit exceeded | 866ms | 22356 KiB | ||||
20 | Time limit exceeded | 952ms | 23200 KiB | ||||
21 | Time limit exceeded | 867ms | 23336 KiB | ||||
subtask5 | 0/15 | ||||||
22 | Accepted | 17ms | 13424 KiB | ||||
23 | Time limit exceeded | 901ms | 21056 KiB | ||||
24 | Time limit exceeded | 862ms | 23896 KiB | ||||
subtask6 | 0/60 | ||||||
25 | Time limit exceeded | 875ms | 20644 KiB | ||||
26 | Time limit exceeded | 867ms | 22832 KiB | ||||
27 | Time limit exceeded | 865ms | 22656 KiB | ||||
28 | Time limit exceeded | 856ms | 20652 KiB | ||||
29 | Time limit exceeded | 870ms | 20640 KiB | ||||
30 | Time limit exceeded | 952ms | 20504 KiB | ||||
31 | Time limit exceeded | 952ms | 23048 KiB | ||||
32 | Time limit exceeded | 927ms | 23004 KiB | ||||
33 | Time limit exceeded | 901ms | 22532 KiB | ||||
34 | Time limit exceeded | 875ms | 22576 KiB | ||||
35 | Time limit exceeded | 875ms | 22680 KiB | ||||
36 | Time limit exceeded | 952ms | 23276 KiB | ||||
37 | Time limit exceeded | 870ms | 19456 KiB | ||||
38 | Time limit exceeded | 859ms | 24328 KiB | ||||
39 | Wrong answer | 746ms | 14652 KiB |