結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,556 KB
testcase_01 AC 74 ms
71,652 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 73 ms
71,652 KB
testcase_06 AC 73 ms
71,236 KB
testcase_07 AC 75 ms
71,164 KB
testcase_08 AC 74 ms
71,316 KB
testcase_09 AC 73 ms
71,264 KB
testcase_10 AC 72 ms
71,612 KB
testcase_11 AC 73 ms
71,352 KB
testcase_12 AC 72 ms
71,456 KB
testcase_13 AC 74 ms
71,632 KB
testcase_14 WA -
testcase_15 AC 73 ms
71,628 KB
testcase_16 AC 74 ms
71,472 KB
testcase_17 AC 74 ms
71,464 KB
testcase_18 AC 75 ms
71,432 KB
testcase_19 AC 74 ms
71,352 KB
testcase_20 AC 74 ms
71,208 KB
testcase_21 AC 74 ms
71,408 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)%(i+1)])
0