結果
問題 | No.2803 Bocching Star |
ユーザー |
|
提出日時 | 2024-07-12 22:11:00 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 689 ms / 2,000 ms |
コード長 | 437 bytes |
コンパイル時間 | 421 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 118,204 KB |
最終ジャッジ日時 | 2024-07-12 22:11:16 |
合計ジャッジ時間 | 16,358 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 |
ソースコード
N,S=map(int,input().split())P=list(map(int,input().split()))if len(P)==1:print(1)print(1)exit()Q=[]for i,p in enumerate(P,1):Q.append((p,i))Q.sort()ans=[]if abs(Q[0][0]-Q[1][0])>S:ans.append(Q[0][1])for i in range(1,N-1):if abs(Q[i][0]-Q[i-1][0])>S and abs(Q[i][0]-Q[i+1][0])>S:ans.append(Q[i][1])if abs(Q[-1][0]-Q[-2][0])>S:ans.append(Q[-1][1])ans.sort()print(len(ans))print(*ans)