結果

問題 No.2113 Distance Sequence 1.5
ユーザー roarisroaris
提出日時 2022-10-28 22:49:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 269 bytes
コンパイル時間 969 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 71,848 KB
最終ジャッジ日時 2023-09-20 05:59:14
合計ジャッジ時間 5,248 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,700 KB
testcase_01 AC 92 ms
71,616 KB
testcase_02 AC 92 ms
71,764 KB
testcase_03 AC 94 ms
71,564 KB
testcase_04 AC 93 ms
71,736 KB
testcase_05 AC 92 ms
71,676 KB
testcase_06 AC 96 ms
71,644 KB
testcase_07 WA -
testcase_08 AC 96 ms
71,512 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 96 ms
71,476 KB
testcase_15 WA -
testcase_16 AC 93 ms
71,728 KB
testcase_17 AC 95 ms
71,512 KB
testcase_18 AC 93 ms
71,840 KB
testcase_19 AC 91 ms
71,536 KB
testcase_20 WA -
testcase_21 AC 95 ms
71,652 KB
testcase_22 WA -
testcase_23 AC 95 ms
71,828 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