Bonsoir,
I solved LASTDIG : The Last Digit of a^b.
(It's not a spoil)
def lastD(l):
#my stuff ;-)
import sys
sys.stdin.readline()
for l in sys.stdin:
sys.stdout.write(lastD(l)+'\n')
sys.stdout.flush()
In Python3, I got 0.11s, and there's better solutions at 0.02s.
My algo doesn't use the pow function, I think I got a better way.
I first thought my algo was bad, but I tried this dummy submission.
import sys
sys.stdin.readline()
for l in sys.stdin:
sys.stdout.write('0\n')
sys.stdout.flush()
And what a surprise !!!! The same time 0.11 (and wrong answer, i knew it)
Could someone confirm that I suspect:
It's my read/write method which is not optimal !!!
Edit : worse, most of python3 users (3/4) can do it in 0.02s, and (1/4) does it in 0.12.
So, where can I learn better way ?
I know there are yet many questions are about that.
I read other posts, especially numerix's ones.
I didn't found better solution.
Au plaisir de vous lire.
(with pleasure in reading you ~~?) I know my english is not very good.
Thanks