結果

問題 No.1186 長方形の敷き詰め
ユーザー tyawanmusityawanmusi
提出日時 2020-08-22 17:21:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 157,704 KB
最終ジャッジ日時 2024-04-23 11:18:53
合計ジャッジ時間 6,351 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,840 KB
testcase_01 AC 40 ms
51,840 KB
testcase_02 AC 170 ms
157,700 KB
testcase_03 AC 39 ms
51,712 KB
testcase_04 AC 39 ms
52,352 KB
testcase_05 AC 38 ms
51,712 KB
testcase_06 AC 37 ms
51,840 KB
testcase_07 AC 39 ms
51,840 KB
testcase_08 WA -
testcase_09 TLE -
testcase_10 WA -
testcase_11 AC 42 ms
58,624 KB
testcase_12 AC 43 ms
59,776 KB
testcase_13 AC 44 ms
59,008 KB
testcase_14 AC 44 ms
60,032 KB
testcase_15 AC 44 ms
59,136 KB
testcase_16 AC 44 ms
58,880 KB
testcase_17 AC 87 ms
122,368 KB
testcase_18 AC 118 ms
132,448 KB
testcase_19 AC 132 ms
145,156 KB
testcase_20 AC 142 ms
157,700 KB
testcase_21 AC 109 ms
122,240 KB
testcase_22 AC 1,164 ms
157,704 KB
testcase_23 AC 114 ms
122,240 KB
testcase_24 AC 145 ms
157,704 KB
testcase_25 AC 105 ms
122,240 KB
testcase_26 AC 108 ms
122,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
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