結果

問題 No.668 6.0*10^23
ユーザー pekempeypekempey
提出日時 2018-03-23 22:58:37
言語 Haskell
(9.8.2)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 11,825 ms
コンパイル使用メモリ 166,288 KB
実行使用メモリ 15,260 KB
最終ジャッジ日時 2023-09-12 17:28:02
合計ジャッジ時間 11,405 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,804 KB
testcase_01 AC 22 ms
14,340 KB
testcase_02 AC 12 ms
12,720 KB
testcase_03 AC 6 ms
11,424 KB
testcase_04 AC 8 ms
11,724 KB
testcase_05 AC 4 ms
10,508 KB
testcase_06 AC 8 ms
11,696 KB
testcase_07 AC 2 ms
6,820 KB
testcase_08 AC 3 ms
6,904 KB
testcase_09 AC 3 ms
6,812 KB
testcase_10 AC 6 ms
11,228 KB
testcase_11 AC 22 ms
15,148 KB
testcase_12 AC 6 ms
11,188 KB
testcase_13 AC 22 ms
15,096 KB
testcase_14 AC 12 ms
13,892 KB
testcase_15 AC 4 ms
8,904 KB
testcase_16 AC 5 ms
10,468 KB
testcase_17 AC 22 ms
15,260 KB
testcase_18 AC 12 ms
11,956 KB
testcase_19 AC 5 ms
10,476 KB
testcase_20 AC 12 ms
12,276 KB
testcase_21 AC 11 ms
12,172 KB
testcase_22 AC 22 ms
15,092 KB
testcase_23 AC 12 ms
12,736 KB
testcase_24 AC 5 ms
9,580 KB
testcase_25 AC 22 ms
15,172 KB
testcase_26 AC 3 ms
7,396 KB
testcase_27 AC 12 ms
12,848 KB
testcase_28 AC 22 ms
15,144 KB
testcase_29 AC 8 ms
11,440 KB
testcase_30 AC 22 ms
14,444 KB
testcase_31 AC 12 ms
12,244 KB
testcase_32 AC 4 ms
9,172 KB
testcase_33 AC 22 ms
14,068 KB
testcase_34 AC 6 ms
11,192 KB
testcase_35 AC 5 ms
11,140 KB
testcase_36 AC 12 ms
13,364 KB
testcase_37 AC 22 ms
15,100 KB
testcase_38 AC 8 ms
11,888 KB
testcase_39 AC 12 ms
12,692 KB
testcase_40 AC 22 ms
15,196 KB
testcase_41 AC 22 ms
14,120 KB
testcase_42 AC 7 ms
11,572 KB
testcase_43 AC 22 ms
14,528 KB
testcase_44 AC 22 ms
14,224 KB
testcase_45 AC 3 ms
6,992 KB
testcase_46 AC 3 ms
6,900 KB
testcase_47 AC 3 ms
6,836 KB
testcase_48 AC 2 ms
6,820 KB
testcase_49 AC 3 ms
6,824 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.Char (digitToInt)
import Text.Printf

main = getLine >>= putStrLn . solve . map digitToInt

solve :: [Int] -> String
solve (x:y:z:xs)
  | z <= 4    = printf "%d.%d*10^%d" x y n
  | y <= 8    = printf "%d.%d*10^%d" x (y+1) n
  | x <= 8    = printf "%d.0*10^%d" (x+1) n
  | otherwise = printf "1.0*10^%d" (n+1)
  where n = length xs + 2
    
0