結果

問題 No.167 N^M mod 10
ユーザー tsunabittsunabit
提出日時 2020-03-09 23:56:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 237 ms / 1,000 ms
コード長 304 bytes
コンパイル時間 3,398 ms
コンパイル使用メモリ 72,080 KB
実行使用メモリ 58,572 KB
最終ジャッジ日時 2023-08-09 21:07:47
合計ジャッジ時間 9,162 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,120 KB
testcase_01 AC 122 ms
55,836 KB
testcase_02 AC 237 ms
56,708 KB
testcase_03 AC 236 ms
58,572 KB
testcase_04 AC 179 ms
58,440 KB
testcase_05 AC 123 ms
55,516 KB
testcase_06 AC 123 ms
55,712 KB
testcase_07 AC 122 ms
55,508 KB
testcase_08 AC 123 ms
55,816 KB
testcase_09 AC 121 ms
55,976 KB
testcase_10 AC 122 ms
55,548 KB
testcase_11 AC 125 ms
55,804 KB
testcase_12 AC 122 ms
55,700 KB
testcase_13 AC 122 ms
55,920 KB
testcase_14 AC 123 ms
55,700 KB
testcase_15 AC 122 ms
55,552 KB
testcase_16 AC 124 ms
53,704 KB
testcase_17 AC 123 ms
55,400 KB
testcase_18 AC 122 ms
55,508 KB
testcase_19 AC 121 ms
55,764 KB
testcase_20 AC 125 ms
55,744 KB
testcase_21 AC 125 ms
55,856 KB
testcase_22 AC 218 ms
56,884 KB
testcase_23 AC 220 ms
56,364 KB
testcase_24 AC 215 ms
56,620 KB
testcase_25 AC 217 ms
56,512 KB
testcase_26 AC 156 ms
55,788 KB
testcase_27 AC 228 ms
56,408 KB
testcase_28 AC 192 ms
56,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No167 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		BigInteger n = new BigInteger(sc.next());
		BigInteger m = new BigInteger(sc.next());
		System.out.println(n.modPow(m, BigInteger.TEN));
	}
}
0