85502024-01-21 20:43:19baktucsokA Barbárpython3Time limit exceeded 12/1001.088s130032 KiB
N = int(input().strip())
D = list(map(int, input().strip().split()))
l = []
z=D
for i in range(N):
    D=list(z)
    while True:
        if i ==0:
            l.append(str(N-1))
            break
        elif i == (len(D)-1):
            l.append("0")
            break
        else:
            if D[i+1]-D[i]>=D[i]-D[i-1]:
                D.remove(D[i])
                i-=1
            else:
                D.remove(D[i])
print(" ".join(l))
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms11348 KiB
2Accepted17ms11120 KiB
subtask212/12
3Accepted17ms11716 KiB
4Accepted17ms11932 KiB
5Accepted17ms12164 KiB
6Accepted24ms11928 KiB
7Accepted24ms12396 KiB
8Accepted25ms12448 KiB
9Accepted24ms12624 KiB
10Accepted24ms12864 KiB
11Accepted23ms12664 KiB
12Accepted25ms12612 KiB
subtask30/28
13Time limit exceeded1.064s5372 KiB
14Time limit exceeded1.062s5396 KiB
15Time limit exceeded1.067s5376 KiB
16Time limit exceeded1.059s5384 KiB
17Time limit exceeded1.075s5400 KiB
18Time limit exceeded1.067s5512 KiB
19Time limit exceeded1.072s5644 KiB
20Time limit exceeded1.075s5648 KiB
21Time limit exceeded1.075s5952 KiB
subtask40/35
22Time limit exceeded1.075s16888 KiB
23Time limit exceeded1.06s17000 KiB
24Time limit exceeded1.075s16888 KiB
25Time limit exceeded1.039s16956 KiB
26Time limit exceeded1.075s12428 KiB
27Time limit exceeded1.069s17852 KiB
28Time limit exceeded1.08s17764 KiB
29Time limit exceeded1.047s17772 KiB
30Time limit exceeded1.077s17612 KiB
31Time limit exceeded1.08s17180 KiB
subtask50/25
32Time limit exceeded1.057s116564 KiB
33Time limit exceeded1.067s105576 KiB
34Time limit exceeded1.062s125816 KiB
35Time limit exceeded1.065s105536 KiB
36Time limit exceeded1.06s118148 KiB
37Time limit exceeded1.074s123908 KiB
38Time limit exceeded1.074s127080 KiB
39Time limit exceeded1.054s129932 KiB
40Time limit exceeded1.074s130032 KiB
41Time limit exceeded1.054s122496 KiB
42Time limit exceeded1.077s112532 KiB
43Time limit exceeded1.062s114928 KiB
44Time limit exceeded1.075s122392 KiB
45Time limit exceeded1.085s116036 KiB
46Time limit exceeded1.067s121860 KiB
47Time limit exceeded1.088s116536 KiB
48Time limit exceeded1.062s116608 KiB
49Time limit exceeded1.062s116564 KiB
50Time limit exceeded1.046s116652 KiB