結果

問題 No.2113 Distance Sequence 1.5
ユーザー 👑 rin204rin204
提出日時 2022-10-28 21:53:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 218 bytes
コンパイル時間 1,188 ms
コンパイル使用メモリ 86,576 KB
実行使用メモリ 71,516 KB
最終ジャッジ日時 2023-09-20 04:48:23
合計ジャッジ時間 4,494 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,304 KB
testcase_01 WA -
testcase_02 AC 76 ms
71,368 KB
testcase_03 AC 76 ms
71,304 KB
testcase_04 AC 79 ms
71,052 KB
testcase_05 AC 77 ms
71,172 KB
testcase_06 AC 77 ms
71,492 KB
testcase_07 WA -
testcase_08 AC 76 ms
71,000 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 78 ms
71,140 KB
testcase_15 WA -
testcase_16 AC 75 ms
70,964 KB
testcase_17 AC 77 ms
71,180 KB
testcase_18 AC 74 ms
71,112 KB
testcase_19 AC 76 ms
71,280 KB
testcase_20 WA -
testcase_21 AC 76 ms
71,192 KB
testcase_22 WA -
testcase_23 AC 75 ms
71,004 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

n, m, k = map(int, input().split())
if k >= m:
    print(pow(m, 2 + n, MOD))
    exit()
ans = pow(k, 2 * n, MOD) - pow(k - 1, 2 * n, MOD)
ans *= m - k + 1
ans += pow(k - 1, 2 * n, MOD)
print(ans % MOD)
0