結果

問題 No.1321 塗るめた
ユーザー chineristACchineristAC
提出日時 2020-12-18 01:27:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 1,298 ms
コンパイル使用メモリ 81,156 KB
実行使用メモリ 82,272 KB
最終ジャッジ日時 2023-10-21 07:43:57
合計ジャッジ時間 5,743 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
64,224 KB
testcase_01 AC 57 ms
64,236 KB
testcase_02 AC 54 ms
64,236 KB
testcase_03 AC 56 ms
64,236 KB
testcase_04 AC 55 ms
64,236 KB
testcase_05 AC 55 ms
64,236 KB
testcase_06 AC 55 ms
64,236 KB
testcase_07 AC 55 ms
64,236 KB
testcase_08 AC 54 ms
64,236 KB
testcase_09 AC 55 ms
64,236 KB
testcase_10 AC 55 ms
64,236 KB
testcase_11 AC 55 ms
64,236 KB
testcase_12 AC 91 ms
75,716 KB
testcase_13 AC 142 ms
82,008 KB
testcase_14 AC 81 ms
72,980 KB
testcase_15 AC 69 ms
68,860 KB
testcase_16 AC 76 ms
70,932 KB
testcase_17 AC 57 ms
64,240 KB
testcase_18 AC 57 ms
64,240 KB
testcase_19 AC 56 ms
64,240 KB
testcase_20 AC 70 ms
68,860 KB
testcase_21 AC 101 ms
78,084 KB
testcase_22 AC 81 ms
72,980 KB
testcase_23 AC 77 ms
70,932 KB
testcase_24 AC 86 ms
73,544 KB
testcase_25 AC 57 ms
64,240 KB
testcase_26 AC 73 ms
70,932 KB
testcase_27 AC 97 ms
78,064 KB
testcase_28 AC 98 ms
78,084 KB
testcase_29 AC 97 ms
77,968 KB
testcase_30 AC 55 ms
64,240 KB
testcase_31 AC 125 ms
81,480 KB
testcase_32 AC 92 ms
75,824 KB
testcase_33 AC 71 ms
70,932 KB
testcase_34 AC 55 ms
64,240 KB
testcase_35 AC 55 ms
64,240 KB
testcase_36 AC 168 ms
82,272 KB
testcase_37 AC 125 ms
81,636 KB
testcase_38 AC 122 ms
81,636 KB
testcase_39 AC 123 ms
81,632 KB
testcase_40 AC 121 ms
81,632 KB
testcase_41 AC 124 ms
81,632 KB
testcase_42 AC 55 ms
64,240 KB
testcase_43 AC 95 ms
75,824 KB
testcase_44 AC 74 ms
70,932 KB
testcase_45 AC 56 ms
64,240 KB
testcase_46 AC 55 ms
64,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
omega = pow(3,119,mod)
rev_omega = pow(omega,mod-2,mod)

def cmb(n, r, mod):#コンビネーションの高速計算 
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

N = 2*10**5
g1 = [1]*(N+1) # 元テーブル
g2 = [1]*(N+1) #逆元テーブル
inv = [1]*(N+1) #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1[i]=( ( g1[i-1] * i ) % mod )
    inv[i]=( ( -inv[mod % i] * (mod//i) ) % mod )
    g2[i]=( (g2[i-1] * inv[i]) % mod )
inv[0]=0

N,M,K = map(int,input().split())

res = 0
for i in range(K+1):
    res += cmb(K,i,mod) * pow(K-i+M,N,mod) * pow(-1,i,mod)
    res %= mod

res *= cmb(M,K,mod)
res %= mod
print(res)
0