結果

問題 No.403 2^2^2
ユーザー 👑 はまやんはまやんはまやんはまやん
提出日時 2016-07-23 00:05:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 649 bytes
コンパイル時間 1,742 ms
コンパイル使用メモリ 162,592 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 02:47:41
合計ジャッジ時間 2,588 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
5,376 KB
testcase_14 WA -
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 2 ms
5,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)




typedef long long ll;
ll modpow(ll a, ll n, ll MOD) {
	a %= MOD;
	ll r = 1;
	while (n) r = r*((n % 2) ? a : 1) % MOD, a = a*a%MOD, n >>= 1;
	return r;
}
//-----------------------------------------------------------------
ll A, B, C;
ll mod = 1000000007;
ll solve1() {
	ll D = modpow(A, B, mod);
	return modpow(D, C, mod);
}
ll solve2() {
	ll D = modpow(B, C, mod);
	return modpow(A, D, mod);
}
//-----------------------------------------------------------------
int main()
{
	scanf("%lld^%lld^%lld", &A, &B, &C);
	cout << solve1() << " " << solve2() << endl;
}
0