結果
| 問題 |
No.2007 Arbitrary Mod (Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-27 23:39:42 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 515 bytes |
| コンパイル時間 | 4,217 ms |
| コンパイル使用メモリ | 250,080 KB |
| 最終ジャッジ日時 | 2025-02-09 21:15:08 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 10 WA * 20 |
ソースコード
#include <atcoder/all>
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
typedef long long ll;
using namespace atcoder;
using namespace std;
using mint = modint998244353;
mint modpow(ll a, ll b) {
mint ans = 1;
while (b) {
if (b % 2 == 1) ans *= a;
b /= 2;
a *= a;
}
return ans;
}
int main() {
cin.tie(0)->sync_with_stdio(0);
ll a, n;
cin >> a >> n;
cout << 998244353 << "\n";
cout << modpow(a, n).val() << "\n";
return 0;
}