結果

問題 No.403 2^2^2
ユーザー kapokapo
提出日時 2016-07-28 07:49:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,183 bytes
コンパイル時間 615 ms
コンパイル使用メモリ 79,552 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 10:28:06
合計ジャッジ時間 1,361 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
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 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef vector<int> V;
typedef vector<vector<int> > VV;
typedef long long ll;
const int inf = 2e9;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

ll modpow(ll a, ll b, ll p)
{
	if (a == p) return 0;
	if (b == 0) return 1;

	ll ret = modpow(a, b/2, p);
	if (b%2 == 0) 
		 ret = (ret*ret)%p;
	else ret = (((ret*ret)%p)*a)%p; 

	return ret;
}

int main()
{
	char x;
	ll a, b, c;
	cin >> a >> x >> b >> x >> c;
	
	ll d = modpow(a,b,mod);
	ll e = modpow(d,c,mod);
	debug(d);
	cout << e << " ";

	ll f = modpow(b,c,mod-1);
	ll g = modpow(a,f,mod);
	cout << endl; debug(f);
	cout << g << endl;

	return 0;
}
0