結果

問題 No.1110 好きな歌
ユーザー nephrologistnephrologist
提出日時 2020-07-10 21:47:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 647 ms / 5,000 ms
コード長 420 bytes
コンパイル時間 1,073 ms
コンパイル使用メモリ 86,416 KB
実行使用メモリ 93,800 KB
最終ジャッジ日時 2023-08-01 17:29:13
合計ジャッジ時間 20,251 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,012 KB
testcase_01 AC 71 ms
70,972 KB
testcase_02 AC 70 ms
70,808 KB
testcase_03 AC 71 ms
71,032 KB
testcase_04 AC 73 ms
70,972 KB
testcase_05 AC 70 ms
70,972 KB
testcase_06 AC 70 ms
71,180 KB
testcase_07 AC 70 ms
70,800 KB
testcase_08 AC 69 ms
70,940 KB
testcase_09 AC 70 ms
71,264 KB
testcase_10 AC 73 ms
71,060 KB
testcase_11 AC 71 ms
71,172 KB
testcase_12 AC 72 ms
71,028 KB
testcase_13 AC 70 ms
70,900 KB
testcase_14 AC 74 ms
70,904 KB
testcase_15 AC 72 ms
71,160 KB
testcase_16 AC 73 ms
71,284 KB
testcase_17 AC 77 ms
70,876 KB
testcase_18 AC 72 ms
71,064 KB
testcase_19 AC 80 ms
75,256 KB
testcase_20 AC 76 ms
71,032 KB
testcase_21 AC 74 ms
71,168 KB
testcase_22 AC 75 ms
70,936 KB
testcase_23 AC 73 ms
71,208 KB
testcase_24 AC 395 ms
86,820 KB
testcase_25 AC 462 ms
89,512 KB
testcase_26 AC 266 ms
82,552 KB
testcase_27 AC 459 ms
88,612 KB
testcase_28 AC 289 ms
83,672 KB
testcase_29 AC 530 ms
91,204 KB
testcase_30 AC 294 ms
82,676 KB
testcase_31 AC 208 ms
81,604 KB
testcase_32 AC 576 ms
92,596 KB
testcase_33 AC 322 ms
83,720 KB
testcase_34 AC 417 ms
87,132 KB
testcase_35 AC 623 ms
92,564 KB
testcase_36 AC 135 ms
78,460 KB
testcase_37 AC 215 ms
80,920 KB
testcase_38 AC 516 ms
91,300 KB
testcase_39 AC 401 ms
88,020 KB
testcase_40 AC 497 ms
88,908 KB
testcase_41 AC 112 ms
77,364 KB
testcase_42 AC 565 ms
91,680 KB
testcase_43 AC 519 ms
91,012 KB
testcase_44 AC 630 ms
92,428 KB
testcase_45 AC 643 ms
93,340 KB
testcase_46 AC 647 ms
93,796 KB
testcase_47 AC 627 ms
93,596 KB
testcase_48 AC 627 ms
93,296 KB
testcase_49 AC 623 ms
91,476 KB
testcase_50 AC 635 ms
93,468 KB
testcase_51 AC 629 ms
92,428 KB
testcase_52 AC 633 ms
93,800 KB
testcase_53 AC 633 ms
93,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.buffer.readline

n, d = map(int, input().split())

A = [(0, 0)] * (n)
for i in range(n):
    val = int(input())
    A[i] = (val, i)
A.sort(reverse=True)

ans = [0] * (n)
lim = 0
for i in range(n):
    while lim < n:
        if A[i][0] - A[lim][0] < d:
            lim += 1
        else:
            break
    # print(i, A[i], lim)
    ans[A[i][1]] = max(n - (lim), 0)
print(*ans, sep="\n")
0