結果

問題 No.2005 Sum of Power Sums
ユーザー miztommiztom
提出日時 2024-03-15 03:06:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 283 bytes
コンパイル時間 3,208 ms
コンパイル使用メモリ 81,444 KB
実行使用メモリ 99,200 KB
最終ジャッジ日時 2024-03-15 03:07:02
合計ジャッジ時間 21,846 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 232 ms
76,468 KB
testcase_01 AC 232 ms
76,212 KB
testcase_02 AC 1,519 ms
81,228 KB
testcase_03 AC 265 ms
76,468 KB
testcase_04 AC 231 ms
76,468 KB
testcase_05 AC 241 ms
76,468 KB
testcase_06 AC 256 ms
76,468 KB
testcase_07 AC 243 ms
76,220 KB
testcase_08 AC 232 ms
76,212 KB
testcase_09 AC 231 ms
76,212 KB
testcase_10 AC 234 ms
76,212 KB
testcase_11 AC 232 ms
76,620 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 AC 296 ms
97,740 KB
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 231 ms
76,468 KB
testcase_19 AC 230 ms
76,364 KB
testcase_20 AC 329 ms
99,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M=998244353
n,m=map(int,input().split())
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