結果

問題 No.167 N^M mod 10
ユーザー takakin
提出日時 2020-04-21 19:33:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 234 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-09 02:47:12
合計ジャッジ時間 2,123 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input()[-1])
m=int(input()[-1])
if n==0:
  print(0)
else:
  a,b=pow(n,m,2),pow(n,m,5)
  if a==0:
    A=[0,6,2,8,4]
    print(A[b])
  else:
    A=[5,1,7,3,9]
    print(A[b])
0