結果

問題 No.751 Frac #2
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2018-11-27 22:11:32
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 277 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 11,148 KB
実行使用メモリ 15,300 KB
最終ジャッジ日時 2023-09-06 15:43:54
合計ジャッジ時間 4,892 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,104 KB
testcase_01 AC 78 ms
15,152 KB
testcase_02 AC 78 ms
15,188 KB
testcase_03 AC 77 ms
15,124 KB
testcase_04 RE -
testcase_05 AC 78 ms
15,032 KB
testcase_06 AC 79 ms
15,028 KB
testcase_07 RE -
testcase_08 AC 76 ms
15,120 KB
testcase_09 RE -
testcase_10 AC 78 ms
15,048 KB
testcase_11 AC 77 ms
15,152 KB
testcase_12 RE -
testcase_13 AC 78 ms
15,276 KB
testcase_14 AC 78 ms
15,164 KB
testcase_15 AC 77 ms
15,148 KB
testcase_16 RE -
testcase_17 AC 78 ms
15,152 KB
testcase_18 AC 80 ms
15,128 KB
testcase_19 RE -
testcase_20 AC 80 ms
15,028 KB
testcase_21 AC 79 ms
15,096 KB
testcase_22 AC 80 ms
15,140 KB
testcase_23 AC 81 ms
15,152 KB
testcase_24 AC 81 ms
15,024 KB
testcase_25 AC 78 ms
15,144 KB
testcase_26 AC 81 ms
15,112 KB
testcase_27 RE -
testcase_28 AC 79 ms
15,240 KB
testcase_29 AC 78 ms
15,172 KB
testcase_30 AC 79 ms
15,048 KB
testcase_31 RE -
testcase_32 AC 79 ms
15,028 KB
testcase_33 AC 80 ms
15,140 KB
testcase_34 AC 79 ms
15,084 KB
testcase_35 AC 80 ms
15,076 KB
testcase_36 AC 78 ms
15,064 KB
testcase_37 AC 80 ms
15,236 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets
a = gets.split.map(&:to_i)
gets
b = gets.split.map(&:to_i)
b_numerator, b_denominator = b.partition.with_index { |_, i|
  i.odd?
}.map { |ary| ary.inject(:*) }

answer = a[0].quo(a[1..-1].inject(:*)) * (b_numerator.quo(b_denominator))
puts answer.to_s.split('/').join(' ')
0