結果

問題 No.1110 好きな歌
ユーザー mkawa2mkawa2
提出日時 2020-07-10 21:37:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 712 ms / 5,000 ms
コード長 956 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 50,776 KB
最終ジャッジ日時 2024-04-19 16:14:19
合計ジャッジ時間 18,428 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
11,520 KB
testcase_01 AC 33 ms
11,392 KB
testcase_02 AC 31 ms
11,520 KB
testcase_03 AC 32 ms
11,520 KB
testcase_04 AC 31 ms
11,392 KB
testcase_05 AC 31 ms
11,520 KB
testcase_06 AC 32 ms
11,392 KB
testcase_07 AC 32 ms
11,392 KB
testcase_08 AC 32 ms
11,392 KB
testcase_09 AC 33 ms
11,392 KB
testcase_10 AC 32 ms
11,392 KB
testcase_11 AC 31 ms
11,392 KB
testcase_12 AC 32 ms
11,520 KB
testcase_13 AC 32 ms
11,392 KB
testcase_14 AC 33 ms
11,520 KB
testcase_15 AC 33 ms
11,520 KB
testcase_16 AC 33 ms
11,648 KB
testcase_17 AC 33 ms
11,648 KB
testcase_18 AC 33 ms
11,520 KB
testcase_19 AC 35 ms
11,520 KB
testcase_20 AC 33 ms
11,648 KB
testcase_21 AC 34 ms
11,520 KB
testcase_22 AC 35 ms
11,648 KB
testcase_23 AC 33 ms
11,392 KB
testcase_24 AC 390 ms
33,984 KB
testcase_25 AC 474 ms
38,656 KB
testcase_26 AC 231 ms
26,184 KB
testcase_27 AC 461 ms
38,252 KB
testcase_28 AC 263 ms
26,732 KB
testcase_29 AC 551 ms
43,620 KB
testcase_30 AC 236 ms
26,092 KB
testcase_31 AC 158 ms
20,964 KB
testcase_32 AC 619 ms
46,756 KB
testcase_33 AC 282 ms
28,300 KB
testcase_34 AC 421 ms
35,112 KB
testcase_35 AC 649 ms
47,012 KB
testcase_36 AC 80 ms
15,360 KB
testcase_37 AC 179 ms
22,216 KB
testcase_38 AC 564 ms
43,352 KB
testcase_39 AC 394 ms
35,036 KB
testcase_40 AC 491 ms
39,368 KB
testcase_41 AC 63 ms
13,696 KB
testcase_42 AC 581 ms
44,096 KB
testcase_43 AC 547 ms
43,040 KB
testcase_44 AC 652 ms
47,764 KB
testcase_45 AC 706 ms
49,416 KB
testcase_46 AC 677 ms
48,728 KB
testcase_47 AC 694 ms
50,448 KB
testcase_48 AC 676 ms
48,924 KB
testcase_49 AC 617 ms
46,424 KB
testcase_50 AC 669 ms
48,968 KB
testcase_51 AC 699 ms
48,148 KB
testcase_52 AC 687 ms
48,968 KB
testcase_53 AC 712 ms
50,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from operator import itemgetter
from itertools import *
from bisect import *
from collections import *
from heapq import *
from fractions import Fraction
import sys

sys.setrecursionlimit(10 ** 6)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

n,d=MI()
q=deque()
aj=[(II(),i) for i in range(n)]
aj.sort()
ans=[0]*n
for i,(a,j) in enumerate(aj):
    while q and q[0]<=a-d:q.popleft()
    ans[j]=i-len(q)
    q.append(a)
print(*ans,sep="\n")
0