結果

問題 No.167 N^M mod 10
ユーザー kenkooookenkoooo
提出日時 2015-03-19 23:35:56
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 3,013 ms
コンパイル使用メモリ 72,040 KB
実行使用メモリ 56,940 KB
最終ジャッジ日時 2023-09-11 08:42:00
合計ジャッジ時間 9,440 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 152 ms
56,940 KB
testcase_03 AC 150 ms
56,440 KB
testcase_04 WA -
testcase_05 AC 117 ms
55,496 KB
testcase_06 WA -
testcase_07 RE -
testcase_08 AC 125 ms
55,532 KB
testcase_09 AC 120 ms
55,808 KB
testcase_10 RE -
testcase_11 AC 124 ms
55,588 KB
testcase_12 RE -
testcase_13 WA -
testcase_14 RE -
testcase_15 AC 120 ms
55,440 KB
testcase_16 AC 118 ms
55,776 KB
testcase_17 AC 121 ms
55,756 KB
testcase_18 AC 119 ms
55,692 KB
testcase_19 AC 122 ms
55,716 KB
testcase_20 AC 122 ms
55,716 KB
testcase_21 AC 121 ms
55,644 KB
testcase_22 AC 152 ms
56,396 KB
testcase_23 AC 152 ms
56,452 KB
testcase_24 AC 157 ms
56,476 KB
testcase_25 AC 158 ms
56,804 KB
testcase_26 RE -
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String nString = sc.next();
		String mString = sc.next();
		sc.close();
		int a = Character.getNumericValue(nString.charAt(nString.length() - 1));
		int b = Integer.parseInt(mString.substring(mString.length() - 2, mString.length()));
		b %= 4;

		System.out.println((int) (Math.pow(a, b) % 10));

	}
}
0