結果

問題 No.2007 Arbitrary Mod (Easy)
ユーザー forest3
提出日時 2022-07-28 18:11:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 1,455 ms
コンパイル使用メモリ 166,544 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-18 08:49:17
合計ジャッジ時間 3,774 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
	long long a, n;
	cin >> a >> n;

	long long m = 998244353;
	long long ans = 1;
	long long x = a;
	while( n ) {
		if( n % 2 ) ans = ans * x % m;
		x = x * x % m;
		n /= 2;
	}

	cout << m << endl;
	cout << ans << endl;
}
0