結果

問題 No.1110 好きな歌
ユーザー kimiyukikimiyuki
提出日時 2020-07-10 21:45:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 739 ms / 5,000 ms
コード長 598 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 29,652 KB
最終ジャッジ日時 2024-04-19 16:36:41
合計ジャッジ時間 18,958 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
11,520 KB
testcase_01 AC 32 ms
11,776 KB
testcase_02 AC 32 ms
11,648 KB
testcase_03 AC 32 ms
11,648 KB
testcase_04 AC 34 ms
11,648 KB
testcase_05 AC 33 ms
11,520 KB
testcase_06 AC 34 ms
11,648 KB
testcase_07 AC 34 ms
11,648 KB
testcase_08 AC 34 ms
11,520 KB
testcase_09 AC 33 ms
11,776 KB
testcase_10 AC 35 ms
11,648 KB
testcase_11 AC 33 ms
11,648 KB
testcase_12 AC 33 ms
11,648 KB
testcase_13 AC 34 ms
11,520 KB
testcase_14 AC 36 ms
11,520 KB
testcase_15 AC 35 ms
11,648 KB
testcase_16 AC 35 ms
11,648 KB
testcase_17 AC 36 ms
11,648 KB
testcase_18 AC 34 ms
11,520 KB
testcase_19 AC 36 ms
11,520 KB
testcase_20 AC 35 ms
11,520 KB
testcase_21 AC 35 ms
11,648 KB
testcase_22 AC 36 ms
11,776 KB
testcase_23 AC 35 ms
11,648 KB
testcase_24 AC 424 ms
21,000 KB
testcase_25 AC 496 ms
23,344 KB
testcase_26 AC 276 ms
18,284 KB
testcase_27 AC 495 ms
22,484 KB
testcase_28 AC 300 ms
17,920 KB
testcase_29 AC 599 ms
26,504 KB
testcase_30 AC 290 ms
17,024 KB
testcase_31 AC 196 ms
15,232 KB
testcase_32 AC 659 ms
27,388 KB
testcase_33 AC 321 ms
17,496 KB
testcase_34 AC 430 ms
21,012 KB
testcase_35 AC 677 ms
24,636 KB
testcase_36 AC 99 ms
12,928 KB
testcase_37 AC 217 ms
16,108 KB
testcase_38 AC 604 ms
26,260 KB
testcase_39 AC 439 ms
22,604 KB
testcase_40 AC 531 ms
21,988 KB
testcase_41 AC 73 ms
12,672 KB
testcase_42 AC 632 ms
24,280 KB
testcase_43 AC 574 ms
25,928 KB
testcase_44 AC 688 ms
24,724 KB
testcase_45 AC 715 ms
28,036 KB
testcase_46 AC 704 ms
27,096 KB
testcase_47 AC 739 ms
29,576 KB
testcase_48 AC 694 ms
26,388 KB
testcase_49 AC 650 ms
23,636 KB
testcase_50 AC 694 ms
27,532 KB
testcase_51 AC 697 ms
25,232 KB
testcase_52 AC 702 ms
27,656 KB
testcase_53 AC 726 ms
29,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
from typing import *
import bisect

def solve(n: int, d: int, a: List[int]) -> List[str]:
    sorted_a = sorted(a)
    ans = []
    for a_i in a:
        ans.append(bisect.bisect_right(sorted_a, a_i - d))
    return ans

# generated by online-judge-template-generator v4.4.0 (https://github.com/kmyk/online-judge-template-generator)
def main():
    N, D = map(int, input().split())
    A = [None for _ in range(N)]
    for i in range(N):
        A[i] = int(input())
    ans = solve(N, D, A)
    for i in range(N):
        print(ans[i])

if __name__ == '__main__':
    main()
0