結果

問題 No.1110 好きな歌
ユーザー qumazakiqumazaki
提出日時 2020-07-11 00:55:21
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 642 ms / 5,000 ms
コード長 385 bytes
コンパイル時間 528 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 119,716 KB
最終ジャッジ日時 2023-08-02 02:38:25
合計ジャッジ時間 18,648 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,320 KB
testcase_01 AC 65 ms
71,368 KB
testcase_02 AC 67 ms
71,308 KB
testcase_03 AC 67 ms
71,212 KB
testcase_04 AC 66 ms
71,256 KB
testcase_05 AC 65 ms
71,348 KB
testcase_06 AC 66 ms
71,212 KB
testcase_07 AC 66 ms
71,572 KB
testcase_08 AC 65 ms
71,344 KB
testcase_09 AC 65 ms
71,264 KB
testcase_10 AC 66 ms
71,260 KB
testcase_11 AC 68 ms
71,384 KB
testcase_12 AC 69 ms
71,416 KB
testcase_13 AC 67 ms
71,464 KB
testcase_14 AC 68 ms
71,248 KB
testcase_15 AC 66 ms
71,220 KB
testcase_16 AC 67 ms
71,464 KB
testcase_17 AC 67 ms
71,552 KB
testcase_18 AC 66 ms
71,340 KB
testcase_19 AC 69 ms
71,340 KB
testcase_20 AC 68 ms
71,256 KB
testcase_21 AC 65 ms
71,284 KB
testcase_22 AC 66 ms
71,476 KB
testcase_23 AC 67 ms
71,380 KB
testcase_24 AC 356 ms
98,508 KB
testcase_25 AC 428 ms
102,376 KB
testcase_26 AC 246 ms
89,436 KB
testcase_27 AC 413 ms
101,988 KB
testcase_28 AC 260 ms
91,564 KB
testcase_29 AC 484 ms
105,512 KB
testcase_30 AC 259 ms
91,368 KB
testcase_31 AC 180 ms
83,932 KB
testcase_32 AC 535 ms
109,972 KB
testcase_33 AC 287 ms
93,428 KB
testcase_34 AC 387 ms
98,928 KB
testcase_35 AC 579 ms
119,696 KB
testcase_36 AC 119 ms
79,300 KB
testcase_37 AC 196 ms
85,108 KB
testcase_38 AC 476 ms
105,444 KB
testcase_39 AC 369 ms
98,604 KB
testcase_40 AC 461 ms
105,636 KB
testcase_41 AC 100 ms
77,620 KB
testcase_42 AC 523 ms
109,516 KB
testcase_43 AC 474 ms
105,760 KB
testcase_44 AC 580 ms
119,716 KB
testcase_45 AC 588 ms
119,536 KB
testcase_46 AC 586 ms
119,404 KB
testcase_47 AC 582 ms
119,532 KB
testcase_48 AC 582 ms
119,592 KB
testcase_49 AC 569 ms
119,512 KB
testcase_50 AC 642 ms
119,664 KB
testcase_51 AC 580 ms
119,640 KB
testcase_52 AC 582 ms
119,360 KB
testcase_53 AC 589 ms
119,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n,d = map(int,readline().split())
a = [ (int(ai),i) for i,ai in enumerate(read().split())]
a.sort()

ans = [0] * n
left = 0
for right in range(n):
    while(a[left][0] + d <= a[right][0]):
        left += 1
    ans[ a[right][1] ] = left

print('\n'.join(map(str,ans)))
0