結果

問題 No.1578 A × B × C
ユーザー momoyuu
提出日時 2024-08-07 21:58:20
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 1,078 ms
コンパイル使用メモリ 101,252 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-08-07 21:58:23
合計ジャッジ時間 2,056 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
using ll = long long;

#include<atcoder/modint>
using mint = atcoder::modint1000000007;

ll mpow(ll n,ll k,ll mod){
    ll a = 1;
    while(k){
        if(k&1) a = (a*n) % mod;
        n = (n*n) % mod;
        k >>= 1;
    }
    return a;
}
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    ll a,b,c;
    cin>>a>>b>>c;
    ll k;
    cin>>k;
    ll use = mpow(2,k,1000000006);
    mint ans = mint(a) * mint(b) * mint(c);
    ans = ans.pow(use);
    cout<<ans.val()<<endl;
}   

0