結果
問題 |
No.420 mod2漸化式
|
ユーザー |
![]() |
提出日時 | 2016-09-09 22:59:51 |
言語 | F# (F# 4.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 578 bytes |
コンパイル時間 | 8,663 ms |
コンパイル使用メモリ | 188,812 KB |
実行使用メモリ | 871,088 KB |
最終ジャッジ日時 | 2024-11-16 10:49:19 |
合計ジャッジ時間 | 45,436 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 20 TLE * 13 MLE * 2 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (252 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 rec nCr n r :int64= match (n,r) with | (_,0) -> 1L | (n,r) when r > n -> 0L | (_,_) ->( nCr (n-1) (r-1) ) + ( nCr (n-1) r) let nc =(if x > 31 then 0L else nCr 31 x ) let nn =(if x > 31 then 0L else nCr 30 (x-1) ) printfn "%d %d" nc (2147483647L * nn) let mySol = new Sol() mySol.Solve()