結果
| 問題 | No.2007 Arbitrary Mod (Easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-15 21:21:26 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 503 bytes |
| 記録 | |
| コンパイル時間 | 1,213 ms |
| コンパイル使用メモリ | 206,540 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2026-03-15 17:55:41 |
| 合計ジャッジ時間 | 3,019 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<iomanip>
#include<numeric>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
const int mod=998244353;
int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
ll mypow(int x,ll n){
if(n==0)
return 1;
if(n%2==1)
return mypow(x,n-1)*x%mod;
ll res=mypow(x,n/2);
return res*res%mod;
}
int main(){
int a;
ll n;
cin>>a>>n;
cout<<mod<<endl;
cout<<mypow(a,n)<<endl;
}