結果
| 問題 | 
                            No.1110 好きな歌
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-07-11 11:00:09 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 337 bytes | 
| コンパイル時間 | 240 ms | 
| コンパイル使用メモリ | 82,688 KB | 
| 実行使用メモリ | 335,988 KB | 
| 最終ジャッジ日時 | 2024-10-12 19:36:57 | 
| 合計ジャッジ時間 | 9,217 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 15 WA * 6 TLE * 1 -- * 29 | 
ソースコード
import sys
_,D,*A = map(int,open(0).read().split())
if len(A) < 2:
    print(0)
    sys.exit()
A_sorted = sorted(A)
for a in A:
    if a <= D:
        print(0)
        continue
    A_part = A_sorted[:A_sorted.index(a)][::-1]
    for i,p in enumerate(A_part):
        if a - p >= D:
            print(len(A_part[i:]))
            break