1995 | 2022-12-12 22:13:01 | tronoraa | Mágikus intervallum | python3 | Time limit exceeded 0/100 | 952ms | 23948 KiB |
N = int(input())
sorozat = [int(elem) for elem in input().split(" ")]
lista, szam = [], []
L, R = 1, 1
for i in range(N):
osszeg = 0
for j in range(i+1, N):
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)
print(f"{lista[0]} {lista[1]}")
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 11076 KiB | ||||
2 | Time limit exceeded | 882ms | 18440 KiB | ||||
subtask2 | 0/5 | ||||||
3 | Runtime error | 17ms | 11564 KiB | ||||
4 | Wrong answer | 17ms | 12276 KiB | ||||
5 | Wrong answer | 17ms | 12248 KiB | ||||
6 | Wrong answer | 28ms | 12796 KiB | ||||
7 | Wrong answer | 754ms | 12432 KiB | ||||
8 | Wrong answer | 750ms | 12816 KiB | ||||
subtask3 | 0/10 | ||||||
9 | Wrong answer | 794ms | 12720 KiB | ||||
10 | Wrong answer | 796ms | 12840 KiB | ||||
11 | Wrong answer | 800ms | 12752 KiB | ||||
12 | Wrong answer | 759ms | 13016 KiB | ||||
13 | Time limit exceeded | 929ms | 5508 KiB | ||||
14 | Time limit exceeded | 870ms | 5776 KiB | ||||
subtask4 | 0/10 | ||||||
15 | Runtime error | 17ms | 13244 KiB | ||||
16 | Wrong answer | 27ms | 13572 KiB | ||||
17 | Time limit exceeded | 880ms | 6140 KiB | ||||
18 | Time limit exceeded | 879ms | 7136 KiB | ||||
19 | Time limit exceeded | 871ms | 22724 KiB | ||||
20 | Time limit exceeded | 867ms | 23460 KiB | ||||
21 | Time limit exceeded | 888ms | 23632 KiB | ||||
subtask5 | 0/15 | ||||||
22 | Accepted | 17ms | 13880 KiB | ||||
23 | Time limit exceeded | 901ms | 21368 KiB | ||||
24 | Time limit exceeded | 888ms | 23652 KiB | ||||
subtask6 | 0/60 | ||||||
25 | Time limit exceeded | 867ms | 20452 KiB | ||||
26 | Time limit exceeded | 875ms | 22988 KiB | ||||
27 | Time limit exceeded | 952ms | 22684 KiB | ||||
28 | Time limit exceeded | 948ms | 20564 KiB | ||||
29 | Time limit exceeded | 879ms | 20796 KiB | ||||
30 | Time limit exceeded | 866ms | 20864 KiB | ||||
31 | Time limit exceeded | 935ms | 23216 KiB | ||||
32 | Time limit exceeded | 867ms | 23188 KiB | ||||
33 | Time limit exceeded | 871ms | 22780 KiB | ||||
34 | Time limit exceeded | 875ms | 22772 KiB | ||||
35 | Time limit exceeded | 948ms | 22840 KiB | ||||
36 | Time limit exceeded | 856ms | 23460 KiB | ||||
37 | Time limit exceeded | 871ms | 19456 KiB | ||||
38 | Time limit exceeded | 871ms | 23948 KiB | ||||
39 | Wrong answer | 753ms | 14436 KiB |