結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー サブミット野郎
提出日時 2019-07-22 16:36:06
言語 Haskell
(9.10.1)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 249 bytes
コンパイル時間 1,762 ms
コンパイル使用メモリ 175,104 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 18:37:08
合計ジャッジ時間 2,802 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

solve :: [Int] -> [Int]
solve [] = []
solve (x:xs) = y : solve xs
    where
        y = if (x `mod` 15) == 0 then 8 else if (x `mod` 3 == 0) || (x `mod` 5 == 0) then 4 else length $ show x
    
main = interact $ show . sum . solve . map read . words
0