結果

問題 No.403 2^2^2
ユーザー ぴろずぴろず
提出日時 2016-07-22 23:08:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 1,988 ms
コンパイル使用メモリ 77,056 KB
実行使用メモリ 42,800 KB
最終ジャッジ日時 2024-04-24 02:35:08
合計ジャッジ時間 6,843 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
42,260 KB
testcase_01 AC 121 ms
41,888 KB
testcase_02 AC 135 ms
42,396 KB
testcase_03 AC 118 ms
42,188 KB
testcase_04 AC 119 ms
42,160 KB
testcase_05 AC 141 ms
42,732 KB
testcase_06 AC 130 ms
42,456 KB
testcase_07 AC 130 ms
42,032 KB
testcase_08 AC 123 ms
41,928 KB
testcase_09 AC 132 ms
42,112 KB
testcase_10 AC 126 ms
42,272 KB
testcase_11 AC 118 ms
42,168 KB
testcase_12 AC 120 ms
42,048 KB
testcase_13 AC 133 ms
42,524 KB
testcase_14 AC 136 ms
42,436 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 136 ms
42,320 KB
testcase_18 AC 130 ms
41,980 KB
testcase_19 AC 135 ms
42,444 KB
testcase_20 AC 124 ms
42,296 KB
testcase_21 AC 132 ms
42,240 KB
testcase_22 AC 133 ms
42,524 KB
testcase_23 AC 134 ms
42,436 KB
testcase_24 AC 133 ms
42,372 KB
testcase_25 WA -
testcase_26 AC 120 ms
42,164 KB
testcase_27 AC 133 ms
42,732 KB
testcase_28 AC 130 ms
42,248 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

package no403;

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static BigInteger MOD = BigInteger.valueOf(1000000007);
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] s = sc.next().split("\\^");
		BigInteger a = new BigInteger(s[0]);
		BigInteger b = new BigInteger(s[1]);
		BigInteger c = new BigInteger(s[2]);
		BigInteger x = a.modPow(b, MOD).modPow(c, MOD);
		BigInteger y = a.modPow(b.modPow(c, MOD.subtract(BigInteger.ONE)), MOD);
		System.out.println(x + " " + y);
	}
}
0