結果
問題 | No.420 mod2漸化式 |
ユーザー | kuuso1 |
提出日時 | 2016-09-09 23:09:58 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 376 ms / 1,000 ms |
コード長 | 701 bytes |
コンパイル時間 | 17,289 ms |
コンパイル使用メモリ | 197,528 KB |
実行使用メモリ | 34,740 KB |
最終ジャッジ日時 | 2024-12-24 11:14:35 |
合計ジャッジ時間 | 32,293 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (381 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
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()