摘要: 1.对称博弈Problem DescriptionAfter hh has learned how to play Nim game, he begins to try another coin game which seems much easier.The gam... 阅读全文
posted @ 2018-03-27 20:23 ~~zcy 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 鞍点Description找出具有m行n列二维数组Array的“鞍点”,即该位置上的元素在该行上最大,在该列上最小,其中1int main(){ int a[11][11],i,j,l=0,k,m,n,max=0,min=0; scanf("%d%d",&... 阅读全文
posted @ 2018-03-27 20:05 ~~zcy 阅读(667) 评论(0) 推荐(0) 编辑
摘要: 1.试设计一个用回溯法搜索子集空间树的函数。该函数的参数包括结点可行性判定函数和上界函数等必要的函数,并将此函数用于解0-1背包问题。 0-1 背包问题描述如下:给定n 种物品和一个背包。物品i 的重量是wi ,其价值为vi ,背包的容量为C。应如何选择装入背包的物品... 阅读全文
posted @ 2018-03-27 17:33 ~~zcy 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 约瑟夫环Input 7 5(有几组数据)10 4 11 4 1(从一开始去除谁)Output 4 2 5 6 1 Input 3 22 5Output 3 2 #include #include #include using namespace std;#inclu... 阅读全文
posted @ 2018-03-27 15:44 ~~zcy 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 打印杨辉三角前n行Sample Input6Sample Output11 11 2 11 3 3 11 4 6 4 11 5 10 10 5 1 #include int main(){ int i,j,s=0,k,n,e; while(scanf("%... 阅读全文
posted @ 2018-03-27 15:20 ~~zcy 阅读(160) 评论(0) 推荐(0) 编辑