結果

問題 No.167 N^M mod 10
ユーザー AEn
提出日時 2022-05-15 11:48:42
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 173 bytes
コンパイル時間 1,013 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 67,212 KB
最終ジャッジ日時 2024-07-26 19:01:46
合計ジャッジ時間 2,688 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16 WA * 1 RE * 10
権限があれば一括ダウンロードができます

ソースコード

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