結果

問題 No.1110 好きな歌
ユーザー flippergoflippergo
提出日時 2020-12-24 15:24:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 332 ms / 5,000 ms
コード長 420 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 81,808 KB
実行使用メモリ 95,624 KB
最終ジャッジ日時 2023-10-21 15:42:05
合計ジャッジ時間 14,990 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
53,464 KB
testcase_01 AC 29 ms
53,464 KB
testcase_02 AC 29 ms
53,464 KB
testcase_03 AC 29 ms
53,464 KB
testcase_04 AC 29 ms
53,464 KB
testcase_05 AC 29 ms
53,464 KB
testcase_06 AC 29 ms
53,464 KB
testcase_07 AC 32 ms
53,464 KB
testcase_08 AC 32 ms
53,464 KB
testcase_09 AC 32 ms
53,464 KB
testcase_10 AC 30 ms
53,464 KB
testcase_11 AC 29 ms
53,464 KB
testcase_12 AC 29 ms
53,464 KB
testcase_13 AC 29 ms
53,464 KB
testcase_14 AC 37 ms
61,076 KB
testcase_15 AC 34 ms
55,512 KB
testcase_16 AC 38 ms
61,076 KB
testcase_17 AC 42 ms
63,124 KB
testcase_18 AC 31 ms
53,464 KB
testcase_19 AC 46 ms
63,916 KB
testcase_20 AC 42 ms
63,124 KB
testcase_21 AC 35 ms
55,512 KB
testcase_22 AC 40 ms
61,076 KB
testcase_23 AC 32 ms
53,464 KB
testcase_24 AC 209 ms
83,100 KB
testcase_25 AC 267 ms
88,760 KB
testcase_26 AC 159 ms
81,252 KB
testcase_27 AC 268 ms
90,216 KB
testcase_28 AC 167 ms
81,252 KB
testcase_29 AC 275 ms
86,532 KB
testcase_30 AC 167 ms
81,252 KB
testcase_31 AC 127 ms
79,224 KB
testcase_32 AC 328 ms
91,656 KB
testcase_33 AC 199 ms
86,768 KB
testcase_34 AC 228 ms
83,888 KB
testcase_35 AC 323 ms
88,908 KB
testcase_36 AC 91 ms
76,828 KB
testcase_37 AC 136 ms
81,940 KB
testcase_38 AC 276 ms
86,528 KB
testcase_39 AC 215 ms
83,624 KB
testcase_40 AC 270 ms
86,004 KB
testcase_41 AC 80 ms
76,896 KB
testcase_42 AC 325 ms
95,624 KB
testcase_43 AC 270 ms
86,004 KB
testcase_44 AC 323 ms
88,644 KB
testcase_45 AC 320 ms
88,380 KB
testcase_46 AC 324 ms
88,908 KB
testcase_47 AC 324 ms
88,380 KB
testcase_48 AC 323 ms
88,644 KB
testcase_49 AC 315 ms
88,908 KB
testcase_50 AC 324 ms
88,644 KB
testcase_51 AC 324 ms
88,380 KB
testcase_52 AC 330 ms
88,908 KB
testcase_53 AC 332 ms
88,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D = map(int,input().split())
A = [int(input()) for _ in range(N)]
A = [(A[i],i) for i in range(N)]
A = sorted(A,key=lambda x:x[0],reverse=True)
B = [0 for _ in range(N)]
i = 0
j = i+1
while i<N:
    a = A[i][0]
    flag = 0
    while j<N:
        b = A[j][0]
        if a-b>=D:
            flag = 1
            break
        j += 1
    if flag==1:
        B[A[i][1]] = N-j
    i += 1
for i in range(N):
    print(B[i])
0