結果

問題 No.554 recurrence formula
ユーザー aimyaimy
提出日時 2017-08-12 00:01:37
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 260 bytes
コンパイル時間 9,722 ms
コンパイル使用メモリ 175,696 KB
実行使用メモリ 50,468 KB
最終ジャッジ日時 2024-04-21 00:02:08
合計ジャッジ時間 13,777 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
13,880 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 1 ms
6,816 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 4 ms
6,940 KB
testcase_11 AC 20 ms
18,952 KB
testcase_12 AC 14 ms
15,836 KB
testcase_13 AC 49 ms
20,936 KB
testcase_14 AC 20 ms
18,824 KB
testcase_15 AC 55 ms
20,864 KB
testcase_16 AC 51 ms
20,984 KB
testcase_17 AC 33 ms
19,756 KB
testcase_18 AC 27 ms
19,028 KB
testcase_19 TLE -
testcase_20 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

main = do
  n <- readLn
  print (recurrence n 1 0 1 1 `mod` (10^9+7))

recurrence 1 _ _ _ _ = 1
recurrence n ao ae x acc
  | n == x = acc
  | odd x = recurrence n ao (ao*(x+1)+ae) (x+1) (ao*(x+1))
  | otherwise = recurrence n (ae*(x+1)+ao) ae (x+1) (ae*(x+1))
0