結果

問題 No.1110 好きな歌
ユーザー 小野寺健小野寺健
提出日時 2021-11-03 16:41:38
言語 Ruby
(3.3.0)
結果
AC  
実行時間 819 ms / 5,000 ms
コード長 175 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 19,328 KB
最終ジャッジ日時 2024-04-21 08:02:15
合計ジャッジ時間 23,568 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
12,288 KB
testcase_01 AC 98 ms
12,032 KB
testcase_02 AC 93 ms
12,288 KB
testcase_03 AC 92 ms
12,288 KB
testcase_04 AC 94 ms
12,160 KB
testcase_05 AC 91 ms
12,416 KB
testcase_06 AC 95 ms
12,032 KB
testcase_07 AC 92 ms
12,160 KB
testcase_08 AC 95 ms
12,288 KB
testcase_09 AC 93 ms
12,288 KB
testcase_10 AC 93 ms
12,032 KB
testcase_11 AC 94 ms
12,160 KB
testcase_12 AC 92 ms
12,160 KB
testcase_13 AC 93 ms
12,160 KB
testcase_14 AC 94 ms
12,288 KB
testcase_15 AC 92 ms
12,032 KB
testcase_16 AC 93 ms
12,288 KB
testcase_17 AC 93 ms
12,288 KB
testcase_18 AC 90 ms
12,288 KB
testcase_19 AC 95 ms
12,032 KB
testcase_20 AC 95 ms
12,160 KB
testcase_21 AC 96 ms
12,288 KB
testcase_22 AC 94 ms
12,160 KB
testcase_23 AC 91 ms
12,032 KB
testcase_24 AC 480 ms
14,976 KB
testcase_25 AC 585 ms
16,512 KB
testcase_26 AC 336 ms
13,952 KB
testcase_27 AC 571 ms
16,512 KB
testcase_28 AC 359 ms
14,208 KB
testcase_29 AC 679 ms
17,024 KB
testcase_30 AC 346 ms
14,208 KB
testcase_31 AC 246 ms
13,568 KB
testcase_32 AC 726 ms
17,408 KB
testcase_33 AC 385 ms
14,336 KB
testcase_34 AC 502 ms
16,256 KB
testcase_35 AC 711 ms
19,328 KB
testcase_36 AC 145 ms
12,672 KB
testcase_37 AC 257 ms
13,568 KB
testcase_38 AC 624 ms
16,768 KB
testcase_39 AC 479 ms
15,104 KB
testcase_40 AC 578 ms
16,768 KB
testcase_41 AC 115 ms
12,544 KB
testcase_42 AC 620 ms
17,280 KB
testcase_43 AC 585 ms
16,768 KB
testcase_44 AC 692 ms
19,200 KB
testcase_45 AC 771 ms
19,072 KB
testcase_46 AC 768 ms
19,200 KB
testcase_47 AC 800 ms
19,200 KB
testcase_48 AC 787 ms
19,200 KB
testcase_49 AC 793 ms
19,200 KB
testcase_50 AC 770 ms
19,328 KB
testcase_51 AC 750 ms
19,200 KB
testcase_52 AC 776 ms
19,328 KB
testcase_53 AC 819 ms
19,200 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, D = gets.split(" ").map{|s| s.to_i}

a = []
0.upto(N-1) {|i|
	a << gets.to_i	
}

b = a.sort_by{|x| x}

a.each {|x, i|
	j = b.bsearch_index {|z| z > x - D}
	puts j ? j : 0
}
0