結果
| 問題 | No.403 2^2^2 |
| コンテスト | |
| ユーザー |
ei1333333
|
| 提出日時 | 2018-11-21 22:43:35 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 482 bytes |
| 記録 | |
| コンパイル時間 | 1,323 ms |
| コンパイル使用メモリ | 210,512 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-07 04:14:29 |
| 合計ジャッジ時間 | 2,672 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
int64_t power(int64_t x, int64_t n, int64_t mod) {
int64_t ret = 1;
while(n > 0) {
if(n & 1) (ret *= x) %= mod;
(x *= x) %= mod;
n >>= 1;
}
return (ret);
}
const int mod = 1e9 + 7;
int main() {
int64 A, B, C;
scanf("%lld^%lld^%lld", &A, &B, &C);
A %= mod;
B %= mod;
C %= mod;
cout << power(power(A, B, mod), C, mod) << " " << power(A, power(B, C, mod - 1), mod) << endl;
}
ei1333333