結果
| 問題 |
No.1578 A × B × C
|
| コンテスト | |
| ユーザー |
kkkk97368086
|
| 提出日時 | 2021-12-06 10:29:41 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 634 bytes |
| コンパイル時間 | 825 ms |
| コンパイル使用メモリ | 90,912 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-07 08:51:43 |
| 合計ジャッジ時間 | 1,643 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<ios>
#include<iomanip>
#include<cmath>
#include<limits>
#include<algorithm>
using namespace std;
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;
}
long long MOD = 1000000007;
int main(){
long long a,b,c,k;
cin >> a >> b >> c;
cin >> k;
long long digit = modpow(2,k,MOD-1);
(a*=b)%=MOD;
(a*=c)%=MOD;
cout << modpow(a,digit,MOD) << endl;
return 0;
}
kkkk97368086