結果

問題 No.1280 Beyond C
ユーザー tamura2004tamura2004
提出日時 2021-01-22 20:14:20
言語 Ruby
(3.3.0)
結果
AC  
実行時間 214 ms / 2,000 ms
コード長 264 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 11,280 KB
実行使用メモリ 30,980 KB
最終ジャッジ日時 2023-08-27 15:53:40
合計ジャッジ時間 5,346 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,048 KB
testcase_01 AC 80 ms
15,276 KB
testcase_02 AC 82 ms
15,332 KB
testcase_03 AC 80 ms
15,084 KB
testcase_04 AC 81 ms
15,172 KB
testcase_05 AC 80 ms
15,084 KB
testcase_06 AC 81 ms
15,048 KB
testcase_07 AC 84 ms
15,280 KB
testcase_08 AC 80 ms
15,272 KB
testcase_09 AC 81 ms
15,220 KB
testcase_10 AC 82 ms
15,328 KB
testcase_11 AC 83 ms
15,252 KB
testcase_12 AC 81 ms
15,252 KB
testcase_13 AC 83 ms
15,264 KB
testcase_14 AC 84 ms
15,268 KB
testcase_15 AC 149 ms
23,248 KB
testcase_16 AC 136 ms
21,632 KB
testcase_17 AC 147 ms
23,420 KB
testcase_18 AC 190 ms
30,980 KB
testcase_19 AC 189 ms
30,900 KB
testcase_20 AC 214 ms
30,524 KB
testcase_21 AC 211 ms
30,668 KB
testcase_22 AC 210 ms
30,660 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, m, c = gets.to_s.split.map { |v| v.to_i }
a = gets.to_s.split.map { |v| v.to_i }.sort.reverse
b = gets.to_s.split.map { |v| v.to_i }.sort

cnt = 0
j = 0
n.times do |i|
  while j < m && a[i] * b[j] <= c
    j += 1
  end
  cnt += m - j
end

puts cnt.to_f / n / m
0