結果

問題 No.167 N^M mod 10
ユーザー dango
提出日時 2023-06-15 21:51:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 177 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 82,348 KB
実行使用メモリ 53,968 KB
最終ジャッジ日時 2024-06-23 19:31:36
合計ジャッジ時間 2,131 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input()[-1])
S = input()
M = 0
if S == "0":
  M = 0
else:
  M = int(S[-1])
if N == 0 and M == 0:
  print(0)
elif N != 0 and M == 0:
  print(N)
else:
  print(N ** M % 10)
0