結果
問題 |
No.1578 A × B × C
|
ユーザー |
![]() |
提出日時 | 2023-09-12 01:02:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 579 bytes |
コンパイル時間 | 1,779 ms |
コンパイル使用メモリ | 193,136 KB |
最終ジャッジ日時 | 2025-02-16 21:44:03 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> #include<iostream> #include<map> #include<vector> #include <algorithm> #include<math.h> #include <iomanip> #include<set> #include <numeric> #include<string> using ll = long long; using namespace std; ll mpow(ll x, ll n, ll mod){ ll ans = 1; while (n){ if (n&1) ans = ans * x % mod; x = x * x % mod; n >>= 1; } return ans; } int main() { ll a, b, c, n, mod = 1e9+7, r; cin >> a >> b >> c >> n; r = mpow(2, n, mod-1); a = a*b%mod; a = a*c%mod; a = mpow(a, r, mod); cout << a << endl; }