結果

問題 No.403 2^2^2
ユーザー sterrod
提出日時 2021-11-17 19:21:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 1,778 ms
コンパイル使用メモリ 166,224 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 23:08:24
合計ジャッジ時間 2,937 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 2 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int p = 1000000007;

long long pow_re(long long a, long long n) {
    long long ans = 1;
    bitset<8> b(n);
    while (!b.none()) {
        if (b.test(0)) ans = ans * a % p;
        a = a * a % p;
        b = (b >> 1);
    }
    return ans;
}

int main() {
    long long a, b, c;
    cin >> a >> b >> c;
    cout << pow_re(pow_re(a, b), c) << " " << pow_re(a, pow_re(b, c)) << endl;
}
0