题意:一个H-number是所有的模四余一的数,如 1,5,9,13,17,21...
H-primes数是H-number数(1除外),且它的H-number因子除了1只有它本身,如5,9,13,17,21...
但65是H-number数,却不是H-primes数,因为 65=5*13.
H-semi-prime是H-number数,且等于2个H-primes的乘积.如65
给你一个数n,问1到n有多少个H-semi-prime数
分析:用筛选法的思想,将H-primes筛选出来,同时标记在范围内两个H...
分类:
其他好文 时间:
2014-09-13 17:20:06
阅读次数:
247
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
If such arrangement is not possible, it must rearrange it as the lowest possible...
分类:
其他好文 时间:
2014-09-13 09:26:54
阅读次数:
160
what are the rules for how == converts types?关于"=="的比较规则:1. Comparing numbers and strings will always convert the strings to numbers.number类型与string类型...
分类:
Web程序 时间:
2014-09-13 00:38:34
阅读次数:
369
CARDSTime Limit:1000MSMemory Limit:10000KTotal Submissions:1448Accepted:773DescriptionAlice and Bob have a set of N cards labelled with numbers 1 ... ...
分类:
其他好文 时间:
2014-09-11 22:07:02
阅读次数:
183
1 /* 2 题意:给出立方体的每个顶点的坐标(是由源坐标三个数某几个数被交换之后得到的!), 3 问是否可以还原出一个立方体的坐标,注意这一句话: 4 The numbers in the i-th output line must be a permutation o...
分类:
其他好文 时间:
2014-09-11 16:56:02
阅读次数:
157
Triangle
Total Accepted: 17536 Total
Submissions: 65508My Submissions
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row...
分类:
其他好文 时间:
2014-09-11 07:42:01
阅读次数:
194
比如:输入:numbers={2, 7, 11, 15}, target=9输出:index1=1, index2=2 1 public class _003TwoSum { 2 3 public static void main(String[] args) { 4 in...
分类:
编程语言 时间:
2014-09-10 23:41:01
阅读次数:
315
这个,用set:/*ID: qq104801LANG: C++TASK: humble*/#include #include #include #include #include #include #include #include #include #include using namespace...
分类:
其他好文 时间:
2014-09-10 01:34:19
阅读次数:
213
A non-empty zero-indexed array A consisting of N integers is given. Array A represents numbers on a tape.Any integer P, such that 0 &A);that, given a....
分类:
其他好文 时间:
2014-09-09 22:44:39
阅读次数:
482
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2014-09-09 21:27:19
阅读次数:
194