题目的意思是给你一组数,然后不断的进行除法(注意是大数除以小数),然后将得到的结果加入这组数种然后继续进行除法,直到没有新添加的数为止此题按照提议模拟即可注意要保持元素的不同 int CountNumbers(vector numbers) { set ss(numbers.b...
分类:
其他好文 时间:
2014-06-26 19:29:28
阅读次数:
241
官方文档中的16页:numbers.map({ (number: Int) -> Int in let result = 3 * number return result })不知道这个怎么用,更不知道它所说的要写个把奇数改成0的方法。
分类:
其他好文 时间:
2014-06-26 19:06:05
阅读次数:
193
UVA 10539 - Almost Prime Numbers题目链接题意:给定一个区间,求这个区间中的Almost prime number,Almost prime number的定义为:仅仅能整除一个素数。思路:既然是仅仅能整除一个素数,那么这些数肯定为素数的x次方(x > 1),那么仅仅要...
分类:
其他好文 时间:
2014-06-26 18:11:51
阅读次数:
169
Given two integers
n and k, return all possible combinations of k numbers out of 1 ...
n.
For example,
If n = 4 and k = 2, a solution is:
[
[2,4],
[3,4],
[2,3],
[1,2],
[1,3...
分类:
其他好文 时间:
2014-06-26 14:06:02
阅读次数:
252
UVA 10539 - Almost Prime Numbers
题目链接
题意:给定一个区间,求这个区间中的Almost prime number,Almost prime number的定义为:只能整除一个素数。
思路:既然是只能整除一个素数,那么这些数肯定为素数的x次方(x > 1),那么只要先打出素数表,然后在素数表上暴力找一遍就可以了,因为素数表只要找到sqrt(Max...
分类:
其他好文 时间:
2014-06-25 20:10:16
阅读次数:
181
因为Android应用程序是java写的,基本上很多java写的程序都可以直接照搬到Android上面,移植性非常Good。这里讲一下多线程下载,就是每个线程都下载自己的那部分,那么就需要平均分配分割线程下载多少,一张图来说明一下。第一个要点:http头里面有一个”Range”,就是在这里设置从哪里...
分类:
移动开发 时间:
2014-06-25 17:28:12
阅读次数:
333
【题目】
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find the total sum of all root-to-leaf numbers.
For example,
1
...
分类:
其他好文 时间:
2014-06-25 07:32:27
阅读次数:
209
题目链接:uva 10712 - Count the Numbers
题目大意:给出n,a,b;问说在a到b之间有多少个n。
解题思路:数位dp,dp[i][j][x][y]表示第i位为j的时候,x是否前面是相等的,y是否已经出现过n。对于n=0的情况要特殊处理前导0,写的非常乱,搓死。
#include
#include
#include
#include
...
分类:
其他好文 时间:
2014-06-24 22:22:07
阅读次数:
391
题目
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return...
分类:
其他好文 时间:
2014-06-24 21:46:24
阅读次数:
249
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:
其他好文 时间:
2014-06-24 18:56:54
阅读次数:
240