結果

問題 No.2527 H and W
ユーザー 👑 KA37RIKA37RI
提出日時 2023-11-03 22:48:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 407 bytes
コンパイル時間 686 ms
コンパイル使用メモリ 11,940 KB
実行使用メモリ 49,440 KB
最終ジャッジ日時 2023-11-03 22:48:42
合計ジャッジ時間 10,553 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,112 KB
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

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