結果
問題 | No.287 場合の数 |
ユーザー |
|
提出日時 | 2020-02-09 01:11:32 |
言語 | Crystal (1.14.0) |
結果 |
AC
|
実行時間 | 5 ms / 5,000 ms |
コード長 | 206 bytes |
コンパイル時間 | 11,834 ms |
コンパイル使用メモリ | 296,368 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 20:03:25 |
合計ジャッジ時間 | 12,697 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
Memo={} of Tuple(Int32,Int32) => Int64def perform(n,d,u)if d==10<=n&&n<=u ? 1 : 0elseMemo[{n,d}]||=(0..u).reduce(0_i64){|s,i|s+perform(n-i,d-1,u)}endendn=gets.not_nil!.to_ip perform(6*n,8,n)