結果
問題 | No.2803 Bocching Star |
ユーザー |
|
提出日時 | 2024-09-30 12:26:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 633 ms / 2,000 ms |
コード長 | 402 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 81,836 KB |
実行使用メモリ | 118,288 KB |
最終ジャッジ日時 | 2024-09-30 12:26:33 |
合計ジャッジ時間 | 16,273 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 |
ソースコード
N,S = map(int, input().split())P = list(map(int, input().split()))A = []for i,j in enumerate(P):A.append((j,i+1))A.sort()ans = []for i in range(N):flag = Falseif i>0 and abs(A[i][0]-A[i-1][0]) <= S:flag = Trueif i<N-1 and abs(A[i][0]-A[i+1][0]) <= S:flag = Trueif flag == False:ans.append(A[i][1])print(len(ans))ans.sort()print(*ans)