結果

問題 No.219 巨大数の概算
ユーザー tshigtshig
提出日時 2016-08-18 13:41:03
言語 Ruby
(3.3.0)
結果
AC  
実行時間 144 ms / 1,500 ms
コード長 415 bytes
コンパイル時間 565 ms
コンパイル使用メモリ 11,196 KB
実行使用メモリ 20,080 KB
最終ジャッジ日時 2023-09-25 15:31:07
合計ジャッジ時間 10,810 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
19,976 KB
testcase_01 AC 138 ms
19,876 KB
testcase_02 AC 138 ms
20,028 KB
testcase_03 AC 136 ms
19,812 KB
testcase_04 AC 137 ms
19,536 KB
testcase_05 AC 80 ms
15,608 KB
testcase_06 AC 86 ms
15,652 KB
testcase_07 AC 81 ms
15,332 KB
testcase_08 AC 85 ms
15,888 KB
testcase_09 AC 80 ms
15,444 KB
testcase_10 AC 138 ms
19,808 KB
testcase_11 AC 136 ms
19,768 KB
testcase_12 AC 137 ms
19,800 KB
testcase_13 AC 139 ms
19,972 KB
testcase_14 AC 138 ms
19,880 KB
testcase_15 AC 139 ms
19,752 KB
testcase_16 AC 137 ms
19,864 KB
testcase_17 AC 137 ms
19,748 KB
testcase_18 AC 138 ms
19,792 KB
testcase_19 AC 137 ms
19,856 KB
testcase_20 AC 139 ms
19,748 KB
testcase_21 AC 139 ms
19,872 KB
testcase_22 AC 138 ms
20,036 KB
testcase_23 AC 138 ms
19,968 KB
testcase_24 AC 141 ms
19,972 KB
testcase_25 AC 140 ms
19,984 KB
testcase_26 AC 139 ms
20,020 KB
testcase_27 AC 138 ms
19,844 KB
testcase_28 AC 140 ms
19,832 KB
testcase_29 AC 141 ms
19,996 KB
testcase_30 AC 137 ms
19,872 KB
testcase_31 AC 143 ms
20,036 KB
testcase_32 AC 142 ms
19,924 KB
testcase_33 AC 141 ms
19,756 KB
testcase_34 AC 140 ms
20,036 KB
testcase_35 AC 140 ms
19,832 KB
testcase_36 AC 139 ms
20,080 KB
testcase_37 AC 138 ms
20,016 KB
testcase_38 AC 142 ms
19,872 KB
testcase_39 AC 142 ms
19,948 KB
testcase_40 AC 138 ms
20,024 KB
testcase_41 AC 142 ms
19,752 KB
testcase_42 AC 139 ms
19,820 KB
testcase_43 AC 140 ms
19,836 KB
testcase_44 AC 140 ms
19,804 KB
testcase_45 AC 141 ms
20,000 KB
testcase_46 AC 138 ms
19,948 KB
testcase_47 AC 137 ms
19,724 KB
testcase_48 AC 139 ms
20,036 KB
testcase_49 AC 138 ms
19,952 KB
testcase_50 AC 138 ms
20,076 KB
testcase_51 AC 81 ms
15,496 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class Calc0219
  def initialize(args)
    args = args.map { |l| l.chomp.split(/\s+/) }
    @n = args.shift.first.to_i
    @ps = args.map { |l| l.map(&:to_i) }
  end

  def run
    @ps.map { |a, b|
      c = b * Math.log10(a)
      z = c.floor
      w = 10 ** (c - z)
      x = w.floor
      y = ((w - x) * 10).to_i
      [x, y, z].join(' ')
    }
  end
end

puts Calc0219.new(STDIN.readlines).run if __FILE__ == $0
0