161582025-04-08 12:19:13algoproTűzijátékpypy3Runtime error 36/50109ms32000 KiB
# UUID: 6478ef41-4545-42d5-9fa9-49d8186c1c61
N,S,T=map(int,input().split())
A=[*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/068ms31972 KiB
2Runtime error0/0109ms32000 KiB
3Accepted2/268ms32000 KiB
4Accepted2/267ms32000 KiB
5Accepted2/250ms23640 KiB
6Accepted2/250ms22464 KiB
7Accepted2/248ms23196 KiB
8Accepted2/246ms19676 KiB
9Accepted2/259ms22208 KiB
10Accepted2/259ms23652 KiB
11Accepted2/263ms22596 KiB
12Accepted2/265ms23852 KiB
13Accepted2/261ms22680 KiB
14Accepted2/268ms22584 KiB
15Accepted3/368ms22812 KiB
16Accepted3/364ms24728 KiB
17Accepted3/368ms26416 KiB
18Accepted3/378ms27436 KiB
19Runtime error0/364ms32000 KiB
20Runtime error0/374ms32000 KiB
21Runtime error0/472ms32000 KiB
22Runtime error0/463ms32000 KiB