結果

問題 No.167 N^M mod 10
ユーザー tsunabittsunabit
提出日時 2020-03-09 23:56:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 225 ms / 1,000 ms
コード長 304 bytes
コンパイル時間 3,504 ms
コンパイル使用メモリ 77,060 KB
実行使用メモリ 54,720 KB
最終ジャッジ日時 2024-04-27 15:36:49
合計ジャッジ時間 8,367 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
54,140 KB
testcase_01 AC 101 ms
52,964 KB
testcase_02 AC 203 ms
54,388 KB
testcase_03 AC 212 ms
54,584 KB
testcase_04 AC 167 ms
53,960 KB
testcase_05 AC 120 ms
53,976 KB
testcase_06 AC 118 ms
53,984 KB
testcase_07 AC 116 ms
53,864 KB
testcase_08 AC 117 ms
54,016 KB
testcase_09 AC 115 ms
54,016 KB
testcase_10 AC 119 ms
54,120 KB
testcase_11 AC 116 ms
54,044 KB
testcase_12 AC 104 ms
53,072 KB
testcase_13 AC 106 ms
54,288 KB
testcase_14 AC 116 ms
53,972 KB
testcase_15 AC 110 ms
53,496 KB
testcase_16 AC 115 ms
54,016 KB
testcase_17 AC 114 ms
54,292 KB
testcase_18 AC 116 ms
53,832 KB
testcase_19 AC 112 ms
53,760 KB
testcase_20 AC 120 ms
54,284 KB
testcase_21 AC 120 ms
53,692 KB
testcase_22 AC 225 ms
54,456 KB
testcase_23 AC 223 ms
54,720 KB
testcase_24 AC 209 ms
54,428 KB
testcase_25 AC 210 ms
54,536 KB
testcase_26 AC 131 ms
53,104 KB
testcase_27 AC 198 ms
54,452 KB
testcase_28 AC 171 ms
54,512 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