結果

問題 No.1110 好きな歌
コンテスト
ユーザー anagohirame
提出日時 2020-07-10 22:08:49
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 983 ms / 5,000 ms
コード長 303 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 447 ms
コンパイル使用メモリ 85,120 KB
実行使用メモリ 124,976 KB
最終ジャッジ日時 2026-04-27 16:26:11
合計ジャッジ時間 18,966 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from bisect import bisect
from collections import Counter
n, d = map(int, input().split())
a = [int(input()) for _ in range(n)]
c = sorted(list(Counter(a).items()))
keys, values = [-10**20], [0]
for i, j in c:
	keys.append(i)
	values.append(values[-1]+j)

for x in a:
	print(values[bisect(keys, x-d)-1])
0