結果
| 問題 |
No.616 へんなソート
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2024-01-06 00:18:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 279 bytes |
| コンパイル時間 | 207 ms |
| コンパイル使用メモリ | 81,976 KB |
| 実行使用メモリ | 111,548 KB |
| 最終ジャッジ日時 | 2024-09-27 19:12:25 |
| 合計ジャッジ時間 | 9,415 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 TLE * 1 -- * 1 |
ソースコード
N,K=map(int,input().split())
A=list(map(int,input().split()))
mod=10**9+7
DP=[1,1]
for i in range(3,N+1):
NDP=[0]*(i*(i-1)//2+1)
for j in range(i):
for k in range(len(DP)):
NDP[j+k]+=DP[k]
DP=[ndp%mod for ndp in NDP]
print(sum(DP[:K+1])%mod)
titia