传送门 Leftmost Digit Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15305    Accepted Submission(s): 5937 Problem Description Given a positive integer N, you should output the leftmost digit of N…
1060 - Leftmost Digit 1601 - Rightmost Digit 1060题意很简单,求n的n次方的值的最高位数,我们首先设一个数为a,则可以建立一个等式为n^n = a * 10^x;其中x也是未知的: 两边取log10有:lg(n^n) = lg(a * 10^x); 即:n * lg(n)  - x = lg(a); 现在就剩x一个变量了,我们知道x是值n^n的位数-1,a向下取整就是我们要求的数: 所以 按着上面的推导式翻译成代码就可以了(注意:数值的范围和之间的…
Leftmost Digit Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20361    Accepted Submission(s): 7864 Problem Description Given a positive integer N, you should output the leftmost digit of N^N.…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1060 题目描述:求N的N次方的第一位. 思路: 第一次做这种类型的题目,学到了如何运用对数. 首先推导下述公式 k的以10为底的对数值必定是A.B的形式,A为结果的整数部分,B为小数部分 这里求nn的首位只需要求出A.B = Nlog(N),然后取小数位即可,因为10A并没有什么用,只要算出100.B 就算出了首位数字.这种方法可以用来求前i位.(i数值要小,因为运算精度有限) #include<…
Leftmost Digit Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16762    Accepted Submission(s): 6643 Problem Description Given a positive integer N, you should output the leftmost digit of N^N.…
Leftmost Digit Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19010    Accepted Submission(s): 7507 Problem Description Given a positive integer N, you should output the leftmost digit of N^N.…
Given a positive integer N, you should output the leftmost digit of N^N.  InputThe input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each test case contains a…
Problem Description Given a positive integer N, you should output the leftmost digit of N^N.   Input The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each…
Description Given a positive integer N, you should output the leftmost digit of N^N.   Input The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each test ca…
Leftmost Digit Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14954    Accepted Submission(s): 5775 Problem Description Given a positive integer N, you should output the leftmost digit of N^N.…