結果

問題 No.2113 Distance Sequence 1.5
ユーザー 👑 ygussanyygussany
提出日時 2022-10-28 22:13:39
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 1,025 ms
コンパイル使用メモリ 28,612 KB
実行使用メモリ 5,176 KB
最終ジャッジ日時 2023-09-20 05:13:33
合計ジャッジ時間 1,976 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,376 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,500 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 0 ms
4,380 KB
testcase_15 WA -
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 0 ms
4,376 KB
testcase_20 WA -
testcase_21 AC 1 ms
4,376 KB
testcase_22 WA -
testcase_23 AC 1 ms
4,376 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

const int Mod = 998244353;

long long pow_mod(int n, long long k)
{
	long long N, ans = 1;
	for (N = n; k > 0; k >>= 1, N = N * N % Mod) if (k & 1) ans = ans * N % Mod;
	return ans;
}

int main()
{
	long long N, M, K;
	scanf("%lld %lld %lld", &N, &M, &K);
	printf("%lld\n", ((M - K) % Mod * (pow_mod(K % Mod, N * 2) - pow_mod((K - 1) % Mod, N * 2) + Mod) + pow_mod(K % Mod, N * 2)) % Mod);
	fflush(stdout);
	return 0;
}
0