結果

問題 No.2005 Sum of Power Sums
ユーザー miztommiztom
提出日時 2024-03-15 03:19:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 99,408 KB
最終ジャッジ日時 2024-03-15 03:19:31
合計ジャッジ時間 7,355 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 254 ms
76,344 KB
testcase_01 AC 226 ms
76,344 KB
testcase_02 AC 231 ms
76,472 KB
testcase_03 AC 241 ms
76,344 KB
testcase_04 AC 222 ms
76,344 KB
testcase_05 AC 267 ms
76,344 KB
testcase_06 AC 230 ms
76,344 KB
testcase_07 AC 251 ms
76,480 KB
testcase_08 AC 223 ms
76,472 KB
testcase_09 AC 222 ms
76,728 KB
testcase_10 AC 251 ms
76,216 KB
testcase_11 AC 228 ms
76,368 KB
testcase_12 AC 258 ms
76,600 KB
testcase_13 AC 264 ms
76,368 KB
testcase_14 AC 276 ms
98,000 KB
testcase_15 AC 304 ms
99,152 KB
testcase_16 AC 303 ms
99,152 KB
testcase_17 AC 301 ms
99,408 KB
testcase_18 AC 294 ms
76,216 KB
testcase_19 AC 260 ms
76,624 KB
testcase_20 AC 296 ms
99,280 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)%M*(n+m+j)+a[j]*(j+1)%M*(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