結果

問題 No.2803 Bocching Star
コンテスト
ユーザー るこーそー
提出日時 2024-09-25 13:30:03
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 531 ms / 2,000 ms
コード長 375 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 369 ms
コンパイル使用メモリ 84,864 KB
実行使用メモリ 124,088 KB
最終ジャッジ日時 2026-04-12 18:11:04
合計ジャッジ時間 11,902 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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