結果

問題 No.1110 好きな歌
ユーザー O2MTO2MT
提出日時 2020-08-15 02:57:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,295 ms / 5,000 ms
コード長 338 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 37,268 KB
最終ジャッジ日時 2024-04-18 23:33:11
合計ジャッジ時間 29,880 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,752 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 29 ms
10,752 KB
testcase_05 AC 28 ms
10,752 KB
testcase_06 AC 29 ms
10,752 KB
testcase_07 AC 29 ms
10,752 KB
testcase_08 AC 29 ms
10,752 KB
testcase_09 AC 29 ms
10,752 KB
testcase_10 AC 30 ms
10,752 KB
testcase_11 AC 29 ms
10,752 KB
testcase_12 AC 28 ms
10,752 KB
testcase_13 AC 30 ms
10,752 KB
testcase_14 AC 31 ms
10,880 KB
testcase_15 AC 30 ms
10,752 KB
testcase_16 AC 31 ms
10,752 KB
testcase_17 AC 34 ms
11,008 KB
testcase_18 AC 30 ms
10,752 KB
testcase_19 AC 33 ms
10,880 KB
testcase_20 AC 32 ms
11,008 KB
testcase_21 AC 31 ms
10,880 KB
testcase_22 AC 32 ms
10,880 KB
testcase_23 AC 30 ms
10,880 KB
testcase_24 AC 692 ms
24,424 KB
testcase_25 AC 852 ms
26,024 KB
testcase_26 AC 419 ms
19,372 KB
testcase_27 AC 786 ms
26,264 KB
testcase_28 AC 474 ms
18,804 KB
testcase_29 AC 958 ms
29,260 KB
testcase_30 AC 451 ms
18,164 KB
testcase_31 AC 307 ms
16,752 KB
testcase_32 AC 1,062 ms
35,096 KB
testcase_33 AC 535 ms
21,980 KB
testcase_34 AC 711 ms
24,236 KB
testcase_35 AC 1,097 ms
33,180 KB
testcase_36 AC 133 ms
12,628 KB
testcase_37 AC 319 ms
17,688 KB
testcase_38 AC 945 ms
29,236 KB
testcase_39 AC 689 ms
25,464 KB
testcase_40 AC 879 ms
24,732 KB
testcase_41 AC 88 ms
12,288 KB
testcase_42 AC 1,026 ms
33,068 KB
testcase_43 AC 940 ms
28,604 KB
testcase_44 AC 1,221 ms
33,560 KB
testcase_45 AC 1,162 ms
35,612 KB
testcase_46 AC 1,194 ms
34,712 KB
testcase_47 AC 1,189 ms
37,268 KB
testcase_48 AC 1,295 ms
35,220 KB
testcase_49 AC 1,185 ms
33,256 KB
testcase_50 AC 1,218 ms
35,220 KB
testcase_51 AC 1,152 ms
34,068 KB
testcase_52 AC 1,154 ms
35,348 KB
testcase_53 AC 1,183 ms
37,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D = map(int,input().split())
A = {}
l = [0]*N

for i in range(N):
  a = int(input())
  A.update({a:0})
  l[i] = a

ls = sorted(l)
count,k = 0,N-1
for i in range(N-1,-1,-1):
  count = 0
  for j in range(k,-1,-1):
    if ls[i] - ls[j] >= D:
      k = j
      count = j+1
      break
  A[ls[i]] = count

for i in range(N):
  print(A[l[i]])
0