2013年1月9日
摘要: 题目描述:Given a positive integer N, you should output the leftmost digit of N^N.题目分析: 由于N给的数据是10^9,很显然将N一个个乘起来那就是你不想活了啊。一般对于a^b我们是进行取对数,这道题也不例外。题目转化: 设 M = N^N , 等式两边去对数 log10 log10 ( M ) = log10 ( N^N ) = N * log10 ( N ) 再化简过去 可得: M = 10 ^( N*log10(N) ) 我们假设 N * log10( N ) = A + B (其中A为... 阅读全文
posted @ 2013-01-09 20:59 YQH760 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 题目描述:lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT problem,so lcy makes the problem easier than begin.this puzzle describes that: gave a and b,how to know the a^b's the last digit number.But everybody is too lazy to 阅读全文
posted @ 2013-01-09 20:39 YQH760 阅读(633) 评论(0) 推荐(0) 编辑