結果

問題 No.2079 aaabbc
ユーザー _yurimoir
提出日時 2022-10-14 21:14:54
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 387 bytes
コンパイル時間 3,348 ms
コンパイル使用メモリ 243,156 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-26 13:03:06
合計ジャッジ時間 4,280 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=998244353;

ll mpow(ll a,ll b){
    ll ret,apow;
    ret=1;apow=a;
    while(b){
        if((b&1)==1){
            ret=(ret*apow)%mod;
        }
        apow=(apow*apow)%mod;
        b=b>>1;
    }
    return ret;
}
int main(){
    ll n;
    cin>>n;
    ll ans=mpow(3,n);
    cout<<ans<<endl;
    return 0;
}
0