結果

問題 No.420 mod2漸化式
ユーザー kuuso1kuuso1
提出日時 2016-09-09 23:09:58
言語 F#
(.NET 7)
結果
AC  
実行時間 85 ms / 1,000 ms
コード長 701 bytes
コンパイル時間 3,915 ms
コンパイル使用メモリ 165,568 KB
実行使用メモリ 25,104 KB
最終ジャッジ日時 2023-08-25 23:20:50
合計ジャッジ時間 8,289 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
22,948 KB
testcase_01 AC 82 ms
22,936 KB
testcase_02 AC 82 ms
24,912 KB
testcase_03 AC 83 ms
22,824 KB
testcase_04 AC 82 ms
22,928 KB
testcase_05 AC 82 ms
22,800 KB
testcase_06 AC 83 ms
23,004 KB
testcase_07 AC 83 ms
22,860 KB
testcase_08 AC 82 ms
20,956 KB
testcase_09 AC 82 ms
22,872 KB
testcase_10 AC 82 ms
22,980 KB
testcase_11 AC 83 ms
24,908 KB
testcase_12 AC 82 ms
22,876 KB
testcase_13 AC 82 ms
24,860 KB
testcase_14 AC 82 ms
24,904 KB
testcase_15 AC 83 ms
24,948 KB
testcase_16 AC 84 ms
22,936 KB
testcase_17 AC 83 ms
22,996 KB
testcase_18 AC 83 ms
22,820 KB
testcase_19 AC 82 ms
22,888 KB
testcase_20 AC 82 ms
24,956 KB
testcase_21 AC 82 ms
24,864 KB
testcase_22 AC 83 ms
25,104 KB
testcase_23 AC 83 ms
24,908 KB
testcase_24 AC 83 ms
22,876 KB
testcase_25 AC 82 ms
22,820 KB
testcase_26 AC 82 ms
22,864 KB
testcase_27 AC 83 ms
24,864 KB
testcase_28 AC 83 ms
22,980 KB
testcase_29 AC 83 ms
22,752 KB
testcase_30 AC 83 ms
24,864 KB
testcase_31 AC 85 ms
24,924 KB
testcase_32 AC 83 ms
24,916 KB
testcase_33 AC 82 ms
22,880 KB
testcase_34 AC 83 ms
22,928 KB
testcase_35 AC 82 ms
22,880 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let ri () = stdin.ReadLine() |> int
let ria () = stdin.ReadLine().Split() |> Array.map int

type Sol() =
    member this.Solve() = 
        let x = ri ()
        
        let nCr = Array.zeroCreate<int64 []> 32
        for i in 0..31 do
            nCr.[i] <- Array.zeroCreate<int64> 32
            nCr.[i].[0] <- 1L
        for i in 1..31 do 
            for j in 1..i do
                nCr.[i].[j] <- nCr.[i-1].[j-1] + nCr.[i-1].[j]
        
        
        
        let nc =(if x > 31 then 0L else nCr.[31].[x] ) 
        let nn =(if x > 31 || x = 0 then 0L else nCr.[30].[(x-1)] ) 
        
        printfn "%d %d" nc (2147483647L * nn)
        
let mySol = new Sol()
mySol.Solve()
0