結果

問題 No.2113 Distance Sequence 1.5
ユーザー 👑 KazunKazun
提出日時 2022-10-28 23:29:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 71,524 KB
最終ジャッジ日時 2023-09-20 06:47:01
合計ジャッジ時間 3,338 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,152 KB
testcase_01 AC 77 ms
71,088 KB
testcase_02 AC 76 ms
71,228 KB
testcase_03 AC 76 ms
71,304 KB
testcase_04 AC 76 ms
71,240 KB
testcase_05 AC 74 ms
71,416 KB
testcase_06 AC 73 ms
71,444 KB
testcase_07 AC 74 ms
71,524 KB
testcase_08 AC 75 ms
71,160 KB
testcase_09 AC 76 ms
71,436 KB
testcase_10 AC 75 ms
71,284 KB
testcase_11 AC 74 ms
71,288 KB
testcase_12 AC 76 ms
71,176 KB
testcase_13 AC 76 ms
71,360 KB
testcase_14 AC 78 ms
71,264 KB
testcase_15 AC 77 ms
71,480 KB
testcase_16 AC 76 ms
71,152 KB
testcase_17 AC 74 ms
71,188 KB
testcase_18 AC 75 ms
71,152 KB
testcase_19 AC 77 ms
71,288 KB
testcase_20 AC 77 ms
71,488 KB
testcase_21 AC 74 ms
71,416 KB
testcase_22 AC 76 ms
71,264 KB
testcase_23 AC 74 ms
71,348 KB
testcase_24 AC 76 ms
71,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    """ 1<=A[i]<=M, len(A)=2*N, max(A)-min(A)<=K-1 となる整数列の個数は?

    [方針]
    min(A) で場合分け
    """

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

    K=min(K,M)
    X=((M-K)*(pow(K,2*N,Mod)-pow(K-1,2*N,Mod))+pow(K,2*N,Mod))%Mod

    return X


#==================================================
print(solve())
0