結果

問題 No.1110 好きな歌
ユーザー anagohirameanagohirame
提出日時 2020-07-10 22:08:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 803 ms / 5,000 ms
コード長 303 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 122,936 KB
最終ジャッジ日時 2024-04-19 17:20:47
合計ジャッジ時間 21,006 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
55,312 KB
testcase_01 AC 36 ms
54,792 KB
testcase_02 AC 36 ms
54,476 KB
testcase_03 AC 37 ms
54,268 KB
testcase_04 AC 37 ms
54,084 KB
testcase_05 AC 37 ms
54,796 KB
testcase_06 AC 35 ms
54,380 KB
testcase_07 AC 36 ms
54,252 KB
testcase_08 AC 35 ms
54,904 KB
testcase_09 AC 36 ms
53,976 KB
testcase_10 AC 36 ms
54,248 KB
testcase_11 AC 37 ms
54,488 KB
testcase_12 AC 36 ms
55,300 KB
testcase_13 AC 36 ms
55,344 KB
testcase_14 AC 50 ms
65,276 KB
testcase_15 AC 46 ms
63,096 KB
testcase_16 AC 49 ms
65,588 KB
testcase_17 AC 57 ms
68,132 KB
testcase_18 AC 39 ms
54,724 KB
testcase_19 AC 56 ms
70,480 KB
testcase_20 AC 56 ms
68,752 KB
testcase_21 AC 48 ms
63,828 KB
testcase_22 AC 55 ms
67,712 KB
testcase_23 AC 45 ms
62,192 KB
testcase_24 AC 460 ms
102,120 KB
testcase_25 AC 557 ms
113,160 KB
testcase_26 AC 319 ms
92,168 KB
testcase_27 AC 566 ms
112,140 KB
testcase_28 AC 337 ms
93,268 KB
testcase_29 AC 659 ms
111,080 KB
testcase_30 AC 333 ms
93,340 KB
testcase_31 AC 249 ms
85,996 KB
testcase_32 AC 732 ms
122,936 KB
testcase_33 AC 355 ms
100,836 KB
testcase_34 AC 504 ms
103,100 KB
testcase_35 AC 696 ms
120,156 KB
testcase_36 AC 125 ms
80,300 KB
testcase_37 AC 248 ms
90,240 KB
testcase_38 AC 659 ms
110,328 KB
testcase_39 AC 492 ms
102,652 KB
testcase_40 AC 546 ms
109,896 KB
testcase_41 AC 107 ms
78,440 KB
testcase_42 AC 658 ms
120,784 KB
testcase_43 AC 643 ms
111,200 KB
testcase_44 AC 719 ms
119,536 KB
testcase_45 AC 771 ms
119,532 KB
testcase_46 AC 753 ms
120,172 KB
testcase_47 AC 803 ms
119,980 KB
testcase_48 AC 796 ms
119,660 KB
testcase_49 AC 679 ms
119,664 KB
testcase_50 AC 777 ms
119,536 KB
testcase_51 AC 761 ms
119,528 KB
testcase_52 AC 776 ms
119,920 KB
testcase_53 AC 800 ms
120,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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