結果
| 問題 |
No.2007 Arbitrary Mod (Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-15 22:31:21 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,218 bytes |
| コンパイル時間 | 947 ms |
| コンパイル使用メモリ | 95,528 KB |
| 最終ジャッジ日時 | 2025-01-30 08:20:32 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 30 |
ソースコード
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll LLINF {1001002003004005006};//ll = 9*LLINF
constexpr int INTINF {1000000000};//int = 2*INTINF
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for(int i = s; i < t; ++i)
template<typename T>
void maxs(T& x, T&& y) {
x=std::max(x,y);
}
template<typename T>
void maxs(T& x, T& y) {
x=std::max(x,y);
}
template<typename T>
void mins(T& x, T&& y) {
x=std::min(x,y);
}
template<typename T>
void mins(T& x, T& y) {
x=std::min(x,y);
}
namespace kosei {
ll pow(ll a, ll n, ll m) {
ll t {a}, ans{1};
for (ll i = n;i !=0;i>>=1) {
if (i & 1) ans *= t;
t *= t;
t %= m;
ans %= m;
}
return ans;
}
}
int main() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll a, n;
cin >> a >> n;
ll m {998244353};
//ll m {10000000};
cout << kosei::pow(a,n,m) << '\n';
}