結果

問題 No.167 N^M mod 10
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-03-20 07:46:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 163 ms / 1,000 ms
コード長 898 bytes
コンパイル時間 4,482 ms
コンパイル使用メモリ 75,372 KB
実行使用メモリ 56,304 KB
最終ジャッジ日時 2023-10-21 23:43:21
合計ジャッジ時間 7,456 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
53,744 KB
testcase_01 AC 54 ms
52,636 KB
testcase_02 AC 158 ms
56,012 KB
testcase_03 AC 163 ms
56,076 KB
testcase_04 AC 106 ms
55,488 KB
testcase_05 AC 53 ms
53,752 KB
testcase_06 AC 51 ms
53,748 KB
testcase_07 AC 53 ms
53,752 KB
testcase_08 AC 53 ms
53,748 KB
testcase_09 AC 52 ms
53,692 KB
testcase_10 AC 50 ms
53,748 KB
testcase_11 AC 51 ms
53,740 KB
testcase_12 AC 50 ms
53,748 KB
testcase_13 AC 52 ms
53,752 KB
testcase_14 AC 53 ms
53,736 KB
testcase_15 AC 53 ms
53,752 KB
testcase_16 AC 52 ms
53,744 KB
testcase_17 AC 51 ms
53,752 KB
testcase_18 AC 54 ms
53,740 KB
testcase_19 AC 53 ms
53,744 KB
testcase_20 AC 52 ms
53,756 KB
testcase_21 AC 51 ms
53,752 KB
testcase_22 AC 139 ms
55,980 KB
testcase_23 AC 145 ms
55,840 KB
testcase_24 AC 147 ms
56,048 KB
testcase_25 AC 144 ms
56,104 KB
testcase_26 AC 95 ms
55,328 KB
testcase_27 AC 156 ms
56,304 KB
testcase_28 AC 119 ms
55,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.BigInteger;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class No167 {

    static final InputStream in = System.in;
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BigInteger n = new BigInteger(br.readLine());
        BigInteger m = new BigInteger(br.readLine());
        out.println(n.modPow(m,BigInteger.TEN));
    }

    public static void main(String[] args) throws Exception {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        in.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0