結果

問題 No.1110 好きな歌
ユーザー tanon710tanon710
提出日時 2020-07-10 21:44:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 452 ms / 5,000 ms
コード長 382 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 104,820 KB
最終ジャッジ日時 2024-04-19 16:35:29
合計ジャッジ時間 13,444 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,352 KB
testcase_01 AC 37 ms
52,096 KB
testcase_02 AC 33 ms
52,608 KB
testcase_03 AC 32 ms
52,352 KB
testcase_04 AC 33 ms
52,736 KB
testcase_05 AC 34 ms
52,224 KB
testcase_06 AC 34 ms
52,128 KB
testcase_07 AC 33 ms
52,224 KB
testcase_08 AC 33 ms
52,224 KB
testcase_09 AC 32 ms
52,352 KB
testcase_10 AC 32 ms
52,352 KB
testcase_11 AC 32 ms
52,096 KB
testcase_12 AC 33 ms
52,608 KB
testcase_13 AC 34 ms
52,608 KB
testcase_14 AC 42 ms
60,160 KB
testcase_15 AC 40 ms
59,136 KB
testcase_16 AC 42 ms
60,288 KB
testcase_17 AC 43 ms
61,568 KB
testcase_18 AC 34 ms
52,608 KB
testcase_19 AC 43 ms
62,080 KB
testcase_20 AC 44 ms
61,880 KB
testcase_21 AC 40 ms
59,648 KB
testcase_22 AC 44 ms
61,184 KB
testcase_23 AC 37 ms
58,988 KB
testcase_24 AC 278 ms
90,256 KB
testcase_25 AC 317 ms
93,048 KB
testcase_26 AC 189 ms
85,692 KB
testcase_27 AC 314 ms
92,956 KB
testcase_28 AC 207 ms
88,220 KB
testcase_29 AC 381 ms
95,524 KB
testcase_30 AC 202 ms
88,320 KB
testcase_31 AC 144 ms
82,412 KB
testcase_32 AC 438 ms
104,820 KB
testcase_33 AC 209 ms
87,576 KB
testcase_34 AC 299 ms
96,512 KB
testcase_35 AC 420 ms
99,940 KB
testcase_36 AC 90 ms
79,100 KB
testcase_37 AC 153 ms
83,036 KB
testcase_38 AC 368 ms
95,616 KB
testcase_39 AC 281 ms
90,464 KB
testcase_40 AC 321 ms
95,096 KB
testcase_41 AC 79 ms
77,824 KB
testcase_42 AC 407 ms
102,144 KB
testcase_43 AC 362 ms
95,608 KB
testcase_44 AC 426 ms
99,840 KB
testcase_45 AC 448 ms
99,896 KB
testcase_46 AC 443 ms
100,388 KB
testcase_47 AC 452 ms
99,968 KB
testcase_48 AC 429 ms
99,816 KB
testcase_49 AC 404 ms
100,284 KB
testcase_50 AC 442 ms
99,968 KB
testcase_51 AC 429 ms
99,968 KB
testcase_52 AC 432 ms
99,968 KB
testcase_53 AC 448 ms
100,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import bisect
import sys
input=sys.stdin.readline

n,d=map(int,input().split())
arr=[[int(input()),i] for i in range(n)]
arr=sorted(arr,key=lambda x:x[0])
ans=[0]*n
vals=[0]*n
for i in range(n):
    vals[i]=arr[i][0]
for i in range(n):
    cnt=bisect.bisect_right(vals,arr[i][0]-d)
    ans[arr[i][1]]=cnt
for i in range(n):
    print(ans[i])
0