結果

問題 No.1110 好きな歌
ユーザー ああいいああいい
提出日時 2022-04-19 23:25:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 293 ms / 5,000 ms
コード長 356 bytes
コンパイル時間 465 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 82,304 KB
最終ジャッジ日時 2023-08-30 21:31:26
合計ジャッジ時間 13,379 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,388 KB
testcase_01 AC 75 ms
71,116 KB
testcase_02 AC 73 ms
70,964 KB
testcase_03 AC 74 ms
71,132 KB
testcase_04 AC 75 ms
71,264 KB
testcase_05 AC 73 ms
71,108 KB
testcase_06 AC 75 ms
71,108 KB
testcase_07 AC 74 ms
71,116 KB
testcase_08 AC 73 ms
71,276 KB
testcase_09 AC 74 ms
71,156 KB
testcase_10 AC 74 ms
71,168 KB
testcase_11 AC 75 ms
71,156 KB
testcase_12 AC 76 ms
71,380 KB
testcase_13 AC 73 ms
71,364 KB
testcase_14 AC 86 ms
75,700 KB
testcase_15 AC 78 ms
71,008 KB
testcase_16 AC 87 ms
75,864 KB
testcase_17 AC 94 ms
76,716 KB
testcase_18 AC 76 ms
71,112 KB
testcase_19 AC 91 ms
76,144 KB
testcase_20 AC 91 ms
76,020 KB
testcase_21 AC 86 ms
75,684 KB
testcase_22 AC 90 ms
76,000 KB
testcase_23 AC 80 ms
71,332 KB
testcase_24 AC 205 ms
79,784 KB
testcase_25 AC 228 ms
80,236 KB
testcase_26 AC 169 ms
79,336 KB
testcase_27 AC 237 ms
80,348 KB
testcase_28 AC 178 ms
79,432 KB
testcase_29 AC 256 ms
80,980 KB
testcase_30 AC 163 ms
79,388 KB
testcase_31 AC 153 ms
78,732 KB
testcase_32 AC 273 ms
81,160 KB
testcase_33 AC 166 ms
79,604 KB
testcase_34 AC 214 ms
80,760 KB
testcase_35 AC 238 ms
82,304 KB
testcase_36 AC 122 ms
77,704 KB
testcase_37 AC 158 ms
78,376 KB
testcase_38 AC 253 ms
81,244 KB
testcase_39 AC 216 ms
80,364 KB
testcase_40 AC 204 ms
80,696 KB
testcase_41 AC 119 ms
77,660 KB
testcase_42 AC 232 ms
81,864 KB
testcase_43 AC 261 ms
80,688 KB
testcase_44 AC 253 ms
81,968 KB
testcase_45 AC 284 ms
81,936 KB
testcase_46 AC 271 ms
82,264 KB
testcase_47 AC 289 ms
81,716 KB
testcase_48 AC 271 ms
81,952 KB
testcase_49 AC 220 ms
82,172 KB
testcase_50 AC 268 ms
81,488 KB
testcase_51 AC 261 ms
81,948 KB
testcase_52 AC 281 ms
81,940 KB
testcase_53 AC 293 ms
82,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D = map(int,input().split())
A = [int(input()) for _ in range(N)]
B = A.copy()
B.sort()
for a in A:
    x = a - D
    if B[0] > x:
        print(0)
        continue
    start = 0
    end = N
    while end - start > 1:
        mid = end + start >> 1
        if B[mid] <= x:
            start = mid
        else:
            end = mid
    print(start + 1)
0