結果

問題 No.1186 長方形の敷き詰め
ユーザー tyawanmusityawanmusi
提出日時 2020-08-22 17:22:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,087 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 150,648 KB
最終ジャッジ日時 2023-08-05 14:10:01
合計ジャッジ時間 5,177 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,384 KB
testcase_01 AC 70 ms
71,296 KB
testcase_02 AC 171 ms
150,648 KB
testcase_03 AC 69 ms
71,444 KB
testcase_04 AC 69 ms
71,344 KB
testcase_05 AC 68 ms
71,200 KB
testcase_06 AC 69 ms
71,296 KB
testcase_07 AC 69 ms
71,556 KB
testcase_08 AC 70 ms
71,388 KB
testcase_09 AC 69 ms
71,132 KB
testcase_10 AC 69 ms
71,348 KB
testcase_11 AC 74 ms
76,212 KB
testcase_12 AC 74 ms
76,280 KB
testcase_13 AC 74 ms
76,360 KB
testcase_14 AC 75 ms
76,048 KB
testcase_15 AC 75 ms
76,240 KB
testcase_16 AC 75 ms
76,396 KB
testcase_17 AC 112 ms
118,160 KB
testcase_18 AC 138 ms
137,984 KB
testcase_19 AC 147 ms
150,500 KB
testcase_20 AC 155 ms
150,584 KB
testcase_21 AC 137 ms
127,700 KB
testcase_22 AC 1,087 ms
150,580 KB
testcase_23 AC 144 ms
126,928 KB
testcase_24 AC 157 ms
150,620 KB
testcase_25 AC 133 ms
118,216 KB
testcase_26 AC 138 ms
127,724 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