
HYNU练习9
文章平均质量分 74
尹邦文
计算机科学与技术专业
展开
-
排序算法
系统排序函数sort()#includeint cmp(const int &a,const int &b){ if(a>b)return 1; 大到小 降序 else return 0;}int cmp( const POINT &a, const POINT &b ){ if( a.x return 1; el原创 2014-07-14 17:18:15 · 436 阅读 · 0 评论 -
求和号
Problem Description在数学运算中经常要计算连续的和。例如:计算1+2+...+n,或者等比数列a+a^2+...+a^n。这些和式通常不能够逐项完全写出,使用省略号来辅助表示也不够简洁,所以我们使用求和号"∑"来表示这类连续的和。通常在"∑"的下方标自变量名称和初始值,在"∑"的上方标终止值,而在"∑"的右方写表达式。求和号"∑"也可以嵌套使用,例如:3 2∑ ∑原创 2014-07-15 10:31:13 · 1328 阅读 · 0 评论 -
SZ斐波拉契数列
Fibonacci sequence is familiar to you, right? Here comes the SZ Fibonacci sequence, with the property like the following formula.F(n)= a (n=1)F(n)= b (n=2)F(n)= F(n-1)+F(n-2), n>2 and n is odd原创 2014-07-14 16:36:58 · 602 阅读 · 0 评论 -
数塔
#include int main(void){ int t[5600]; int n,i,j,c; scanf("%d",&c); while (c--) { scanf("%d",&n); for(i=0;i<n;i++) for(j=0;j<=i;j++) sca原创 2014-07-16 10:53:17 · 508 阅读 · 0 评论 -
DFS深搜——Red and Black——A Knight's Journey
DFS深搜-Red and Black深搜,从一点向各处搜找到所有能走的地方。八个方向的深搜回溯 把移动方向打好 (网上好多人说要按字典序走才能A 测试了一下 不按字典序也A了)原创 2014-07-15 16:06:43 · 1005 阅读 · 0 评论