結果

問題 No.616 へんなソート
ユーザー convexineqconvexineq
提出日時 2021-05-06 05:07:23
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 328 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 81,476 KB
最終ジャッジ日時 2023-10-11 22:21:05
合計ジャッジ時間 13,399 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,272 KB
testcase_01 AC 74 ms
71,068 KB
testcase_02 AC 86 ms
75,564 KB
testcase_03 AC 80 ms
76,112 KB
testcase_04 AC 83 ms
76,072 KB
testcase_05 AC 74 ms
71,072 KB
testcase_06 AC 81 ms
75,820 KB
testcase_07 AC 79 ms
76,068 KB
testcase_08 AC 80 ms
76,180 KB
testcase_09 AC 83 ms
76,188 KB
testcase_10 AC 79 ms
76,276 KB
testcase_11 AC 81 ms
76,112 KB
testcase_12 AC 113 ms
76,128 KB
testcase_13 TLE -
testcase_14 AC 91 ms
76,196 KB
testcase_15 AC 79 ms
76,068 KB
testcase_16 AC 84 ms
76,204 KB
testcase_17 TLE -
testcase_18 AC 705 ms
76,992 KB
testcase_19 AC 507 ms
76,740 KB
testcase_20 AC 81 ms
76,356 KB
testcase_21 AC 86 ms
76,224 KB
testcase_22 AC 227 ms
76,724 KB
testcase_23 AC 74 ms
71,064 KB
testcase_24 AC 74 ms
71,212 KB
testcase_25 AC 74 ms
71,228 KB
testcase_26 AC 201 ms
76,688 KB
testcase_27 AC 174 ms
76,356 KB
testcase_28 TLE -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def polymul(f,g):
    lf = len(f)
    lg = len(g)
    res = [0]*(lf+lg-1)
    for i in range(lf):
        for j in range(lg):
            res[i+j] += f[i]*g[j]
            res[i+j] %= MOD
    return res

MOD = 10**9+7
n,k = map(int,input().split())
a = [1]
for i in range(n):
    a = polymul(a,[1]*(i+1))
print(sum(a[:k+1])%MOD)
0