結果

問題 No.1110 好きな歌
ユーザー xuanjixuanji
提出日時 2020-07-10 21:52:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 338 ms / 5,000 ms
コード長 414 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 82,556 KB
実行使用メモリ 154,272 KB
最終ジャッジ日時 2024-04-19 16:51:46
合計ジャッジ時間 11,161 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
54,016 KB
testcase_01 AC 39 ms
54,016 KB
testcase_02 AC 40 ms
53,504 KB
testcase_03 AC 40 ms
53,376 KB
testcase_04 AC 40 ms
53,504 KB
testcase_05 AC 40 ms
53,376 KB
testcase_06 AC 39 ms
53,992 KB
testcase_07 AC 39 ms
53,376 KB
testcase_08 AC 44 ms
54,016 KB
testcase_09 AC 39 ms
54,016 KB
testcase_10 AC 40 ms
53,248 KB
testcase_11 AC 40 ms
53,760 KB
testcase_12 AC 40 ms
53,632 KB
testcase_13 AC 39 ms
53,632 KB
testcase_14 AC 45 ms
55,296 KB
testcase_15 AC 42 ms
54,528 KB
testcase_16 AC 43 ms
55,424 KB
testcase_17 AC 46 ms
56,320 KB
testcase_18 AC 40 ms
53,760 KB
testcase_19 AC 48 ms
61,824 KB
testcase_20 AC 46 ms
55,936 KB
testcase_21 AC 43 ms
54,784 KB
testcase_22 AC 45 ms
55,808 KB
testcase_23 AC 42 ms
54,772 KB
testcase_24 AC 204 ms
122,088 KB
testcase_25 AC 221 ms
115,440 KB
testcase_26 AC 154 ms
107,308 KB
testcase_27 AC 225 ms
112,620 KB
testcase_28 AC 148 ms
101,896 KB
testcase_29 AC 263 ms
135,296 KB
testcase_30 AC 148 ms
106,752 KB
testcase_31 AC 115 ms
94,812 KB
testcase_32 AC 285 ms
147,456 KB
testcase_33 AC 159 ms
111,080 KB
testcase_34 AC 202 ms
122,608 KB
testcase_35 AC 280 ms
148,484 KB
testcase_36 AC 82 ms
81,576 KB
testcase_37 AC 129 ms
97,608 KB
testcase_38 AC 259 ms
135,632 KB
testcase_39 AC 213 ms
123,628 KB
testcase_40 AC 232 ms
132,580 KB
testcase_41 AC 88 ms
78,552 KB
testcase_42 AC 269 ms
145,668 KB
testcase_43 AC 261 ms
134,860 KB
testcase_44 AC 287 ms
145,520 KB
testcase_45 AC 299 ms
137,092 KB
testcase_46 AC 300 ms
135,628 KB
testcase_47 AC 338 ms
122,784 KB
testcase_48 AC 311 ms
138,720 KB
testcase_49 AC 286 ms
154,272 KB
testcase_50 AC 309 ms
138,500 KB
testcase_51 AC 316 ms
138,480 KB
testcase_52 AC 329 ms
135,436 KB
testcase_53 AC 337 ms
123,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

from sys import stdin, stdout
 
def input():
    return stdin.readline().strip()

from collections import defaultdict

N, D = input().split(' ')
N = int(N)
D = int(D)

A = []
for _ in range(N):
    A += [int(input())]

ans = dict()

sorted_A = sorted(A)
set_A = sorted(list(set(A)))

i = 0
for a in set_A:
    while a - sorted_A[i] >= D: i += 1
    ans[a] = i

for a in A:
    print(ans[a])
0