結果
| 問題 |
No.1578 A × B × C
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-02 22:30:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 611 bytes |
| コンパイル時間 | 441 ms |
| コンパイル使用メモリ | 67,312 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-29 12:19:49 |
| 合計ジャッジ時間 | 1,134 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
#include <iostream>
#include <cstring>
#include <algorithm>
#define ll long long
using namespace std;
const ll mod1=1e9+7;
const ll mod2=1e9+6;
ll POW(ll x,ll y,ll mod){
ll sum=1;
while(y){
if(y&1) sum=((sum%mod)*(x%mod))%mod;
x=((x%mod)*(x%mod))%mod;
y>>=1;
}
return sum;
}
int main(){
ios::sync_with_stdio(false);
ll a,b,c;
cin>>a>>b>>c;
ll k;cin>>k;
ll ans=1;
k=POW(2,k,mod2);
ans*=POW(a,k,mod1);
ans%=mod1;
ans*=POW(b,k,mod1);
ans%=mod1;
ans*=POW(c,k,mod1);
ans%=mod1;
cout<<ans<<endl;
return 0;
}