結果
問題 | No.25 有限小数 |
ユーザー | Ysmr_Ry |
提出日時 | 2014-11-29 16:15:36 |
言語 | Haskell (9.8.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 395 bytes |
コンパイル時間 | 4,343 ms |
コンパイル使用メモリ | 163,264 KB |
実行使用メモリ | 7,708 KB |
最終ジャッジ日時 | 2023-09-02 00:54:25 |
合計ジャッジ時間 | 5,705 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
7,360 KB |
testcase_01 | AC | 3 ms
7,060 KB |
testcase_02 | AC | 2 ms
7,088 KB |
testcase_03 | AC | 2 ms
7,376 KB |
testcase_04 | AC | 3 ms
7,708 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 3 ms
7,352 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | AC | 3 ms
7,416 KB |
testcase_13 | WA | - |
testcase_14 | AC | 2 ms
7,396 KB |
testcase_15 | WA | - |
testcase_16 | AC | 2 ms
7,348 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 3 ms
7,072 KB |
testcase_21 | AC | 2 ms
7,044 KB |
testcase_22 | WA | - |
testcase_23 | AC | 3 ms
7,468 KB |
testcase_24 | AC | 3 ms
7,440 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
コンパイルメッセージ
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
ソースコード
import Data.List (elem) main :: IO () main = do n <- readLn :: IO Integer m <- readLn :: IO Integer putStrLn $ if m `mod` 2 /= 0 && m `mod` 5 /= 0 then "-1" else [head $ dropWhile (\c -> c=='0'||c=='.') $ dropExp $ reverse $ show $ fromIntegral n/fromIntegral m] dropExp :: String -> String dropExp s | 'e' `elem` s = tail $ dropWhile (/='e') s | otherwise = s