Qiuqiqiu  
不管道路多么崎岖坎坷,我永远不停下追逐梦想的脚步!

2011年12月25日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2821dfs我的代码 1 #include <stdio.h> 2 const int N=30; 3 const char dd[10]="RDLU"; 4 const int dx[4]={0,1,0,-1}; 5 const int dy[4]={1,0,-1,0}; 6 char maze[N][N],dir[1000]; 7 int n,m,flag,s; 8 bool inmaze(int x,int y) 9 {10 return (0<=x &&a 阅读全文
posted @ 2011-12-25 17:04 Qiuqiqiu 阅读(260) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1455SticksTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2164Accepted Submission(s): 493Problem DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 unit 阅读全文
posted @ 2011-12-25 15:41 Qiuqiqiu 阅读(1303) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=25538皇后 经典回溯题用负数做为数组下标,稍微方便点不打表就TLE了Orz matrix67大牛的位运算版本我的代码 1 #include <stdio.h> 2 #include <string.h> 3 int v1[20],v2[20],vv3[20],*v3=vv3+10; 4 int n,ans[20],s; 5 void dfs(int x) 6 { 7 if (x>n) {s++; return;} 8 int i; 9 for (i=1;i<=n;i++) 阅读全文
posted @ 2011-12-25 13:14 Qiuqiqiu 阅读(212) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3290DFS递归就行了 G++提交TLE C++提交AC了 有些神奇我的代码 1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <vector> 5 using namespace std; 6 const int N=20010; 7 vector<int> c[N]; 8 int w[N],n,cw[N],vis[N]; 9 int cmp(const 阅读全文
posted @ 2011-12-25 12:31 Qiuqiqiu 阅读(292) 评论(2) 推荐(0) 编辑