結果

問題 No.657 テトラナッチ数列 Easy
ユーザー HaarHaar
提出日時 2018-09-26 08:51:48
言語 Haskell
(9.8.2)
結果
AC  
実行時間 342 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 6,800 ms
コンパイル使用メモリ 175,464 KB
実行使用メモリ 104,704 KB
最終ジャッジ日時 2024-04-17 11:50:00
合計ジャッジ時間 11,739 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
47,744 KB
testcase_01 AC 118 ms
47,744 KB
testcase_02 AC 118 ms
47,744 KB
testcase_03 AC 119 ms
47,872 KB
testcase_04 AC 304 ms
100,736 KB
testcase_05 AC 140 ms
48,512 KB
testcase_06 AC 119 ms
48,000 KB
testcase_07 AC 119 ms
47,872 KB
testcase_08 AC 342 ms
104,704 KB
testcase_09 AC 199 ms
79,360 KB
testcase_10 AC 201 ms
78,976 KB
testcase_11 AC 199 ms
78,976 KB
testcase_12 AC 206 ms
76,160 KB
testcase_13 AC 332 ms
96,512 KB
testcase_14 AC 329 ms
95,488 KB
testcase_15 AC 318 ms
88,320 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Array
import Control.Monad

main = do
  q <- readLn :: IO Int

  let t = array (1,10^6) $ (1,0):(2,0):(3,0):(4,1):[(i,(t!(i-1)+t!(i-2)+t!(i-3)+t!(i-4))`mod`17) | i<-[5..10^6]] :: Array Int Int

  replicateM_ q $ do
    n <- readLn :: IO Int
    print $ t!n
0