結果
問題 | No.2105 Avoid MeX |
ユーザー | 👑 p-adic |
提出日時 | 2023-06-22 18:17:13 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 256 bytes |
コンパイル時間 | 420 ms |
コンパイル使用メモリ | 10,960 KB |
実行使用メモリ | 73,292 KB |
最終ジャッジ日時 | 2023-09-12 12:35:27 |
合計ジャッジ時間 | 8,591 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 15 ms
12,260 KB |
testcase_01 | AC | 16 ms
7,776 KB |
testcase_02 | AC | 15 ms
7,868 KB |
testcase_03 | AC | 16 ms
7,828 KB |
testcase_04 | TLE | - |
testcase_05 | AC | 16 ms
7,876 KB |
testcase_06 | AC | 1,487 ms
41,980 KB |
testcase_07 | TLE | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
ソースコード
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])