結果

問題 No.593 4進FizzBuzz
ユーザー pekempeypekempey
提出日時 2017-11-11 18:15:43
言語 Haskell
(9.8.2)
結果
AC  
実行時間 483 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 712 ms
コンパイル使用メモリ 165,844 KB
実行使用メモリ 113,372 KB
最終ジャッジ日時 2023-08-16 07:45:09
合計ジャッジ時間 11,974 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,672 KB
testcase_01 AC 3 ms
6,572 KB
testcase_02 AC 3 ms
6,648 KB
testcase_03 AC 3 ms
6,596 KB
testcase_04 AC 2 ms
6,688 KB
testcase_05 AC 2 ms
6,588 KB
testcase_06 AC 2 ms
6,648 KB
testcase_07 AC 3 ms
6,616 KB
testcase_08 AC 2 ms
6,584 KB
testcase_09 AC 3 ms
6,580 KB
testcase_10 AC 2 ms
6,580 KB
testcase_11 AC 2 ms
6,592 KB
testcase_12 AC 3 ms
6,592 KB
testcase_13 AC 2 ms
6,656 KB
testcase_14 AC 3 ms
6,652 KB
testcase_15 AC 2 ms
6,700 KB
testcase_16 AC 452 ms
113,312 KB
testcase_17 AC 452 ms
113,360 KB
testcase_18 AC 452 ms
113,308 KB
testcase_19 AC 472 ms
113,260 KB
testcase_20 AC 463 ms
113,192 KB
testcase_21 AC 462 ms
113,320 KB
testcase_22 AC 482 ms
113,292 KB
testcase_23 AC 462 ms
113,292 KB
testcase_24 AC 463 ms
113,192 KB
testcase_25 AC 452 ms
113,304 KB
testcase_26 AC 472 ms
113,300 KB
testcase_27 AC 482 ms
113,372 KB
testcase_28 AC 453 ms
113,340 KB
testcase_29 AC 483 ms
113,256 KB
testcase_30 AC 442 ms
113,324 KB
testcase_31 AC 432 ms
113,324 KB
testcase_32 AC 432 ms
113,328 KB
testcase_33 AC 462 ms
113,232 KB
testcase_34 AC 433 ms
113,308 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 Data.List

main = do
  n <- getLine

  case (remainder n 3, remainder n 5) of
    (0, 0) -> putStrLn "FizzBuzz"
    (0, _) -> putStrLn "Fizz"
    (_, 0) -> putStrLn "Buzz"
    (_, _) -> putStrLn n

remainder :: String -> Int -> Int
remainder n m = foldl' (\ans x -> (ans*4 + x) `mod` m) 0 $ map digitToInt n
0