2013年8月5日

POJ3252-Round Numbers 数学

摘要: POJ3252-Round Numbers 组合数 阅读全文

posted @ 2013-08-05 21:34 GyyZyp 阅读(234) 评论(0) 推荐(0) 编辑

hdu1421 搬寝室 DP

摘要: 转载:/*证明:从4个数中 a b c d依次递增;选取相邻的两个数一定是最小得及:(a-b)^2+(c-d)^2 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define MAX 2010 9 int dp[MAX][MAX];10 int f[MAX];11 int n,k;12 int main()13 {14 while(scanf("%d%d",&n,&k)!=EOF)15 {16 int i,j;17 ... 阅读全文

posted @ 2013-08-05 17:58 GyyZyp 阅读(166) 评论(0) 推荐(0) 编辑

hdu1372 Knight Moves BFS 搜索

摘要: 简单BFS题目 主要是读懂题意和中国的象棋中马的走法一样,走日字型,共八个方向我最初wa在初始化上了。。。。以后多注意。。。代码: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 char a[5],b[5]; 8 int map[9][9]; 9 int end_x,end_y;10 int d[8][2]={{-2,1},{-2,-1},{2,1},{2,-1},{-1,2},{-1,-2},{1,2},{1,-2}};11 class node12 {13 ... 阅读全文

posted @ 2013-08-05 16:09 GyyZyp 阅读(180) 评论(0) 推荐(0) 编辑

导航