結果

問題 No.167 N^M mod 10
ユーザー AEnAEn
提出日時 2022-05-15 11:47:21
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 165 bytes
コンパイル時間 750 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 79,340 KB
最終ジャッジ日時 2023-10-09 20:42:50
合計ジャッジ時間 4,176 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
71,328 KB
testcase_01 AC 57 ms
71,420 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 59 ms
71,268 KB
testcase_06 AC 57 ms
71,532 KB
testcase_07 AC 57 ms
71,268 KB
testcase_08 AC 58 ms
71,240 KB
testcase_09 AC 57 ms
71,476 KB
testcase_10 WA -
testcase_11 AC 59 ms
71,240 KB
testcase_12 AC 61 ms
71,076 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 60 ms
71,276 KB
testcase_17 AC 61 ms
71,444 KB
testcase_18 AC 60 ms
71,560 KB
testcase_19 AC 57 ms
71,196 KB
testcase_20 AC 59 ms
71,532 KB
testcase_21 AC 58 ms
71,272 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
M = int(input())
a = N%10
n = [a]
for i in range(5):
    a *= (N%10)
    a %= 10
    n.append(a)
    if a==(N%10):
        break
print(n[M%(i+1)-1])
0