結果

問題 No.1186 長方形の敷き詰め
ユーザー yakeshibayakeshiba
提出日時 2020-11-18 10:33:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 80,788 KB
最終ジャッジ日時 2023-09-30 14:53:04
合計ジャッジ時間 4,596 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,164 KB
testcase_01 AC 74 ms
71,440 KB
testcase_02 AC 72 ms
71,352 KB
testcase_03 AC 72 ms
71,272 KB
testcase_04 AC 72 ms
71,272 KB
testcase_05 AC 73 ms
71,272 KB
testcase_06 AC 73 ms
71,344 KB
testcase_07 AC 71 ms
71,360 KB
testcase_08 WA -
testcase_09 TLE -
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 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353

def ncr(n, r, p): 
    num = den = 1 
    for i in range(r): 
        num = (num * (n - i)) % p 
        den = (den * (i + 1)) % p 
    return (num * pow(den,  
            p - 2, p)) % p 

n, m = map(int,input().split())

if m < n:
    print(1)
    exit()

ans = 1
for i in range(1,m//n+1):
    rest = m-n*i
    ans += ncr(i+rest, i, mod)
    
print(ans%mod)
0