結果

問題 No.1110 好きな歌
ユーザー lloyzlloyz
提出日時 2022-02-19 00:27:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 450 ms / 5,000 ms
コード長 329 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 86,480 KB
実行使用メモリ 95,424 KB
最終ジャッジ日時 2023-09-11 20:20:40
合計ジャッジ時間 18,842 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
70,804 KB
testcase_01 AC 70 ms
71,236 KB
testcase_02 AC 70 ms
71,180 KB
testcase_03 AC 72 ms
71,164 KB
testcase_04 AC 71 ms
71,140 KB
testcase_05 AC 70 ms
70,804 KB
testcase_06 AC 69 ms
71,100 KB
testcase_07 AC 71 ms
70,996 KB
testcase_08 AC 69 ms
71,048 KB
testcase_09 AC 70 ms
70,804 KB
testcase_10 AC 70 ms
71,216 KB
testcase_11 AC 69 ms
71,060 KB
testcase_12 AC 69 ms
71,256 KB
testcase_13 AC 68 ms
71,188 KB
testcase_14 AC 79 ms
75,152 KB
testcase_15 AC 74 ms
71,220 KB
testcase_16 AC 79 ms
75,148 KB
testcase_17 AC 82 ms
75,280 KB
testcase_18 AC 70 ms
71,140 KB
testcase_19 AC 86 ms
75,532 KB
testcase_20 AC 83 ms
75,152 KB
testcase_21 AC 77 ms
71,140 KB
testcase_22 AC 83 ms
75,364 KB
testcase_23 AC 75 ms
71,068 KB
testcase_24 AC 316 ms
85,440 KB
testcase_25 AC 334 ms
85,852 KB
testcase_26 AC 226 ms
82,540 KB
testcase_27 AC 340 ms
89,092 KB
testcase_28 AC 234 ms
83,404 KB
testcase_29 AC 376 ms
87,888 KB
testcase_30 AC 233 ms
83,540 KB
testcase_31 AC 189 ms
83,496 KB
testcase_32 AC 444 ms
92,848 KB
testcase_33 AC 268 ms
86,308 KB
testcase_34 AC 315 ms
85,344 KB
testcase_35 AC 450 ms
91,672 KB
testcase_36 AC 134 ms
78,272 KB
testcase_37 AC 187 ms
81,172 KB
testcase_38 AC 374 ms
87,820 KB
testcase_39 AC 299 ms
85,476 KB
testcase_40 AC 358 ms
87,924 KB
testcase_41 AC 124 ms
77,976 KB
testcase_42 AC 428 ms
95,424 KB
testcase_43 AC 372 ms
87,944 KB
testcase_44 AC 444 ms
91,284 KB
testcase_45 AC 444 ms
90,852 KB
testcase_46 AC 445 ms
91,468 KB
testcase_47 AC 440 ms
90,684 KB
testcase_48 AC 445 ms
90,948 KB
testcase_49 AC 427 ms
91,340 KB
testcase_50 AC 430 ms
90,956 KB
testcase_51 AC 437 ms
90,924 KB
testcase_52 AC 441 ms
91,408 KB
testcase_53 AC 438 ms
90,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d = map(int, input().split())
A = []
for i in range(n):
    A.append((int(input()), i))

A.sort(key=lambda x: x[0], reverse=True)
ANS = [0 for _ in range(n)]
right = 0
for left in range(n):
    while right < n and A[left][0] - A[right][0] < d:
        right += 1
    ANS[A[left][1]] = n - right
for ans in ANS:
    print(ans)
0