結果

問題 No.2527 H and W
ユーザー 👑 KA37RI
提出日時 2023-11-03 22:48:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 407 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 50,048 KB
最終ジャッジ日時 2024-09-25 21:12:37
合計ジャッジ時間 11,425 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1 RE * 1
other WA * 14 RE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
h, w, k = [int(x) for x in input().split()]
if h > w:
	h, w = w, h
fc = [1]
for i in range(1, w + 1):
	fc.append(fc[-1] * i % mod)
hw_rem = []
ans = 0
for i in range(1, h + 1):
	if k % i == 0:
		hw_rem.append(i)
for x in hw_rem:
	a = fc[h] * pow(fc[h-x], -1, mod) * pow(fc[x], -1, mod)
	y = k // x
	b = fc[w] * pow(fc[w-y], -1, mod) * pow(fc[y], -1, mod)
	ans += a + b
	ans %= mod
print(ans)
0