112962024-08-04 16:35:24probaTűzijátékpython3Accepted 50/5082ms15016 KiB
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
base50/50
1Accepted0/018ms3044 KiB
2Accepted0/082ms14828 KiB
3Accepted2/217ms3088 KiB
4Accepted2/217ms3104 KiB
5Accepted2/217ms3044 KiB
6Accepted2/217ms3192 KiB
7Accepted2/217ms3088 KiB
8Accepted2/218ms2972 KiB
9Accepted2/220ms3684 KiB
10Accepted2/223ms4068 KiB
11Accepted2/223ms4068 KiB
12Accepted2/229ms5304 KiB
13Accepted2/228ms5116 KiB
14Accepted2/228ms5136 KiB
15Accepted3/328ms5368 KiB
16Accepted3/337ms6440 KiB
17Accepted3/343ms7584 KiB
18Accepted3/348ms9188 KiB
19Accepted3/379ms14912 KiB
20Accepted3/379ms14748 KiB
21Accepted4/479ms14932 KiB
22Accepted4/474ms15016 KiB