結果

問題 No.2113 Distance Sequence 1.5
ユーザー roarisroaris
提出日時 2022-10-28 22:50:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 268 bytes
コンパイル時間 1,182 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 71,812 KB
最終ジャッジ日時 2023-09-20 06:01:07
合計ジャッジ時間 4,878 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
71,712 KB
testcase_01 AC 95 ms
71,808 KB
testcase_02 AC 94 ms
71,804 KB
testcase_03 AC 94 ms
71,416 KB
testcase_04 AC 93 ms
71,448 KB
testcase_05 AC 95 ms
71,768 KB
testcase_06 AC 91 ms
71,412 KB
testcase_07 WA -
testcase_08 AC 99 ms
71,588 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 93 ms
71,616 KB
testcase_15 WA -
testcase_16 AC 95 ms
71,540 KB
testcase_17 AC 92 ms
71,540 KB
testcase_18 AC 92 ms
71,808 KB
testcase_19 AC 94 ms
71,568 KB
testcase_20 WA -
testcase_21 AC 93 ms
71,580 KB
testcase_22 WA -
testcase_23 AC 94 ms
71,580 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N, M, K = map(int, input().split())
ans = 0
MOD = 998244353

if M-K+1>0:
    ans += (M-K+1)*(pow(K, 2*N, MOD)-pow(K-1, 2*N, MOD))%MOD

if M-K+1<M:
    ans += pow(K-1, 2*N, MOD)
    ans %= MOD

print(ans)
0