結果

問題 No.167 N^M mod 10
ユーザー mobius_bkstmobius_bkst
提出日時 2015-04-29 20:24:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 184 ms / 1,000 ms
コード長 609 bytes
コンパイル時間 3,625 ms
コンパイル使用メモリ 75,144 KB
実行使用メモリ 39,428 KB
最終ジャッジ日時 2023-10-21 23:48:55
合計ジャッジ時間 7,221 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
36,840 KB
testcase_01 AC 54 ms
36,888 KB
testcase_02 AC 181 ms
39,428 KB
testcase_03 AC 184 ms
39,232 KB
testcase_04 AC 107 ms
38,788 KB
testcase_05 AC 53 ms
36,808 KB
testcase_06 AC 53 ms
36,824 KB
testcase_07 AC 53 ms
36,848 KB
testcase_08 AC 54 ms
36,848 KB
testcase_09 AC 53 ms
36,860 KB
testcase_10 AC 54 ms
36,816 KB
testcase_11 AC 57 ms
36,800 KB
testcase_12 AC 53 ms
36,852 KB
testcase_13 AC 53 ms
36,836 KB
testcase_14 AC 54 ms
36,840 KB
testcase_15 AC 54 ms
36,876 KB
testcase_16 AC 55 ms
36,844 KB
testcase_17 AC 56 ms
36,836 KB
testcase_18 AC 55 ms
36,800 KB
testcase_19 AC 54 ms
36,884 KB
testcase_20 AC 54 ms
36,844 KB
testcase_21 AC 55 ms
36,832 KB
testcase_22 AC 155 ms
39,108 KB
testcase_23 AC 156 ms
39,116 KB
testcase_24 AC 156 ms
39,048 KB
testcase_25 AC 159 ms
38,916 KB
testcase_26 AC 104 ms
38,668 KB
testcase_27 AC 175 ms
39,164 KB
testcase_28 AC 137 ms
38,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No167 {

    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(
                    System.in));
            BigInteger N = new BigInteger(br.readLine());
            BigInteger M = new BigInteger(br.readLine());
            BigInteger mod = new BigInteger("10");
            System.out.println(N.modPow(M, mod));
        } catch (Exception e) {
            System.err.println("Error:" + e.getMessage());
        }
    }
}
0