题目链接:http://vjudge.net/problem/HDU-1061 这个题目要求出N个N相乘的个位,直接求结果肯定数据溢出。 其实只要每次得出一个数字保留个位和N相乘就可以了, 因为A*B=C,对于个位而言,A(个位)*B(个位)=C(个位)始终成立。 1<=N<=1,000,000,0 ...
分类:
Web程序 时间:
2016-12-04 11:23:12
阅读次数:
159
题目链接:http://vjudge.net/problem/UVA-1225 #include <iostream> #include <cstring> #include <cstdio> using namespace std; int f[10000][10]; int main() { m ...
分类:
其他好文 时间:
2016-12-03 10:03:43
阅读次数:
349
[HDU3709]Balanced Number 试题描述 A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, ...
分类:
其他好文 时间:
2016-12-02 22:00:06
阅读次数:
298
Solution 1: Bit Manipulation use Integer.bitCount() Solution 2: Backtracking, 非常精妙之处在于用了两个数组来帮助generate digit(例如:1011 -> 11) ...
分类:
其他好文 时间:
2016-12-02 08:02:59
阅读次数:
250
You are given two linked lists representing two non-negative numbers. The most significant digit comes first and each of their nodes contain a single ...
分类:
其他好文 时间:
2016-11-28 09:34:13
阅读次数:
252
ab % k = (a%k)(b%k)%kSince the power here is an array, we'd better handle it digit by digit.One observation:a^1234567 % k = (a^1234560 % k) * (a^7 % k ...
分类:
其他好文 时间:
2016-11-28 09:12:52
阅读次数:
287
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^... ...
分类:
Web程序 时间:
2016-11-23 23:46:28
阅读次数:
245
四、input value String 输入框的内容 type String text input的类型,有效值:text,number,idcard,digit,time,date password Boolean false 是否是密码类型 placeholder String 输入框为空时占 ...
分类:
其他好文 时间:
2016-11-22 11:53:33
阅读次数:
219
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho ...
分类:
其他好文 时间:
2016-11-15 13:48:57
阅读次数:
142
题目: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the tel ...
分类:
其他好文 时间:
2016-11-14 20:38:01
阅读次数:
164