結果

問題 No.2803 Bocching Star
ユーザー suzuishisuzuishi
提出日時 2024-07-12 21:15:22
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,319 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 46,080 KB
最終ジャッジ日時 2024-07-12 21:16:02
合計ジャッジ時間 28,490 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
12,288 KB
testcase_01 AC 77 ms
12,160 KB
testcase_02 AC 80 ms
12,160 KB
testcase_03 AC 180 ms
15,488 KB
testcase_04 AC 987 ms
36,352 KB
testcase_05 AC 554 ms
24,192 KB
testcase_06 AC 173 ms
13,824 KB
testcase_07 AC 381 ms
21,632 KB
testcase_08 AC 245 ms
16,896 KB
testcase_09 AC 1,113 ms
36,992 KB
testcase_10 AC 1,166 ms
38,272 KB
testcase_11 AC 1,096 ms
41,216 KB
testcase_12 AC 350 ms
20,864 KB
testcase_13 AC 916 ms
33,536 KB
testcase_14 AC 615 ms
26,240 KB
testcase_15 AC 1,067 ms
42,112 KB
testcase_16 AC 592 ms
28,032 KB
testcase_17 AC 230 ms
16,768 KB
testcase_18 AC 188 ms
14,848 KB
testcase_19 AC 961 ms
34,560 KB
testcase_20 AC 552 ms
25,728 KB
testcase_21 AC 497 ms
22,144 KB
testcase_22 AC 447 ms
23,168 KB
testcase_23 AC 1,171 ms
40,320 KB
testcase_24 AC 1,319 ms
46,080 KB
testcase_25 AC 1,289 ms
45,056 KB
testcase_26 AC 1,275 ms
45,312 KB
testcase_27 AC 1,189 ms
41,728 KB
testcase_28 AC 1,293 ms
44,032 KB
testcase_29 AC 1,181 ms
40,960 KB
testcase_30 AC 1,291 ms
45,440 KB
testcase_31 AC 1,168 ms
39,936 KB
testcase_32 AC 1,261 ms
46,080 KB
testcase_33 AC 91 ms
12,288 KB
testcase_34 AC 88 ms
12,288 KB
testcase_35 AC 85 ms
12,160 KB
testcase_36 AC 91 ms
12,288 KB
testcase_37 AC 89 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, s = gets.split.map &:to_i
pos = gets.split.map.with_index {|i, j| [i.to_i, j + 1]}.sort
pos.unshift [-Float::INFINITY, nil]
pos << [Float::INFINITY, nil]
ans = []
(1..n).each do |i|
  ans << pos[i][1] if pos[i][0] - pos[i - 1][0] > s && pos[i + 1][0] - pos[i][0] > s
end
puts ans.size
puts ans.sort * ' '
0