結果

問題 No.639 An Ordinary Sequence
ユーザー poapoapoapoa
提出日時 2020-08-18 08:26:03
言語 Haskell
(9.8.2)
結果
RE  
実行時間 -
コード長 276 bytes
コンパイル時間 2,379 ms
コンパイル使用メモリ 164,860 KB
実行使用メモリ 58,688 KB
最終ジャッジ日時 2023-08-02 02:43:07
合計ジャッジ時間 3,721 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 3 ms
6,912 KB
testcase_03 AC 2 ms
6,980 KB
testcase_04 AC 3 ms
6,900 KB
testcase_05 AC 2 ms
7,080 KB
testcase_06 AC 2 ms
7,016 KB
testcase_07 AC 2 ms
6,912 KB
testcase_08 AC 3 ms
6,980 KB
testcase_09 AC 2 ms
6,972 KB
testcase_10 AC 2 ms
6,904 KB
testcase_11 AC 2 ms
7,012 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 2 ms
6,980 KB
testcase_18 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

{-# LANGUAGE BangPatterns #-}


main :: IO ()
main = do
  n <- readLn :: IO Int
  print $ solver n

solver :: Int -> Int
solver = iter
  where
    iter :: Int -> Int
    iter = (map f [0..10^6] !!)
      where
        f 0 = 1
        f !i = iter (i `div` 3) + iter (i `div` 5)
0