摘要: #includeusing namespace std;int max(int a,int b){ if(a>b) return a; else return b;} int main() { int n,M,N,i,j,k,ans; int ans1; int m; int a[210]; int sum[210]; cin>>n; while(n--) { cin>>M>>N; for(int x=1;x>a[i];//sum[i]用于记录从第i个数开始求和的数值 for(... 阅读全文
posted @ 2013-10-26 17:53 蓝色记忆2013 阅读(165) 评论(0) 推荐(0)
摘要: Problem DescriptionFew know that the cows have their own dictionary with W (1 ≤ W ≤ 600) words, each containing no more 25 of the characters 'a'..'z'. Their cowmunication system, based on mooing, is not very accurate; sometimes they hear words that do not make any sense. For instance 阅读全文
posted @ 2013-10-23 20:32 蓝色记忆2013 阅读(145) 评论(0) 推荐(0)
摘要: Problem DescriptionA robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions are N north (up the page) S south (down the page) E east (to the right on the page) W west (to the lef... 阅读全文
posted @ 2013-10-18 17:39 蓝色记忆2013 阅读(160) 评论(0) 推荐(0)
摘要: DescriptionDearboy was so busy recently that now he has piles of clothes to wash. Luckily, he has a beautiful and hard-working girlfriend to help him. The clothes are in varieties of colors but each piece of them can be seen as of only one color. In order to prevent the clothes from getting dyed in 阅读全文
posted @ 2013-10-13 17:25 蓝色记忆2013 阅读(761) 评论(0) 推荐(0)
摘要: G - Zombie’s Treasure ChestCrawling in process... Crawling failed Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u DescriptionSome brave warriors come to a lost village. They are very lucky and find a lot of treasures and a big treasure chest, but with angry zombies. The warr 阅读全文
posted @ 2013-10-11 19:28 蓝色记忆2013 阅读(208) 评论(0) 推荐(0)
摘要: #includeusing namespace std;long long GCD(long long a,long long b)//求最大公约数的方法 { long long t; if(a<b) {t=a;a=b;b=t;} if(a%b==0) return b; else return GCD(b,a%b);}long long LCM(long long a,long long b)//求最小公倍数的方法 { return a/GCD(a,b)*b; }int main(){ cout<<GCD(8,28)<<endl; cout<... 阅读全文
posted @ 2013-10-11 18:16 蓝色记忆2013 阅读(141) 评论(0) 推荐(0)
摘要: Description Gigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance. It orders two arms of negligible weight and each arm's length is 15. Some hooks are attached to these arms and Gigel wants to hang up some weights from 阅读全文
posted @ 2013-10-10 21:11 蓝色记忆2013 阅读(251) 评论(0) 推荐(0)
摘要: DescriptionAfter months of hard working, Iserlohn finally wins awesome amount of scholarship. As a great zealot of sneakers, he decides to spend all his money on them in a sneaker store.There are several brands of sneakers that Iserlohn wants to collect, such as Air Jordan and Nike Pro. And each bra 阅读全文
posted @ 2013-10-08 20:09 蓝色记忆2013 阅读(296) 评论(0) 推荐(0)
摘要: DescriptionACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different course depending on the days he spend on it.How to arrange the M days for the N courses to maximize the profit?InputThe input consists of multiple data sets. A dat 阅读全文
posted @ 2013-10-07 17:54 蓝色记忆2013 阅读(228) 评论(0) 推荐(0)
摘要: DescriptionThe cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 #include#include#includeusing namespace std;struct Node{ int h,c; int lim;}node[401];int dp[50000];int H;void ZeroOnePack(int cost,int weight,int lim... 阅读全文
posted @ 2013-10-07 17:38 蓝色记忆2013 阅读(179) 评论(0) 推荐(0)