結果

問題 No.616 へんなソート
ユーザー titiatitia
提出日時 2024-01-06 00:19:48
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 272 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 97,288 KB
最終ジャッジ日時 2024-01-06 00:19:59
合計ジャッジ時間 9,981 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
60,136 KB
testcase_01 AC 35 ms
53,332 KB
testcase_02 AC 39 ms
59,380 KB
testcase_03 AC 40 ms
59,764 KB
testcase_04 AC 41 ms
59,764 KB
testcase_05 AC 35 ms
53,332 KB
testcase_06 AC 40 ms
59,764 KB
testcase_07 AC 39 ms
59,380 KB
testcase_08 AC 51 ms
59,764 KB
testcase_09 AC 41 ms
59,760 KB
testcase_10 AC 40 ms
59,380 KB
testcase_11 AC 42 ms
59,760 KB
testcase_12 AC 65 ms
61,856 KB
testcase_13 AC 1,776 ms
81,452 KB
testcase_14 AC 47 ms
59,760 KB
testcase_15 AC 40 ms
59,380 KB
testcase_16 AC 42 ms
59,760 KB
testcase_17 AC 1,434 ms
78,252 KB
testcase_18 AC 473 ms
67,980 KB
testcase_19 AC 343 ms
65,932 KB
testcase_20 AC 41 ms
59,764 KB
testcase_21 AC 45 ms
59,760 KB
testcase_22 AC 144 ms
61,836 KB
testcase_23 AC 36 ms
53,332 KB
testcase_24 AC 47 ms
53,332 KB
testcase_25 AC 36 ms
53,332 KB
testcase_26 AC 124 ms
61,836 KB
testcase_27 AC 102 ms
61,836 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]=(NDP[j+k]+DP[k])%mod

    DP=NDP

print(sum(DP[:K+1])%mod)
0