結果

問題 No.616 へんなソート
ユーザー ああいいああいい
提出日時 2022-03-30 19:30:24
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 427 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 97,744 KB
最終ジャッジ日時 2024-04-27 09:17:41
合計ジャッジ時間 9,028 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
59,404 KB
testcase_01 AC 39 ms
53,208 KB
testcase_02 AC 45 ms
60,500 KB
testcase_03 AC 48 ms
61,692 KB
testcase_04 AC 50 ms
62,200 KB
testcase_05 AC 39 ms
52,744 KB
testcase_06 AC 52 ms
62,012 KB
testcase_07 AC 47 ms
62,376 KB
testcase_08 AC 54 ms
63,848 KB
testcase_09 AC 53 ms
63,408 KB
testcase_10 AC 47 ms
61,872 KB
testcase_11 AC 51 ms
63,232 KB
testcase_12 AC 69 ms
69,544 KB
testcase_13 TLE -
testcase_14 AC 66 ms
68,152 KB
testcase_15 AC 47 ms
61,876 KB
testcase_16 AC 49 ms
62,296 KB
testcase_17 AC 1,081 ms
76,696 KB
testcase_18 AC 149 ms
76,208 KB
testcase_19 AC 174 ms
75,728 KB
testcase_20 AC 50 ms
62,620 KB
testcase_21 AC 53 ms
62,440 KB
testcase_22 AC 70 ms
66,860 KB
testcase_23 AC 38 ms
52,192 KB
testcase_24 AC 38 ms
53,352 KB
testcase_25 AC 37 ms
53,944 KB
testcase_26 AC 38 ms
53,348 KB
testcase_27 AC 39 ms
53,260 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
ans = 0
for i in dp:
    ans = (ans + i) % P
print(ans)
0