結果

問題 No.668 6.0*10^23
ユーザー simansiman
提出日時 2021-10-26 21:53:48
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 24,064 KB
最終ジャッジ日時 2024-04-15 21:35:51
合計ジャッジ時間 8,602 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
12,288 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 126 ms
15,360 KB
testcase_04 AC 130 ms
15,104 KB
testcase_05 WA -
testcase_06 AC 131 ms
15,104 KB
testcase_07 AC 92 ms
12,160 KB
testcase_08 WA -
testcase_09 AC 92 ms
12,160 KB
testcase_10 AC 123 ms
14,976 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 170 ms
23,424 KB
testcase_14 WA -
testcase_15 AC 103 ms
12,416 KB
testcase_16 AC 111 ms
14,336 KB
testcase_17 WA -
testcase_18 AC 133 ms
15,360 KB
testcase_19 AC 108 ms
14,080 KB
testcase_20 AC 135 ms
15,704 KB
testcase_21 AC 137 ms
15,700 KB
testcase_22 AC 171 ms
23,040 KB
testcase_23 AC 147 ms
19,456 KB
testcase_24 AC 107 ms
13,440 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 138 ms
15,568 KB
testcase_32 WA -
testcase_33 AC 161 ms
21,248 KB
testcase_34 AC 122 ms
15,232 KB
testcase_35 AC 112 ms
15,104 KB
testcase_36 AC 148 ms
20,096 KB
testcase_37 AC 173 ms
23,808 KB
testcase_38 WA -
testcase_39 AC 149 ms
19,200 KB
testcase_40 AC 173 ms
23,168 KB
testcase_41 AC 156 ms
20,992 KB
testcase_42 WA -
testcase_43 AC 162 ms
22,272 KB
testcase_44 AC 177 ms
23,808 KB
testcase_45 AC 92 ms
12,032 KB
testcase_46 AC 91 ms
12,160 KB
testcase_47 AC 90 ms
12,288 KB
testcase_48 AC 90 ms
12,288 KB
testcase_49 AC 89 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.chomp
L = N.size
A = N.chars.map(&:to_i)
B = N.chars.map(&:to_i)

(L - 1).downto(1) do |i|
  if B[i] >= 5
    A[i - 1] += 1
    A[i] = 0
  elsif A[i] >= 10
    A[i - 1] += 1
    A[i] -= 10
  end
end

a = b = c = 0

if A[0] >= 10
  a = 1
  b = A[0] % 10
  c = A.size
else
  a = A[0]
  b = A[1]
  c = A.size - 1
end

puts "%d.%d*10^%d" % [a, b, c]
0