题意:给定b数列,计算有多少种数列 a1,a2,...,an 满足条件
a1*a2*...*an=b1*b2*…*bn (ai>1).
解法:处理出b数列中出现的所有质因子的数量记录在map中,然后进行容斥计算:
代码:/******************************************************
* author:xiefubao
********...
分类:
其他好文 时间:
2014-06-15 20:06:24
阅读次数:
191
题目
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums
to T.
The same repeated number may be chosen from C un...
分类:
其他好文 时间:
2014-06-15 20:00:18
阅读次数:
185
题目
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers
sums to T.
Each number in C may only be used once in...
分类:
其他好文 时间:
2014-06-15 19:24:21
阅读次数:
229
Humble Numbers
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 9396
Accepted: 4417
Description
A number whose only prime factors are 2,3,5 or 7 is called a...
分类:
其他好文 时间:
2014-06-15 19:04:15
阅读次数:
159
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list.
思路:原有数组需要多出一位的唯一条件是数组所...
分类:
其他好文 时间:
2014-06-15 18:42:43
阅读次数:
162
Binary Number
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1287 Accepted Submission(s): 807
Problem Description
For 2 non-negativ...
分类:
其他好文 时间:
2014-06-15 18:17:35
阅读次数:
204
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
此题和求二叉树的最短路径几乎一模一样。
public int...
分类:
其他好文 时间:
2014-06-15 16:36:40
阅读次数:
209
题意:给n个数,为有多少互质对;
解法:然后求出mou值,然后求出1,2,3...max的倍数的个数,每个出现在gcd中的对数(num[i]*(num[i]-1))/2,乘上mou值进行容斥计算。
代码:/******************************************************
* author:xiefubao
******************...
分类:
其他好文 时间:
2014-06-15 16:16:11
阅读次数:
274
Number Sequence
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 10239 Accepted Submission(s): 4656
Problem Description
Given two se...
分类:
其他好文 时间:
2014-06-14 00:22:38
阅读次数:
243
ROW_NUMBER 表示根据partymun进行顺序排列,并为每一条记录添加这条记录在多少行的序号。...
分类:
数据库 时间:
2014-06-13 21:35:52
阅读次数:
320