結果

問題 No.1578 A × B × C
ユーザー chacoder1
提出日時 2021-12-30 19:18:19
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 1,851 ms
コンパイル使用メモリ 193,708 KB
最終ジャッジ日時 2025-01-27 07:42:41
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
static const int mod=1000000007;

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

signed main(){
  int a,b,c,k;cin>>a>>b>>c>>k;
  int ans=a*b%mod;
  ans*=c;
  c%=mod;
  ans=modpow(ans,k+1,mod);
  cout<<ans<<endl;
  return 0;
}
0