結果

問題 No.1836 Max Matrix
ユーザー ytft
提出日時 2022-02-12 19:13:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 394 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 75,904 KB
最終ジャッジ日時 2024-06-28 21:49:17
合計ジャッジ時間 4,332 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

def p(a,p,mod):
    ans=1
    while p>0:
        if p%2:
            ans=ans*a%mod
        a=a*a%mod
        p=p//2
    return ans
    
    
    
H,W,M=map(int,input().split())
mod=998244353
ans=0
for m in range(1,M+1):
    ans+=(p(M-m+1,H,mod)-p(M-m,H,mod))*(p(M-m+1,W,mod)-p(M-m,W,mod))
    ans%=mod
print(ans)
    
0