結果

問題 No.2527 H and W
ユーザー ニックネームニックネーム
提出日時 2023-11-03 21:38:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 926 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 11,836 KB
実行使用メモリ 88,460 KB
最終ジャッジ日時 2023-11-03 21:39:09
合計ジャッジ時間 19,459 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,116 KB
testcase_01 AC 29 ms
10,116 KB
testcase_02 AC 886 ms
88,460 KB
testcase_03 AC 29 ms
10,116 KB
testcase_04 AC 903 ms
88,460 KB
testcase_05 AC 912 ms
88,460 KB
testcase_06 AC 904 ms
88,460 KB
testcase_07 AC 29 ms
10,116 KB
testcase_08 AC 878 ms
88,460 KB
testcase_09 AC 714 ms
88,460 KB
testcase_10 AC 722 ms
88,460 KB
testcase_11 AC 900 ms
88,460 KB
testcase_12 AC 886 ms
88,460 KB
testcase_13 AC 874 ms
88,460 KB
testcase_14 AC 918 ms
88,460 KB
testcase_15 AC 882 ms
88,460 KB
testcase_16 AC 874 ms
88,460 KB
testcase_17 AC 854 ms
88,460 KB
testcase_18 AC 926 ms
88,460 KB
testcase_19 AC 556 ms
56,984 KB
testcase_20 AC 658 ms
64,044 KB
testcase_21 AC 902 ms
88,460 KB
testcase_22 AC 884 ms
88,460 KB
testcase_23 AC 863 ms
88,460 KB
testcase_24 AC 593 ms
60,680 KB
testcase_25 AC 606 ms
76,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w,k = map(int,input().split())
nmax = max(h,w); mod = 998244353; fa = [1]*(nmax+1); fi = [1]*(nmax+1)
for i in range(1,nmax): fa[i+1] = fa[i]*(i+1)%mod
fi[nmax] = pow(fa[nmax],mod-2,mod)
for i in range(nmax,0,-1): fi[i-1] = fi[i]*i%mod
def cmb(n,r): return fa[n]*fi[n-r]%mod*fi[r]%mod if 0<=r<=n else 0
x = 0
for i in range(h):
    if k%(h-i)==0: x = (x+cmb(h,i)*cmb(w,k//(h-i)))%mod
print(x)
0