HYNU练习16
文章平均质量分 62
尹邦文
计算机科学与技术专业
展开
-
矩阵归零
Problem DescriptionThere is a matrix with m rows and n columns. An element of the matrix has at most four adjacent elments(up, down,left,right). You can add a same number to a pair of adjacent eleme原创 2014-08-25 10:27:33 · 610 阅读 · 0 评论 -
庆功会
Problem Description为了庆贺班级在校运动会上取得全校第一名成绩,班主任决定开一场庆功会,为此拨款购买奖品犒劳运动员。期望拨款金额能购买最大价值的奖品,可以补充他们的精力和体力。Input输入第一行为T,表示数据组数,对于每组数据的第一行二个数n(n接下来n行,每行3个数,v、w、s,分别表示第I种奖品的价格、价值(价格与价值是不同的概念)和购买的数量(买0件到原创 2014-08-25 10:31:00 · 1119 阅读 · 0 评论 -
最长公共子序列
代码:#include #include using namespace std;int a[10010], b[10010];int max1(int a, int b){ if(a > b)return a; return b;}int main(){ int i, j; char s1[10000], s2[10000];原创 2014-08-25 10:22:11 · 417 阅读 · 0 评论 -
Uncle Hey
Problem DescriptionThe annual GaoDaoKuOI(GDKOI), an interesting programming contest, was held several weeks ago. Uncle Hey had been supposed to be a judge, but turned out to be a scheduler, which an原创 2014-08-25 10:22:42 · 386 阅读 · 0 评论 -
黑白棋子的移动
Problem Description有2n个棋子(20≥n≥4)排成一行,开始位置为白子全部在左边,黑子全部在右边,如下图为n=5的情形:○○○○○●●●●●移动棋子的规则是:每次必须同时移动相邻的两个棋子,颜色不限,可以左移也可以右移到空位上去,但不能调换两个棋子的左右位置。每次移动必须跳过若干个棋子(不能平移),要求最后能移成黑白相间的一行棋子。如n=5时,成为:○●○●○●○●○●原创 2014-08-25 10:25:56 · 1140 阅读 · 0 评论