結果

問題 No.933 おまわりさんこいつです
ユーザー HaarHaar
提出日時 2019-11-29 21:57:19
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 382 bytes
コンパイル時間 5,086 ms
コンパイル使用メモリ 180,164 KB
実行使用メモリ 17,152 KB
最終ジャッジ日時 2024-04-30 23:29:32
合計ジャッジ時間 9,367 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
13,888 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 12 ms
14,976 KB
testcase_14 AC 16 ms
14,692 KB
testcase_15 AC 28 ms
15,212 KB
testcase_16 AC 168 ms
15,460 KB
testcase_17 AC 21 ms
15,076 KB
testcase_18 AC 1 ms
6,940 KB
testcase_19 AC 49 ms
14,936 KB
testcase_20 AC 110 ms
17,152 KB
testcase_21 AC 1 ms
6,940 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 TLE -
testcase_24 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

import Data.Maybe
import Data.List
import qualified Data.ByteString.Char8 as BS
import Data.Char


f :: Integer -> Integer
f n = sum . map (fromIntegral . subtract 48 . ord) . show $ n

g n
  | n < 10 = n
  | otherwise = g (f n)


main = do
  n <- readLn :: IO Int
  p <- foldl1 (*) . map (fst . fromJust . BS.readInteger) . BS.words <$> BS.getLine :: IO Integer

  print $ g p
  
0