結果
問題 |
No.616 へんなソート
|
ユーザー |
![]() |
提出日時 | 2018-03-12 14:52:09 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 344 bytes |
コンパイル時間 | 455 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 37,188 KB |
最終ジャッジ日時 | 2024-11-07 19:21:37 |
合計ジャッジ時間 | 7,031 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 TLE * 1 -- * 16 |
ソースコード
n, k = map(int, input().split()) a = list(map(int, input().split())) mod = 10**9+7 dp = {} def rec(n, k): if k < 0: return 0 if n == 0: return 1 if (n,k) in dp: return dp[n,k] res = 0 for i in range(n): res += rec(n-1, k-i) res %= mod dp[n,k] = res return res print(rec(n, k))