結果

問題 No.1110 好きな歌
ユーザー gemmarogemmaro
提出日時 2020-07-11 09:19:27
言語 Ruby
(3.3.0)
結果
AC  
実行時間 656 ms / 5,000 ms
コード長 186 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-04-20 18:49:00
合計ジャッジ時間 20,487 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
12,032 KB
testcase_01 AC 80 ms
12,032 KB
testcase_02 AC 79 ms
12,288 KB
testcase_03 AC 80 ms
12,288 KB
testcase_04 AC 80 ms
12,288 KB
testcase_05 AC 78 ms
12,288 KB
testcase_06 AC 78 ms
12,288 KB
testcase_07 AC 79 ms
12,032 KB
testcase_08 AC 78 ms
12,288 KB
testcase_09 AC 77 ms
12,032 KB
testcase_10 AC 79 ms
12,288 KB
testcase_11 AC 79 ms
12,160 KB
testcase_12 AC 77 ms
12,032 KB
testcase_13 AC 76 ms
12,032 KB
testcase_14 AC 78 ms
12,032 KB
testcase_15 AC 77 ms
12,288 KB
testcase_16 AC 78 ms
12,032 KB
testcase_17 AC 82 ms
12,032 KB
testcase_18 AC 76 ms
12,288 KB
testcase_19 AC 78 ms
12,160 KB
testcase_20 AC 80 ms
12,032 KB
testcase_21 AC 77 ms
12,288 KB
testcase_22 AC 80 ms
12,160 KB
testcase_23 AC 82 ms
12,288 KB
testcase_24 AC 396 ms
14,976 KB
testcase_25 AC 463 ms
15,488 KB
testcase_26 AC 274 ms
13,952 KB
testcase_27 AC 464 ms
15,616 KB
testcase_28 AC 293 ms
14,080 KB
testcase_29 AC 531 ms
17,152 KB
testcase_30 AC 294 ms
13,952 KB
testcase_31 AC 205 ms
13,312 KB
testcase_32 AC 640 ms
17,280 KB
testcase_33 AC 325 ms
14,336 KB
testcase_34 AC 403 ms
15,104 KB
testcase_35 AC 608 ms
17,664 KB
testcase_36 AC 132 ms
12,800 KB
testcase_37 AC 221 ms
13,568 KB
testcase_38 AC 527 ms
16,896 KB
testcase_39 AC 411 ms
14,848 KB
testcase_40 AC 504 ms
16,896 KB
testcase_41 AC 109 ms
12,288 KB
testcase_42 AC 576 ms
17,280 KB
testcase_43 AC 539 ms
17,152 KB
testcase_44 AC 622 ms
17,664 KB
testcase_45 AC 627 ms
17,664 KB
testcase_46 AC 626 ms
17,664 KB
testcase_47 AC 642 ms
17,792 KB
testcase_48 AC 656 ms
17,920 KB
testcase_49 AC 619 ms
17,920 KB
testcase_50 AC 629 ms
17,664 KB
testcase_51 AC 625 ms
17,792 KB
testcase_52 AC 626 ms
17,920 KB
testcase_53 AC 655 ms
17,792 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