摘要: Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N#include #define INF 1000000000#define MAX 200int mat[MAX][MAX];int min[MAX];int dijkstra(int n, int s){ int v[MAX], i, j, k; for( i = 0; i ... 阅读全文
posted @ 2013-07-15 18:08 翼展zjz 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the table.) With two cards you can make the top card overhang the bottom one by half a 阅读全文
posted @ 2013-06-18 13:46 翼展zjz 阅读(250) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionAs we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B.To make the problem easier, I promise that B will be smaller than 100000.Is it too hard? No, I work it out in 10 minutes, and my 阅读全文
posted @ 2013-06-12 00:07 翼展zjz 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Problem Descriptionlcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT problem,so lcy makes the problem easier than begin.this puzzle describes that: gave a and b,how to know the a^b's the last digit number.But everybody i 阅读全文
posted @ 2013-06-11 23:49 翼展zjz 阅读(194) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionEddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divided into the multiply of prime number, but he can't write program, so Eddy has to ask intelligent you to help him, he asks you to write a program whi 阅读全文
posted @ 2013-06-11 11:38 翼展zjz 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Problem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says."The second problem is, given an positive integer N, we define an equation like this:N=a[1]+a[2]+a[3]+...+a[m];a[i]>0,1<=m<=N;My question is how man 阅读全文
posted @ 2013-06-11 09:49 翼展zjz 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 1、整数拆分的问题,和求一个正整数的n个解是有区别的! 阅读全文
posted @ 2013-06-11 09:05 翼展zjz 阅读(78) 评论(0) 推荐(0) 编辑
摘要: Problem Description我们知道,在编程中,我们时常需要考虑到时间复杂度,特别是对于循环的部分。例如,如果代码中出现for(i=1;i<=n;i++) OP ;那么做了n次OP运算,如果代码中出现fori=1;i<=n; i++)for(j=i+1;j<=n; j++) OP;那么做了n*(n-1)/2 次OP 操作。现在给你已知有m层for循环操作,且每次for中变量的起始值是上一个变量的起始值+1(第一个变量的起始值是1),终止值都是一个输入的n,问最后OP有总共多少计算量。Input有T组case,T<=10000。每个case有两个整数m和n,0& 阅读全文
posted @ 2013-05-31 15:47 翼展zjz 阅读(274) 评论(0) 推荐(0) 编辑
摘要: Problem Description有n种物品,并且知道每种物品的数量。要求从中选出m件物品的排列数。例如有两种物品A,B,并且数量都是1,从中选2件物品,则排列有"AB","BA"两种。Input每组输入数据有两行,第一行是二个数n,m(1<=m,n<=10),表示物品数,第二行有n个数,分别表示这n件物品的数量。Output对应每组数据输出排列数。(任何运算不会超出2^31的范围)Sample Input2 21 1Sample Output2AuthorxhdRecommendxhd 问题描述:n个物品,每种物品的数量已知,然后从中选 阅读全文
posted @ 2013-05-26 18:44 翼展zjz 阅读(516) 评论(3) 推荐(0) 编辑
摘要: Problem DescriptionRay又对数字的列产生了兴趣:现有四张卡片,用这四张卡片能排列出很多不同的4位数,要求按从小到大的顺序输出这些4位数。Input每组数据占一行,代表四张卡片上的数字(0<=数字<=9),如果四张卡片都是0,则输入结束。Output对每组卡片按从小到大的顺序输出所有能由这四张卡片组成的4位数,千位数字相同的在同一行,同一行中每个四位数间用空格分隔。每组输出数据间空一行,最后一组数据后面没有空行。Sample Input1 2 3 41 1 2 30 1 2 30 0 0 0Sample Output1234 1243 1324 1342 1423 阅读全文
posted @ 2013-05-20 12:11 翼展zjz 阅读(222) 评论(0) 推荐(0) 编辑