結果

問題 No.1186 長方形の敷き詰め
ユーザー mlihua09mlihua09
提出日時 2020-08-22 14:09:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 545 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 122,748 KB
最終ジャッジ日時 2024-04-23 08:33:01
合計ジャッジ時間 2,765 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,536 KB
testcase_01 AC 34 ms
52,656 KB
testcase_02 AC 91 ms
122,236 KB
testcase_03 AC 34 ms
52,684 KB
testcase_04 AC 34 ms
52,568 KB
testcase_05 AC 33 ms
53,212 KB
testcase_06 AC 33 ms
52,400 KB
testcase_07 AC 32 ms
52,256 KB
testcase_08 AC 34 ms
52,132 KB
testcase_09 AC 34 ms
52,960 KB
testcase_10 AC 34 ms
52,744 KB
testcase_11 AC 37 ms
58,772 KB
testcase_12 AC 41 ms
60,444 KB
testcase_13 AC 36 ms
58,620 KB
testcase_14 AC 36 ms
59,508 KB
testcase_15 AC 37 ms
59,744 KB
testcase_16 AC 37 ms
58,696 KB
testcase_17 AC 55 ms
90,252 KB
testcase_18 AC 76 ms
122,416 KB
testcase_19 AC 80 ms
122,352 KB
testcase_20 AC 90 ms
122,748 KB
testcase_21 AC 71 ms
115,460 KB
testcase_22 AC 545 ms
122,372 KB
testcase_23 AC 72 ms
114,576 KB
testcase_24 AC 89 ms
122,412 KB
testcase_25 AC 68 ms
110,320 KB
testcase_26 AC 70 ms
116,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())

if N == 1:
    print(1)
    exit()

P = 998244353


ans = 0

f = [1]

for i in range(1, M + 1):
    
    f += [f[-1] * i % P]
    
    
for i in range(M // N + 1):
    
    j = M - i * N
    
    ans += f[i + j] * pow(f[i] * f[j], P - 2, P)
    ans %= P
    
print(ans)
0