結果

問題 No.167 N^M mod 10
ユーザー lloyz
提出日時 2023-06-07 00:03:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 166 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-12-29 08:50:33
合計ジャッジ時間 2,554 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

N = list(map(int, list(input())))
M = list(map(int, list(input())))

m = M[-1]
n = N[-1]
if m == 0:
    print(0)
    exit()
m -= 1
m %= 4
m += 1
print(pow(n, m, 10))
0