結果

問題 No.167 N^M mod 10
ユーザー kuramukuramu
提出日時 2016-01-29 11:58:26
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 541 bytes
コンパイル時間 1,950 ms
コンパイル使用メモリ 74,532 KB
実行使用メモリ 56,584 KB
最終ジャッジ日時 2023-10-21 16:34:50
合計ジャッジ時間 5,529 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
53,668 KB
testcase_01 AC 54 ms
53,660 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 109 ms
55,852 KB
testcase_05 WA -
testcase_06 AC 54 ms
53,660 KB
testcase_07 AC 56 ms
53,644 KB
testcase_08 AC 55 ms
53,660 KB
testcase_09 AC 55 ms
53,656 KB
testcase_10 AC 54 ms
53,660 KB
testcase_11 AC 55 ms
53,652 KB
testcase_12 WA -
testcase_13 AC 55 ms
53,660 KB
testcase_14 WA -
testcase_15 AC 55 ms
53,664 KB
testcase_16 AC 55 ms
53,660 KB
testcase_17 AC 55 ms
53,656 KB
testcase_18 AC 56 ms
53,664 KB
testcase_19 WA -
testcase_20 AC 54 ms
53,660 KB
testcase_21 AC 55 ms
53,648 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 156 ms
55,748 KB
testcase_25 AC 153 ms
55,944 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 127 ms
55,772 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(n, new BigInteger("10")));
	      } catch (IOException e) {
			e.printStackTrace();
	      }
	}
}
0