题目的意思是给你一组数,然后不断的进行除法(注意是大数除以小数),然后将得到的结果加入这组数种然后继续进行除法,直到没有新添加的数为止此题按照提议模拟即可注意要保持元素的不同 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 a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num...
分类:
其他好文 时间:
2014-06-26 15:50:35
阅读次数:
176
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
【题目】
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
["aa","b"],
["a","a","b"]
]
【题意】
给定一个字符串s, 要求对s进行...
分类:
其他好文 时间:
2014-06-26 13:21:59
阅读次数:
182
【题目】
Given a string s, partition s such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of s.
For example, given s = "aab",
Return 1 since the palindrome partitioning ["aa","b"] could b...
分类:
其他好文 时间:
2014-06-26 07:48:00
阅读次数:
259
给出一个字符串求是palindrome和anagram的比率是多少。
知识点:
1 DBL_MAX 64位double的最长数大概是1.7E308,很大很大,比long long大上不知多少倍,故此大概能容纳150!的数值,不能容纳200!的数值
2 偶数的时候,不能有字母重复为基数次,否则不能组成palindrome
3 基数的时候,只能有且只有有一个字母重复为基数次,用于放在中...
分类:
其他好文 时间:
2014-06-25 10:00:13
阅读次数:
193
【题目】
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
题目
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