結果

問題 No.1186 長方形の敷き詰め
ユーザー yakeshibayakeshiba
提出日時 2020-11-18 10:31:39
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 366 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 82,152 KB
実行使用メモリ 67,968 KB
最終ジャッジ日時 2024-07-23 08:53:40
合計ジャッジ時間 2,469 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 38 ms
53,316 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 WA -
testcase_06 AC 38 ms
53,032 KB
testcase_07 WA -
testcase_08 AC 37 ms
52,876 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 38 ms
53,260 KB
testcase_12 AC 37 ms
52,456 KB
testcase_13 AC 37 ms
53,272 KB
testcase_14 AC 39 ms
52,468 KB
testcase_15 AC 38 ms
52,756 KB
testcase_16 RE -
testcase_17 AC 38 ms
52,592 KB
testcase_18 AC 38 ms
53,000 KB
testcase_19 AC 39 ms
52,192 KB
testcase_20 AC 38 ms
53,504 KB
testcase_21 AC 39 ms
52,400 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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, 998244353)
    
print(ans%mod)
0