結果

問題 No.167 N^M mod 10
ユーザー gorugo30gorugo30
提出日時 2021-03-16 23:00:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 214 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 82,028 KB
実行使用メモリ 67,400 KB
最終ジャッジ日時 2024-04-26 06:00:30
合計ジャッジ時間 2,388 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 38 ms
52,420 KB
testcase_02 AC 37 ms
53,432 KB
testcase_03 AC 37 ms
53,768 KB
testcase_04 WA -
testcase_05 AC 37 ms
53,064 KB
testcase_06 AC 37 ms
52,736 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 36 ms
52,572 KB
testcase_15 RE -
testcase_16 AC 38 ms
53,324 KB
testcase_17 AC 38 ms
52,084 KB
testcase_18 AC 37 ms
52,072 KB
testcase_19 AC 37 ms
52,380 KB
testcase_20 AC 36 ms
52,248 KB
testcase_21 AC 37 ms
53,628 KB
testcase_22 AC 37 ms
53,904 KB
testcase_23 AC 36 ms
52,444 KB
testcase_24 AC 37 ms
52,000 KB
testcase_25 AC 37 ms
52,756 KB
testcase_26 AC 37 ms
52,164 KB
testcase_27 AC 35 ms
52,880 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input()[-1])
M = input()
if M == "0":
    print(1)
    exit()
ans2 = 1
if len(M) > 2:
    M = int(M[len(M) - 2:])
    ans2 = 6

if N % 2 == 0:
    print((ans2 * N ** M) % 10)
else:
    print((N ** M) % 10)
0