結果

問題 No.1110 好きな歌
ユーザー nephrologistnephrologist
提出日時 2020-07-10 21:47:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 572 ms / 5,000 ms
コード長 420 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,320 KB
実行使用メモリ 93,912 KB
最終ジャッジ日時 2024-04-19 16:41:47
合計ジャッジ時間 16,051 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,728 KB
testcase_01 AC 33 ms
52,216 KB
testcase_02 AC 33 ms
52,192 KB
testcase_03 AC 33 ms
52,412 KB
testcase_04 AC 33 ms
53,544 KB
testcase_05 AC 33 ms
52,584 KB
testcase_06 AC 33 ms
52,400 KB
testcase_07 AC 34 ms
52,500 KB
testcase_08 AC 34 ms
52,476 KB
testcase_09 AC 34 ms
52,836 KB
testcase_10 AC 35 ms
52,272 KB
testcase_11 AC 33 ms
53,420 KB
testcase_12 AC 33 ms
52,016 KB
testcase_13 AC 33 ms
53,408 KB
testcase_14 AC 38 ms
54,140 KB
testcase_15 AC 35 ms
53,120 KB
testcase_16 AC 36 ms
55,320 KB
testcase_17 AC 37 ms
55,828 KB
testcase_18 AC 34 ms
52,196 KB
testcase_19 AC 40 ms
60,184 KB
testcase_20 AC 38 ms
55,208 KB
testcase_21 AC 37 ms
54,744 KB
testcase_22 AC 36 ms
55,192 KB
testcase_23 AC 33 ms
53,136 KB
testcase_24 AC 344 ms
85,948 KB
testcase_25 AC 413 ms
88,932 KB
testcase_26 AC 225 ms
81,652 KB
testcase_27 AC 413 ms
88,308 KB
testcase_28 AC 245 ms
83,036 KB
testcase_29 AC 468 ms
90,520 KB
testcase_30 AC 240 ms
82,720 KB
testcase_31 AC 164 ms
80,300 KB
testcase_32 AC 513 ms
91,904 KB
testcase_33 AC 277 ms
82,584 KB
testcase_34 AC 383 ms
86,488 KB
testcase_35 AC 553 ms
91,496 KB
testcase_36 AC 95 ms
77,720 KB
testcase_37 AC 172 ms
79,948 KB
testcase_38 AC 455 ms
90,068 KB
testcase_39 AC 345 ms
86,748 KB
testcase_40 AC 430 ms
87,956 KB
testcase_41 AC 76 ms
76,592 KB
testcase_42 AC 501 ms
91,248 KB
testcase_43 AC 455 ms
89,888 KB
testcase_44 AC 571 ms
92,096 KB
testcase_45 AC 570 ms
93,292 KB
testcase_46 AC 572 ms
92,868 KB
testcase_47 AC 562 ms
93,612 KB
testcase_48 AC 568 ms
93,404 KB
testcase_49 AC 551 ms
90,664 KB
testcase_50 AC 557 ms
93,120 KB
testcase_51 AC 570 ms
92,408 KB
testcase_52 AC 567 ms
93,860 KB
testcase_53 AC 568 ms
93,912 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