結果

問題 No.2105 Avoid MeX
ユーザー 👑 p-adicp-adic
提出日時 2023-06-22 18:17:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,594 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 108,972 KB
最終ジャッジ日時 2023-09-12 12:35:54
合計ジャッジ時間 20,771 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,124 KB
testcase_01 AC 73 ms
71,172 KB
testcase_02 AC 75 ms
71,164 KB
testcase_03 AC 72 ms
71,020 KB
testcase_04 AC 991 ms
97,324 KB
testcase_05 AC 72 ms
71,268 KB
testcase_06 AC 591 ms
88,320 KB
testcase_07 AC 1,338 ms
105,300 KB
testcase_08 AC 885 ms
94,184 KB
testcase_09 AC 1,438 ms
107,088 KB
testcase_10 AC 82 ms
76,300 KB
testcase_11 AC 173 ms
78,580 KB
testcase_12 AC 350 ms
82,464 KB
testcase_13 AC 198 ms
78,992 KB
testcase_14 AC 1,181 ms
101,280 KB
testcase_15 AC 1,006 ms
97,988 KB
testcase_16 AC 1,589 ms
108,760 KB
testcase_17 AC 1,594 ms
108,768 KB
testcase_18 AC 1,580 ms
108,756 KB
testcase_19 AC 1,533 ms
108,972 KB
testcase_20 AC 1,421 ms
108,888 KB
testcase_21 AC 1,523 ms
108,892 KB
testcase_22 AC 1,417 ms
108,688 KB
testcase_23 AC 72 ms
71,308 KB
testcase_24 AC 72 ms
71,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

C,X=map(int,input().split())
P=998244353
Y=X+1
D=[0]*Y
I=range(Y)
for i in I:
	if i:D[i]=[(D[i-1][x-1]*(C+i+1-x)+D[i-1][x]*x)*pow(C+i,-1,P)%P for x in I]
	else:D[i]=[1]+[0]*X
print([sum(D[max(0,X-C)][x]*(X-x)*pow(Y-x,-1,P)for x in I)%P,pow(C+1,-1,P)][X<1])
0