結果

問題 No.167 N^M mod 10
ユーザー maspy
提出日時 2023-05-12 21:11:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 1,000 ms
コード長 257 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 12,032 KB
最終ジャッジ日時 2024-11-28 16:52:22
合計ジャッジ時間 2,144 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

sys.set_int_max_str_digits(10**6)

N,M = map(int,read().split())

N %= 10
if M > 100:
    M = M % 4 + 100
answer = pow(N,M,10)
print(answer)
0