161642025-04-08 12:40:41algoproTűzijátékpypy3Runtime error 36/5079ms32000 KiB
# UUID: c905ec7d-9693-43cf-97fd-5d3cfdca9d2d
sor1 = input(); sor2 = input()

L1 = list(map(int, sor1.split(' '))); N, telep, tav = L1[0], L1[1], L1[2]; helyek = list(map(int, sor2.split(' ')))

ok, utolso = [telep], telep-1

for i in range(telep-2, -1, -1):
    if helyek[utolso]-helyek[i] >= tav:
        ok += [i+1]; utolso = i

utolso = telep-1

for i in range(telep, N):
    if helyek[i]-helyek[utolso] >= tav:
        ok += [i+1]; utolso = i

ok.sort(); print(len(ok)); print(*ok)


SubtaskSumTestVerdictTimeMemory
base36/50
1Accepted0/045ms19344 KiB
2Runtime error0/064ms32000 KiB
3Accepted2/245ms19368 KiB
4Accepted2/239ms19432 KiB
5Accepted2/246ms19432 KiB
6Accepted2/239ms19436 KiB
7Accepted2/239ms19320 KiB
8Accepted2/246ms19540 KiB
9Accepted2/252ms21676 KiB
10Accepted2/254ms22156 KiB
11Accepted2/261ms22260 KiB
12Accepted2/270ms22452 KiB
13Accepted2/261ms22524 KiB
14Accepted2/268ms22416 KiB
15Accepted3/361ms22612 KiB
16Accepted3/371ms23584 KiB
17Accepted3/368ms26344 KiB
18Accepted3/379ms27508 KiB
19Runtime error0/364ms32000 KiB
20Runtime error0/374ms32000 KiB
21Runtime error0/472ms32000 KiB
22Runtime error0/464ms32000 KiB