結果

問題 No.167 N^M mod 10
ユーザー AEnAEn
提出日時 2022-05-15 11:49:24
言語 PyPy3
(7.3.15)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 208 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 79,332 KB
最終ジャッジ日時 2023-10-09 20:45:35
合計ジャッジ時間 4,607 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,484 KB
testcase_01 AC 74 ms
71,176 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 74 ms
71,376 KB
testcase_06 AC 73 ms
71,324 KB
testcase_07 AC 73 ms
71,436 KB
testcase_08 AC 73 ms
71,132 KB
testcase_09 AC 74 ms
71,380 KB
testcase_10 AC 73 ms
71,356 KB
testcase_11 AC 73 ms
71,664 KB
testcase_12 AC 74 ms
71,412 KB
testcase_13 AC 74 ms
71,556 KB
testcase_14 AC 74 ms
71,596 KB
testcase_15 AC 73 ms
71,248 KB
testcase_16 AC 75 ms
71,240 KB
testcase_17 AC 74 ms
71,608 KB
testcase_18 AC 73 ms
71,612 KB
testcase_19 AC 74 ms
71,488 KB
testcase_20 AC 74 ms
71,612 KB
testcase_21 AC 74 ms
71,448 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())
if M == 0:
    print(1)
    exit()
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