結果
問題 | No.2007 Arbitrary Mod (Easy) |
ユーザー |
|
提出日時 | 2022-07-15 21:21:26 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 503 bytes |
コンパイル時間 | 1,236 ms |
コンパイル使用メモリ | 122,592 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 16:39:02 |
合計ジャッジ時間 | 3,790 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }