結果

問題 No.1110 好きな歌
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2024-04-06 20:40:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 302 ms / 5,000 ms
コード長 526 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 81,528 KB
最終ジャッジ日時 2024-04-06 20:41:03
合計ジャッジ時間 13,537 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
55,736 KB
testcase_01 AC 47 ms
55,736 KB
testcase_02 AC 45 ms
55,736 KB
testcase_03 AC 45 ms
55,736 KB
testcase_04 AC 45 ms
55,736 KB
testcase_05 AC 45 ms
55,736 KB
testcase_06 AC 45 ms
55,736 KB
testcase_07 AC 45 ms
55,736 KB
testcase_08 AC 45 ms
55,736 KB
testcase_09 AC 46 ms
55,736 KB
testcase_10 AC 46 ms
55,736 KB
testcase_11 AC 46 ms
55,736 KB
testcase_12 AC 46 ms
55,736 KB
testcase_13 AC 46 ms
55,736 KB
testcase_14 AC 54 ms
63,380 KB
testcase_15 AC 49 ms
57,832 KB
testcase_16 AC 54 ms
63,412 KB
testcase_17 AC 57 ms
63,412 KB
testcase_18 AC 46 ms
55,736 KB
testcase_19 AC 54 ms
63,360 KB
testcase_20 AC 57 ms
65,472 KB
testcase_21 AC 53 ms
63,412 KB
testcase_22 AC 57 ms
63,412 KB
testcase_23 AC 47 ms
57,832 KB
testcase_24 AC 180 ms
78,968 KB
testcase_25 AC 197 ms
79,736 KB
testcase_26 AC 147 ms
78,456 KB
testcase_27 AC 205 ms
79,480 KB
testcase_28 AC 141 ms
78,712 KB
testcase_29 AC 234 ms
80,120 KB
testcase_30 AC 124 ms
78,712 KB
testcase_31 AC 119 ms
77,560 KB
testcase_32 AC 245 ms
80,504 KB
testcase_33 AC 121 ms
78,052 KB
testcase_34 AC 167 ms
79,480 KB
testcase_35 AC 183 ms
81,528 KB
testcase_36 AC 86 ms
77,068 KB
testcase_37 AC 130 ms
77,816 KB
testcase_38 AC 243 ms
81,016 KB
testcase_39 AC 198 ms
79,352 KB
testcase_40 AC 157 ms
80,248 KB
testcase_41 AC 96 ms
76,904 KB
testcase_42 AC 191 ms
80,504 KB
testcase_43 AC 227 ms
80,120 KB
testcase_44 AC 207 ms
81,144 KB
testcase_45 AC 251 ms
81,016 KB
testcase_46 AC 240 ms
81,272 KB
testcase_47 AC 273 ms
81,016 KB
testcase_48 AC 244 ms
81,016 KB
testcase_49 AC 169 ms
81,400 KB
testcase_50 AC 243 ms
80,888 KB
testcase_51 AC 220 ms
81,144 KB
testcase_52 AC 249 ms
81,016 KB
testcase_53 AC 302 ms
81,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline




N,D = map(int,input().split())
A = [int(input()) for _ in range(N)]

def cle(a,D):
    
    y = len(D)-1
    x = 0
    if D[x]>a:
        return 0
        
    if D[y]<=a:
        return y+1
    
    while y-x>1:
        mid = (y+x)//2
        if D[mid]<=a:
            x = mid
        else:
            y = mid
    return y




B = A[:]
B.sort()
for a in A:
    print(cle(a-D,B))
    
0