結果

問題 No.311 z in FizzBuzzString
ユーザー AyachiGinAyachiGin
提出日時 2016-06-12 10:39:21
言語 Haskell
(9.8.2)
結果
MLE  
実行時間 -
コード長 305 bytes
コンパイル時間 1,902 ms
コンパイル使用メモリ 168,948 KB
実行使用メモリ 520,512 KB
最終ジャッジ日時 2023-10-25 02:45:24
合計ジャッジ時間 5,034 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
9,632 KB
testcase_01 AC 3 ms
5,288 KB
testcase_02 AC 2 ms
5,288 KB
testcase_03 AC 2 ms
5,288 KB
testcase_04 AC 3 ms
5,292 KB
testcase_05 AC 3 ms
5,344 KB
testcase_06 AC 2 ms
5,360 KB
testcase_07 MLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

module Main where

main :: IO ()
main = do
  i <- readLn
  print $ fizzBuzzN i

fizzBuzzN :: Integer -> Integer
fizzBuzzN 0 = 0
fizzBuzzN n = let a = if n `mod` 5 == 0 then 2 else 0
                  b = if n `mod` 3 == 0 then 2 else 0
                  x = a + b
                  in x + fizzBuzzN (n-1)
0