結果

問題 No.616 へんなソート
ユーザー ああいいああいい
提出日時 2022-03-30 19:29:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 82,300 KB
実行使用メモリ 98,364 KB
最終ジャッジ日時 2024-04-27 09:16:30
合計ジャッジ時間 9,174 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
60,292 KB
testcase_01 AC 42 ms
51,876 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 39 ms
53,940 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 TLE -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 40 ms
53,352 KB
testcase_24 AC 39 ms
52,748 KB
testcase_25 AC 39 ms
51,820 KB
testcase_26 AC 40 ms
52,332 KB
testcase_27 AC 40 ms
52,988 KB
testcase_28 TLE -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
a = list(map(int,input().split()))

a.sort()
P = 10 ** 9 + 7
dp = [0] * (K+1)
dp[0] = 1
for i in range(N):
    nx = [0] * (K + 1)
    for u in range(K+1):
        for j in range(i+1):
            if u + j <= K:
                nx[u+j] += dp[u]
            else:
                break
    for u in range(K+1):
        nx[u] %= P
    dp = nx
print(sum(dp))
0