結果

問題 No.1110 好きな歌
ユーザー 👑 rin204rin204
提出日時 2020-08-13 07:39:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,530 ms / 5,000 ms
コード長 333 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 53,844 KB
最終ジャッジ日時 2024-04-18 01:16:19
合計ジャッジ時間 51,868 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,624 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 AC 25 ms
10,752 KB
testcase_03 AC 24 ms
10,752 KB
testcase_04 AC 24 ms
10,624 KB
testcase_05 AC 25 ms
10,880 KB
testcase_06 AC 24 ms
10,624 KB
testcase_07 AC 25 ms
10,752 KB
testcase_08 AC 24 ms
10,752 KB
testcase_09 AC 24 ms
10,624 KB
testcase_10 AC 25 ms
10,624 KB
testcase_11 AC 24 ms
10,752 KB
testcase_12 AC 24 ms
10,624 KB
testcase_13 AC 23 ms
10,624 KB
testcase_14 AC 31 ms
10,624 KB
testcase_15 AC 27 ms
10,752 KB
testcase_16 AC 27 ms
10,624 KB
testcase_17 AC 29 ms
11,008 KB
testcase_18 AC 24 ms
10,752 KB
testcase_19 AC 31 ms
10,880 KB
testcase_20 AC 29 ms
10,880 KB
testcase_21 AC 27 ms
10,624 KB
testcase_22 AC 28 ms
10,752 KB
testcase_23 AC 26 ms
10,624 KB
testcase_24 AC 1,309 ms
35,392 KB
testcase_25 AC 1,541 ms
40,340 KB
testcase_26 AC 750 ms
26,660 KB
testcase_27 AC 1,508 ms
40,168 KB
testcase_28 AC 862 ms
27,076 KB
testcase_29 AC 1,890 ms
45,992 KB
testcase_30 AC 850 ms
26,304 KB
testcase_31 AC 488 ms
21,064 KB
testcase_32 AC 2,068 ms
49,316 KB
testcase_33 AC 1,020 ms
28,468 KB
testcase_34 AC 1,318 ms
36,232 KB
testcase_35 AC 2,152 ms
49,048 KB
testcase_36 AC 201 ms
14,976 KB
testcase_37 AC 582 ms
22,652 KB
testcase_38 AC 1,767 ms
45,960 KB
testcase_39 AC 1,357 ms
36,996 KB
testcase_40 AC 1,670 ms
40,624 KB
testcase_41 AC 123 ms
13,056 KB
testcase_42 AC 1,970 ms
45,840 KB
testcase_43 AC 1,795 ms
45,284 KB
testcase_44 AC 2,235 ms
48,916 KB
testcase_45 AC 2,342 ms
51,092 KB
testcase_46 AC 2,482 ms
51,288 KB
testcase_47 AC 2,530 ms
52,756 KB
testcase_48 AC 2,246 ms
50,708 KB
testcase_49 AC 2,034 ms
47,952 KB
testcase_50 AC 2,344 ms
51,532 KB
testcase_51 AC 2,364 ms
49,680 KB
testcase_52 AC 2,216 ms
51,540 KB
testcase_53 AC 2,328 ms
53,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d = map(int, input().split())
alst = [[int(input()), i] for i in range(n)]
alst.sort()
ans = [0 for _ in range(n)]

for a, i in alst:
    l = 0
    r = n
    while r != l:
        pos = (r + l) // 2
        if a - d >= alst[pos][0]:
            l = pos + 1
        else:
            r = pos
    ans[i] = l

print(*ans, sep = "\n")
0