摘要: FatMouse' TradeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 45965Accepted Submission(s): 15395P... 阅读全文
posted @ 2014-12-16 19:53 dongq 阅读(347) 评论(0) 推荐(0) 编辑
摘要: DescriptionGCommando WarInput:Standard InputOutput:Standard Output“Waiting for orders we held in the wood, word from the front never cameBy evening th... 阅读全文
posted @ 2014-12-16 18:44 dongq 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Problem C: The Dragon of LoowaterOnce upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores of Rellau Creek... 阅读全文
posted @ 2014-12-15 18:15 dongq 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 火柴棍等式问题首先确定每个数字所用的火柴棍树木,用一层递归一层循环枚举一次,确定两个加数的值,算出和,进行进行判断,若符合条件则进行记录。 1 #include 2 int need[]={6,2,5,5,4,5,6,3,7,6}; 3 int ans=0;int h=0; 4 int n; 5 i... 阅读全文
posted @ 2014-12-14 12:11 dongq 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 二分法查找题解 1 #include 2 int a[3000]; 3 int chazhao(int n,int t) 4 { 5 int x,y,m; 6 x=0;y=n-1; 7 if(a[x]==t)x=x; 8 else if(a[y]==t) x=y; 9... 阅读全文
posted @ 2014-12-14 12:08 dongq 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 进制转化问题十进制转化为其它进制应该是比较简单的问题,就是一个%和/的问题,模之后再除就ok了 1 int a[1000]; 2 char c[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; 3 int mai... 阅读全文
posted @ 2014-12-14 12:06 dongq 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 八皇后问题题解这应该是典型的递归问题,当然也涉及枚举问题,回溯法;首先对第一个皇后进行排序,第一列有8个位置供她选择,然后将其所在的行和两千对角线分别进行标记三个数组中,在进行第n个皇后进行排序有八个位置供她选择,但要检验其所在行和对角线上是否已被其他皇后占领。 还有是一定要搞明白出栈问题,在出战后... 阅读全文
posted @ 2014-12-08 19:23 dongq 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 枚举排列题解问题是将n个数排列出所有的结果,自然用到枚举法将个个可能的结果排除,中间需要判断,巧用ok的值。 1 #include 2 int a[300]; 3 int n; 4 void paixu(int cur) 5 { 6 int i,t,ok; 7 if(cur==n+1... 阅读全文
posted @ 2014-12-08 19:09 dongq 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 汉诺塔问题是一个纯递归问题,应该是比较简单的搞定n个盘子时只要搞定n-1个盘子就ok了,先将n-1个盘子经过左边那个盘子放到中间那个盘子,在把第n个盘子放过去,最后把n-1个盘子放在最左边的那个就ok了。#includevoid move(char A,char C){ printf("%c-... 阅读全文
posted @ 2014-12-07 23:00 dongq 阅读(136) 评论(0) 推荐(0) 编辑
摘要: DescriptionThe Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary!nboys andmgirls are already busy rehea... 阅读全文
posted @ 2014-12-03 16:10 dongq 阅读(236) 评论(0) 推荐(0) 编辑