結果

問題 No.167 N^M mod 10
ユーザー 学ぶマン
提出日時 2025-03-04 13:24:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 233 bytes
コンパイル時間 648 ms
コンパイル使用メモリ 82,224 KB
実行使用メモリ 54,120 KB
最終ジャッジ日時 2025-03-04 13:24:46
合計ジャッジ時間 3,180 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, math
sys.set_int_max_str_digits(0)
INF = 10**18
MOD = 998244353

N = input()
M = input()

if M == '0':
    exit(print(1))
if N[-1] == '0':
    exit(print(0))

N = int(N[-1])
M = int(M[-2:])
ans = pow(N, M, 10)
print(ans)
0