結果

問題 No.616 へんなソート
ユーザー titiatitia
提出日時 2024-01-06 00:18:26
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 279 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 110,892 KB
最終ジャッジ日時 2024-01-06 00:18:43
合計ジャッジ時間 9,426 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,332 KB
testcase_01 AC 36 ms
53,332 KB
testcase_02 AC 39 ms
59,392 KB
testcase_03 AC 41 ms
59,904 KB
testcase_04 AC 42 ms
59,896 KB
testcase_05 AC 36 ms
53,332 KB
testcase_06 AC 42 ms
59,904 KB
testcase_07 AC 40 ms
59,392 KB
testcase_08 AC 43 ms
59,896 KB
testcase_09 AC 44 ms
59,896 KB
testcase_10 AC 41 ms
59,520 KB
testcase_11 AC 43 ms
59,896 KB
testcase_12 AC 64 ms
62,104 KB
testcase_13 AC 1,652 ms
92,824 KB
testcase_14 AC 48 ms
60,024 KB
testcase_15 AC 40 ms
59,392 KB
testcase_16 AC 43 ms
59,896 KB
testcase_17 AC 1,304 ms
89,496 KB
testcase_18 AC 441 ms
75,288 KB
testcase_19 AC 311 ms
72,344 KB
testcase_20 AC 45 ms
59,896 KB
testcase_21 AC 46 ms
59,896 KB
testcase_22 AC 135 ms
66,072 KB
testcase_23 AC 36 ms
53,460 KB
testcase_24 AC 36 ms
53,460 KB
testcase_25 AC 36 ms
53,460 KB
testcase_26 AC 118 ms
64,024 KB
testcase_27 AC 100 ms
64,024 KB
testcase_28 TLE -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0