摘要:
阅读全文
摘要:
1.递归实现 阅读全文
摘要:
1. 按位与 & and运算通常用于二进制的取位操作,例如一个数 and 1的结果就是取二进制的最末位。 相同位的两个数字都为1,则为1;若有一个不为1,则为0。 00101 11100 &;或者and) 00100 2. 按位或 | or运算通常用于二进制特定位上的无条件赋值,例如一个数or 1的 阅读全文
摘要:
图的存储有4种形式:邻接矩阵,前向星,邻接表,链式前向星(属于邻接表) 1.链接矩阵 这个是我们最常用的,开一个map[i][j] 初始化 map[i][i]=0,map[i][j]=inf; 初始化需要o(n*n),建图 m 缺点 :遍历效率较低,并且不能存储重边, 初始化效率低;图的空间开销大。 阅读全文
摘要:
A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24 阅读全文
摘要:
JGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines. Half of these cities are rich in r 阅读全文
摘要:
Max Sum Plus Plus Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30478 Accepted Submission(s): 1 阅读全文
摘要:
免费馅饼 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 51189 Accepted Submission(s): 17854 Problem 阅读全文
摘要:
1.HDU 1003 求最长连续相加的和。 dp[i]=max(a[i],dp[i-1]+a[i]); dp[i]表示以 i 结尾的最大值。 再开/个strat去标记从哪里开始。 2.hdu 1087 求最长上升序列的和; dp[i]=max(dp[j])+a[i]; a[j]<a[i]; 3.HD 阅读全文
摘要:
An anagram of a string is any string that can be formed using the same letters as the original. (We consider the original string an anagram of itself 阅读全文