結果
| 問題 |
No.403 2^2^2
|
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2016-07-23 00:43:16 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 742 bytes |
| コンパイル時間 | 1,036 ms |
| コンパイル使用メモリ | 67,388 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-06 13:13:55 |
| 合計ジャッジ時間 | 1,969 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 WA * 7 |
ソースコード
#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cassert>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
ll modpow(ll x, ll y, ll m) {
x %= mod;
if(y == 0) return 1;
ll res = modpow(x, y / 2, m);
return res * res % m * (y & 1 ? x : 1) % m;
}
ll modinv(ll x, ll m) {
return modpow(x, m - 2, m);
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll A, B, C;
char c;
cin >> A >> c >> B >> c >> C;
if(A % mod == 0) {
cout << "0 0" << endl;
return 0;
}
ll Ab = modpow(A, B, mod);
ll Bc = modpow(B, C, mod - 1);
ll ans1 = modpow(Ab, C, mod);
ll ans2 = modpow(A, Bc, mod);
cout << ans1 << " " << ans2 << endl;
}
femto