結果

問題 No.2803 Bocching Star
ユーザー るこーそー
提出日時 2024-09-25 13:30:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 756 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 82,132 KB
実行使用メモリ 130,428 KB
最終ジャッジ日時 2024-09-25 13:30:22
合計ジャッジ時間 16,854 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

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):
    p=P[i][0]
    pp=P[i-1][0] if i>0 else -1<<60
    np=P[i+1][0] if i<n-1 else 1<<60
    if s<p-pp and s<np-p:
        ans.append(P[i][1]+1)
    

print(len(ans))       
print(*sorted(ans))
0