here is my code,
t=int(raw_input())
for i in range(t):
n1,n2=map(long,raw_input().split())
x=(n1**n2)%10
print (x)
but it is giving TLE, someone tell me how to fix it ??

  • created

    Jan '15
  • last reply

    Jan '15
  • 1

    reply

  • 396

    views

  • 2

    users

Please use code tags.

For this problem you can't use brute force to get AC, you need a better method.