125032024-12-19 22:23:3642Tűzijátékpython3Accepted 50/5075ms14100 KiB
N,S,maxT=[int(x) for x in input().split()]
A=[int(x) for x in input().split()]
after=[S]
before=[]
res=1
cur=S-1
for i in range(S,N):
 if A[i]-A[cur]>=maxT:
  after.append(i+1)
  cur=i
  res+=1
cur=S-1
for i in range(S-2,-1,-1):
 if A[cur]-A[i]>=maxT:
  before.append(i+1)
  cur=i
  res+=1
print(res)
print(*before[::-1],*after)
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/016ms3104 KiB
2Accepted0/072ms13920 KiB
3Accepted2/216ms3128 KiB
4Accepted2/216ms3128 KiB
5Accepted2/216ms3128 KiB
6Accepted2/216ms3128 KiB
7Accepted2/216ms3128 KiB
8Accepted2/217ms3120 KiB
9Accepted2/219ms3852 KiB
10Accepted2/221ms4144 KiB
11Accepted2/220ms4036 KiB
12Accepted2/227ms5056 KiB
13Accepted2/227ms5188 KiB
14Accepted2/225ms5156 KiB
15Accepted3/325ms5276 KiB
16Accepted3/334ms6452 KiB
17Accepted3/339ms7516 KiB
18Accepted3/343ms8856 KiB
19Accepted3/372ms13876 KiB
20Accepted3/375ms13872 KiB
21Accepted4/475ms14100 KiB
22Accepted4/471ms14092 KiB