結果

問題 No.2005 Sum of Power Sums
ユーザー miztommiztom
提出日時 2024-03-15 03:09:55
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 288 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 105,724 KB
最終ジャッジ日時 2024-03-15 03:10:14
合計ジャッジ時間 17,160 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 217 ms
76,596 KB
testcase_01 AC 218 ms
76,340 KB
testcase_02 AC 1,507 ms
81,356 KB
testcase_03 AC 250 ms
76,596 KB
testcase_04 AC 244 ms
76,596 KB
testcase_05 AC 224 ms
76,468 KB
testcase_06 AC 218 ms
76,596 KB
testcase_07 AC 218 ms
76,348 KB
testcase_08 AC 219 ms
76,340 KB
testcase_09 AC 242 ms
76,340 KB
testcase_10 AC 219 ms
76,340 KB
testcase_11 AC 219 ms
76,620 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 AC 283 ms
97,996 KB
testcase_15 TLE -
testcase_16 AC 1,542 ms
104,032 KB
testcase_17 TLE -
testcase_18 AC 233 ms
76,724 KB
testcase_19 AC 254 ms
76,492 KB
testcase_20 AC 274 ms
99,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M=998244353
n,m=map(int,input().split())
m%=M
a=b=1
for i in range(n):a,b=a*(n+m-i)%M,b*-~i%M
a=[a,0]
r=[a[0]]+[sum(a:=[a[j-1]*(i-j)*(n+m+j)%M+a[j]*(j+1)*(m+j-i+1)%M for j in range(i+1)]+[0])*pow(b:=b*(n+i)%M,-1,M)%M for i in range(1,5001)]
print(sum(r[int(i)]for i in input().split())%M)
0