結果

問題 No.167 N^M mod 10
ユーザー kuramukuramu
提出日時 2016-01-29 11:59:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 183 ms / 1,000 ms
コード長 543 bytes
コンパイル時間 2,440 ms
コンパイル使用メモリ 74,712 KB
実行使用メモリ 56,292 KB
最終ジャッジ日時 2023-10-22 00:01:23
合計ジャッジ時間 5,816 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
53,668 KB
testcase_01 AC 55 ms
53,672 KB
testcase_02 AC 183 ms
56,292 KB
testcase_03 AC 173 ms
56,204 KB
testcase_04 AC 111 ms
55,508 KB
testcase_05 AC 55 ms
53,672 KB
testcase_06 AC 55 ms
53,676 KB
testcase_07 AC 55 ms
53,664 KB
testcase_08 AC 55 ms
53,668 KB
testcase_09 AC 55 ms
53,672 KB
testcase_10 AC 56 ms
53,676 KB
testcase_11 AC 56 ms
53,676 KB
testcase_12 AC 55 ms
53,668 KB
testcase_13 AC 59 ms
53,672 KB
testcase_14 AC 55 ms
53,672 KB
testcase_15 AC 56 ms
53,672 KB
testcase_16 AC 55 ms
53,668 KB
testcase_17 AC 56 ms
53,676 KB
testcase_18 AC 56 ms
53,704 KB
testcase_19 AC 55 ms
53,672 KB
testcase_20 AC 56 ms
53,668 KB
testcase_21 AC 56 ms
53,668 KB
testcase_22 AC 157 ms
55,768 KB
testcase_23 AC 151 ms
55,960 KB
testcase_24 AC 159 ms
55,768 KB
testcase_25 AC 165 ms
55,752 KB
testcase_26 AC 92 ms
54,760 KB
testcase_27 AC 165 ms
55,760 KB
testcase_28 AC 118 ms
55,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args) {
	      BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
	      try {
	    	  BigInteger n = new BigInteger(stdReader.readLine());
	    	  BigInteger m = new BigInteger(stdReader.readLine());
	    	  System.out.println(n.modPow(m, BigInteger.valueOf(10)));
	      } catch (IOException e) {
			e.printStackTrace();
	      }
	}
}
0