思路: 利用java 特性,将数字从1 一直加到n,全部放到String中,然后依次对strring扫描每一位,使其carr[str.charAt(i)-'0']++; 最后输出carr[i],即可。 13 string=12345678910111213 carr[1]++、carr[2]++、c ...
分类:
其他好文 时间:
2016-07-21 23:42:36
阅读次数:
256
Counting Offspring Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2424 Accepted Submission(s): ...
分类:
编程语言 时间:
2016-07-21 21:58:23
阅读次数:
177
错误描述: 错误代码: 1118Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check ...
分类:
数据库 时间:
2016-07-21 21:30:49
阅读次数:
2128
338. Counting Bits
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and
return them as an array...
分类:
其他好文 时间:
2016-07-19 10:44:44
阅读次数:
165
先看第一题,有n*m个点,求在这些点中,有多少条直线,经过了至少两点,且不是水平的也不是竖直的。 分析:由于对称性,我们只要求一个方向的线即可。该题分成两个过程,第一个过程是求出n*m的矩形中,dp[i][j]代表在这个矩形中终点是到(i,j)这个点的满足题意的直线条数,那么,用dp的话就可以得出递 ...
分类:
其他好文 时间:
2016-07-12 20:57:30
阅读次数:
182
This is a BST(binary search tree) numbers counting problem but solved in dynamic programing. https://discuss.leetcode.com/category/104/unique-binary-s ...
分类:
其他好文 时间:
2016-07-06 23:15:38
阅读次数:
157
1. Add " " to ensure the comparision works. Or add a condition that result.length() > 0 2. character counting decrease happens before check it has bee ...
分类:
其他好文 时间:
2016-07-05 07:42:23
阅读次数:
144
1. Do not need to check boundary case since the helper function can add "" into result. 2. Do not forget to add that character if not counting into ab ...
分类:
其他好文 时间:
2016-07-05 06:27:00
阅读次数:
133