結果

問題 No.1110 好きな歌
ユーザー gemmarogemmaro
提出日時 2020-07-11 09:19:27
言語 Ruby
(3.2.2)
結果
AC  
実行時間 668 ms / 5,000 ms
コード長 186 bytes
コンパイル時間 545 ms
コンパイル使用メモリ 11,340 KB
実行使用メモリ 20,260 KB
最終ジャッジ日時 2023-08-02 18:38:46
合計ジャッジ時間 25,383 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,300 KB
testcase_01 AC 81 ms
15,096 KB
testcase_02 AC 80 ms
15,332 KB
testcase_03 AC 82 ms
15,232 KB
testcase_04 AC 82 ms
15,036 KB
testcase_05 AC 82 ms
15,040 KB
testcase_06 AC 81 ms
15,136 KB
testcase_07 AC 82 ms
15,288 KB
testcase_08 AC 81 ms
15,380 KB
testcase_09 AC 81 ms
15,148 KB
testcase_10 AC 83 ms
15,040 KB
testcase_11 AC 83 ms
15,100 KB
testcase_12 AC 82 ms
15,144 KB
testcase_13 AC 82 ms
15,096 KB
testcase_14 AC 83 ms
15,056 KB
testcase_15 AC 83 ms
15,120 KB
testcase_16 AC 84 ms
15,228 KB
testcase_17 AC 84 ms
15,148 KB
testcase_18 AC 82 ms
15,316 KB
testcase_19 AC 85 ms
15,260 KB
testcase_20 AC 85 ms
15,024 KB
testcase_21 AC 84 ms
15,284 KB
testcase_22 AC 85 ms
15,184 KB
testcase_23 AC 84 ms
15,124 KB
testcase_24 AC 412 ms
18,448 KB
testcase_25 AC 497 ms
18,728 KB
testcase_26 AC 291 ms
17,100 KB
testcase_27 AC 488 ms
18,752 KB
testcase_28 AC 311 ms
17,360 KB
testcase_29 AC 559 ms
19,204 KB
testcase_30 AC 298 ms
17,360 KB
testcase_31 AC 213 ms
16,464 KB
testcase_32 AC 607 ms
19,444 KB
testcase_33 AC 331 ms
17,444 KB
testcase_34 AC 432 ms
18,240 KB
testcase_35 AC 622 ms
20,232 KB
testcase_36 AC 136 ms
15,728 KB
testcase_37 AC 229 ms
16,368 KB
testcase_38 AC 547 ms
19,040 KB
testcase_39 AC 431 ms
18,304 KB
testcase_40 AC 509 ms
19,172 KB
testcase_41 AC 114 ms
15,620 KB
testcase_42 AC 577 ms
19,592 KB
testcase_43 AC 560 ms
19,112 KB
testcase_44 AC 643 ms
20,224 KB
testcase_45 AC 651 ms
20,260 KB
testcase_46 AC 645 ms
20,004 KB
testcase_47 AC 663 ms
20,116 KB
testcase_48 AC 645 ms
20,176 KB
testcase_49 AC 612 ms
20,164 KB
testcase_50 AC 651 ms
20,260 KB
testcase_51 AC 634 ms
20,128 KB
testcase_52 AC 653 ms
20,076 KB
testcase_53 AC 668 ms
20,036 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

def solve
  s = A.sort
  A.map do |a|
    s.bsearch_index { a - _1 < D }
  end
end

N, D = gets.split.map(&:to_i)
A = N.times.map { gets.to_i }

puts solve
0