結果

問題 No.1186 長方形の敷き詰め
ユーザー tyawanmusityawanmusi
提出日時 2020-08-22 17:22:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,020 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 157,800 KB
最終ジャッジ日時 2024-04-23 11:19:28
合計ジャッジ時間 3,608 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
52,596 KB
testcase_01 AC 32 ms
53,556 KB
testcase_02 AC 133 ms
157,800 KB
testcase_03 AC 34 ms
52,408 KB
testcase_04 AC 34 ms
52,836 KB
testcase_05 AC 32 ms
52,740 KB
testcase_06 AC 35 ms
53,684 KB
testcase_07 AC 34 ms
52,516 KB
testcase_08 AC 35 ms
52,304 KB
testcase_09 AC 33 ms
52,896 KB
testcase_10 AC 39 ms
52,416 KB
testcase_11 AC 39 ms
60,488 KB
testcase_12 AC 38 ms
61,128 KB
testcase_13 AC 38 ms
59,052 KB
testcase_14 AC 37 ms
60,132 KB
testcase_15 AC 37 ms
59,900 KB
testcase_16 AC 36 ms
59,380 KB
testcase_17 AC 80 ms
122,320 KB
testcase_18 AC 107 ms
132,304 KB
testcase_19 AC 113 ms
145,348 KB
testcase_20 AC 120 ms
157,776 KB
testcase_21 AC 100 ms
122,340 KB
testcase_22 AC 1,020 ms
157,708 KB
testcase_23 AC 108 ms
122,628 KB
testcase_24 AC 121 ms
157,540 KB
testcase_25 AC 102 ms
122,196 KB
testcase_26 AC 103 ms
122,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
if n==1:
  exit(print(1))
ans=0
mod=998244353
f = [1]
for i in range(m*2):
  f += [f[-1]*(i+1) % mod]
def comb(a, b):
  return f[a]*pow(f[b], mod-2, mod)*pow(f[a-b], mod-2, mod) % mod
for i in range(m+1):
  if (m-i)%n:continue
  ans+=comb((m-i)//n+i,i)
  ans%=mod
print(ans)
0