結果

問題 No.616 へんなソート
ユーザー roarisroaris
提出日時 2020-12-04 18:20:12
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 324 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 76,748 KB
最終ジャッジ日時 2023-10-13 07:54:57
合計ジャッジ時間 5,919 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,284 KB
testcase_01 AC 72 ms
71,392 KB
testcase_02 AC 78 ms
76,476 KB
testcase_03 AC 80 ms
76,476 KB
testcase_04 AC 84 ms
76,616 KB
testcase_05 AC 71 ms
71,348 KB
testcase_06 AC 87 ms
76,428 KB
testcase_07 AC 78 ms
76,592 KB
testcase_08 AC 92 ms
76,748 KB
testcase_09 AC 91 ms
76,544 KB
testcase_10 AC 80 ms
76,596 KB
testcase_11 AC 81 ms
76,620 KB
testcase_12 AC 121 ms
76,240 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
dp = [[0]*(K+1) for _ in range(N+1)]
dp[1][0] = 1
MOD = 10**9+7

for i in range(2, N+1):
    for j in range(K+1):
        for k in range(i):
            if j-k<0:
                break
            
            dp[i][j] += dp[i-1][j-k]
            dp[i][j] %= MOD

print(sum(dp[N][:K+1])%MOD)
0