結果

問題 No.314 ケンケンパ
ユーザー LeonardoneLeonardone
提出日時 2015-12-08 08:54:57
言語 F#
(F# 4.0)
結果
AC  
実行時間 92 ms / 1,000 ms
コード長 277 bytes
コンパイル時間 6,172 ms
コンパイル使用メモリ 162,428 KB
実行使用メモリ 24,884 KB
最終ジャッジ日時 2023-10-12 21:16:30
合計ジャッジ時間 8,726 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
22,720 KB
testcase_01 AC 81 ms
22,804 KB
testcase_02 AC 81 ms
20,764 KB
testcase_03 AC 81 ms
22,832 KB
testcase_04 AC 80 ms
22,748 KB
testcase_05 AC 79 ms
22,776 KB
testcase_06 AC 80 ms
24,884 KB
testcase_07 AC 79 ms
22,772 KB
testcase_08 AC 82 ms
24,844 KB
testcase_09 AC 82 ms
22,804 KB
testcase_10 AC 80 ms
22,796 KB
testcase_11 AC 80 ms
24,776 KB
testcase_12 AC 81 ms
22,900 KB
testcase_13 AC 82 ms
22,748 KB
testcase_14 AC 80 ms
24,776 KB
testcase_15 AC 80 ms
22,792 KB
testcase_16 AC 79 ms
22,784 KB
testcase_17 AC 79 ms
20,748 KB
testcase_18 AC 84 ms
22,736 KB
testcase_19 AC 91 ms
24,852 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

// yukicoder My Practice
// author: Leonardone @ NEETSDKASU

open System

let n = int64(Console.ReadLine())

let md = 1000000007L

let rec f a b c n =
    if n = 0L then
        (a + b + c) % md
    else
        f ((b + c) % md) a b (n - 1L)

printf "%d" <| f 0L 1L 0L (n - 1L)
0