161602025-04-08 12:26:21algoproTűzijátékpypy3Runtime error 36/5082ms32000 KiB
# UUID: 89d49bc5-f597-4a84-9463-74e0415ca663
N,S,T=map(int,input().split())
A=tuple(map(int,input().split()))
a=[S]
b=[]
r=1
c=S-1
for i in range(S,N):
 if A[i]-A[c]>=T:
  a+=[i+1]
  c=i
  r+=1
c=S-1
for i in range(S-2,-1,-1):
 if A[c]-A[i]>=T:
  b+=[i+1]
  c=i
  r+=1
print(r)
print(*b[::-1],*a)
SubtaskSumTestVerdictTimeMemory
base36/50
1Accepted0/039ms19388 KiB
2Runtime error0/068ms32000 KiB
3Accepted2/245ms19396 KiB
4Accepted2/245ms19508 KiB
5Accepted2/246ms19432 KiB
6Accepted2/239ms19308 KiB
7Accepted2/239ms19436 KiB
8Accepted2/246ms19652 KiB
9Accepted2/254ms21668 KiB
10Accepted2/264ms22240 KiB
11Accepted2/264ms22328 KiB
12Accepted2/265ms23172 KiB
13Accepted2/272ms23148 KiB
14Accepted2/270ms22636 KiB
15Accepted3/371ms23148 KiB
16Accepted3/368ms25496 KiB
17Accepted3/371ms27196 KiB
18Accepted3/382ms28380 KiB
19Runtime error0/374ms32000 KiB
20Runtime error0/365ms32000 KiB
21Runtime error0/475ms32000 KiB
22Runtime error0/467ms32000 KiB