結果
| 問題 | 
                            No.2007 Arbitrary Mod (Easy)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-08-12 14:45:20 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 361 bytes | 
| コンパイル時間 | 1,497 ms | 
| コンパイル使用メモリ | 165,696 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-22 17:15:36 | 
| 合計ジャッジ時間 | 4,303 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 30 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
long long int modpow(long long int a,long long int n,long long int mod){
  long long int res = 1;
  while(n>0){
    if(n&1) res = res*a%mod;
    a = a*a%mod;
    n >>= 1;
  }
  return res;
}
int main(){
  long long int A,N,MOD=998244353;
  cin >> A >> N;
  cout << MOD << endl;
  cout << modpow(A,N,MOD) << endl;
}