[백준]B3-1009

py_code·2021년 1월 8일
0

백준-브론즈3

목록 보기
26/38

n = int(input())
for _ in range(n):
    a,b = map(int, input().split())
    t = ((a%10)**(b%4+4))%10 # 끝자리에 초점을 두고 계산, 4번마다 반복되므로 진수에 조건포함
    print(10 if t==0 else t)
profile
개발자를 꿈꿉니다.

0개의 댓글