結果
| 問題 |
No.2803 Bocching Star
|
| コンテスト | |
| ユーザー |
るこーそー
|
| 提出日時 | 2024-09-25 13:27:27 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 743 ms / 2,000 ms |
| コード長 | 544 bytes |
| コンパイル時間 | 189 ms |
| コンパイル使用メモリ | 82,448 KB |
| 実行使用メモリ | 130,820 KB |
| 最終ジャッジ日時 | 2024-09-25 13:27:47 |
| 合計ジャッジ時間 | 18,277 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
n,s=map(int,input().split())
P=list(map(int,input().split()))
P=[[p,i] for i,p in enumerate(P)]
P.sort()
if len(P)==1:
print(1)
print(1)
exit()
ans=[]
for i in range(n):
if i!=0 and i!=n-1:
pp,p,np=P[i-1][0],P[i][0],P[i+1][0]
if s<abs(p-pp) and s<abs(np-p):
ans.append(P[i][1]+1)
if i==0:
if s<abs(P[i][0]-P[i+1][0]):
ans.append(P[i][1]+1)
if i==n-1:
if s<abs(P[i][0]-P[i-1][0]):
ans.append(P[i][1]+1)
print(len(ans))
print(*sorted(ans))
るこーそー