結果
| 問題 | No.2007 Arbitrary Mod (Easy) |
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2022-07-28 18:11:30 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 280 bytes |
| 記録 | |
| コンパイル時間 | 1,002 ms |
| コンパイル使用メモリ | 183,848 KB |
| 実行使用メモリ | 189,548 KB |
| 最終ジャッジ日時 | 2026-04-02 00:33:16 |
| 合計ジャッジ時間 | 3,551 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#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;
}
forest3