用Javascript取float型小数点后两位,例22.127456取成22.13,如何做?1. 最笨的办法....... [我就怎么干的.........]1functionget()2{3vars=22.127456+"";4varstr=s.substring(0,s.indexOf("."...
分类:
编程语言 时间:
2014-08-20 17:50:02
阅读次数:
178
解法一:通过遍历得到(0:i)的LIS,时间复杂度O(N^2);具体思路于代码,如下: 1 #include 2 #include 3 using namespace std; 4 5 int longSub(int arr[],int n); 6 7 int main() 8 { 9 ...
分类:
其他好文 时间:
2014-08-20 15:44:12
阅读次数:
147
Problem Description
Xueba: Using the 4-Point Scale, my GPA is 4.0.
In fact, the AVERAGE SCORE of Xueba is calculated by the following formula:
AVERAGE SCORE = ∑(Wi * SCOREi) / ∑(Wi) 1
where ...
分类:
其他好文 时间:
2014-08-20 14:08:06
阅读次数:
173
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest...
分类:
其他好文 时间:
2014-08-20 14:01:12
阅读次数:
184
Problem Description
Xueba: Using the 4-Point Scale, my GPA is 4.0.
In fact, the AVERAGE SCORE of Xueba is calculated by the following formula:
AVERAGE SCORE = ∑(Wi * SCOREi) / ∑(Wi) 1
where SC...
分类:
其他好文 时间:
2014-08-20 00:07:55
阅读次数:
310
【题意】:给出n,m,代表n个点、及m条有向边。然后m行给出每条有向边的u,v,w(权值)。题目要求你求出最长路径的长度,是该路径满足权值严格递增。数据范围1?≤?wi?≤?10^5【知识点】:DP【题解】:一道看似图论的题目,其实可以利用递推的方法巧妙地解决。因为权值的最大值为10^5,所以可以用...
分类:
其他好文 时间:
2014-08-19 23:46:55
阅读次数:
719
Problem Description
Xueba: Using the 4-Point Scale, my GPA is 4.0.
In fact, the AVERAGE SCORE of Xueba is calculated by the following formula:
AVERAGE SCORE = ∑(Wi * SCOREi) / ∑(Wi) 1
where SC...
分类:
其他好文 时间:
2014-08-19 19:02:25
阅读次数:
422
题目:POJ 2533 Longest Ordered Subsequence
Description
A numeric sequence of ai is ordered if a1 a2 aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN)
be any sequence (ai1...
分类:
其他好文 时间:
2014-08-19 16:37:44
阅读次数:
218
点击打开链接题目链接
1110 - An Easy LCS
PDF (English)
Statistics
Forum
Time Limit: 2 second(s)
Memory Limit: 32 MB
LCS means 'Longest Common Subsequence' that means ...
分类:
其他好文 时间:
2014-08-19 12:59:35
阅读次数:
604