結果

問題 No.167 N^M mod 10
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-03-20 07:21:25
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 916 bytes
コンパイル時間 4,318 ms
コンパイル使用メモリ 73,276 KB
実行使用メモリ 97,080 KB
最終ジャッジ日時 2023-09-11 09:02:57
合計ジャッジ時間 9,537 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 327 ms
61,808 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 371 ms
56,800 KB
testcase_06 AC 44 ms
49,388 KB
testcase_07 AC 44 ms
49,772 KB
testcase_08 AC 44 ms
49,600 KB
testcase_09 AC 44 ms
49,496 KB
testcase_10 AC 43 ms
49,576 KB
testcase_11 AC 44 ms
49,836 KB
testcase_12 AC 44 ms
49,664 KB
testcase_13 AC 44 ms
49,680 KB
testcase_14 AC 44 ms
49,388 KB
testcase_15 AC 45 ms
49,636 KB
testcase_16 AC 51 ms
50,228 KB
testcase_17 AC 140 ms
55,896 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.167 N^M mod 10

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 bi = new BigInteger(br.readLine());
        bi = bi.pow(Integer.parseInt(br.readLine())).mod(BigInteger.TEN);
        out.println(bi);
    }

    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