摘要: D. Bear and BlocksLimak is a little bear who loves to play. Today he is playing by destroying block towers. He builtntowers in a row. Thei-th tower is... 阅读全文
posted @ 2015-09-16 00:29 lmlyzxiao 阅读(118) 评论(0) 推荐(0)
摘要: C. Bear and PokerLimak is an old brown bear. He often plays poker with his friends. Today they went to a casino. There are n players (including Limak ... 阅读全文
posted @ 2015-09-15 21:40 lmlyzxiao 阅读(109) 评论(0) 推荐(0)
摘要: B. Bear and Three MusketeersDo you know a story about the three musketeers? Anyway, you will learn about its origins now.Richelimakieu is a cardinal i... 阅读全文
posted @ 2015-09-15 21:21 lmlyzxiao 阅读(221) 评论(0) 推荐(0)
摘要: A. Bear and ElectionsLimak is a grizzly bear who desires power and adoration. He wants to win in upcoming elections and rule over the Bearland.There a... 阅读全文
posted @ 2015-09-15 21:10 lmlyzxiao 阅读(112) 评论(0) 推荐(0)
摘要: 实在是太颓废了,所以开始写点东西吧。。。。最大子段和: 给定N个数(可能为负整数)组成的序列a1...an,求该序列形如∑ak(i0时,b[j] = b[j-1]+a[j]否则b[j] = a[j];由此得出递推式b[j] = max(b[j-1]+a[j],a[j]) (10) b += a[i]... 阅读全文
posted @ 2015-07-12 14:14 lmlyzxiao 阅读(230) 评论(0) 推荐(0)
摘要: 重建二叉树,知道先序和中序 输出二叉树的后序。。#include #include #include using namespace std;const int M = 1005;int i,j,k;int Max (int x ,int y){return x>y?x:y ;}void buil... 阅读全文
posted @ 2014-12-30 12:41 lmlyzxiao 阅读(303) 评论(0) 推荐(0)
摘要: 2263 题目意思是求起点城市到终点城市的途径中的最大载重量,可以用Dijkstra或者floyd 来解决,我是用的floyd 感觉更直观 因为只需要将递推式改成w[i][j] = Max(w[i][j],Min(w[i][k],w[k][j]));便可得到答案,而且floyd写法比较简单但是复杂度... 阅读全文
posted @ 2014-12-01 21:56 lmlyzxiao 阅读(118) 评论(0) 推荐(0)
摘要: B. Queuetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuring the lunch break allnBerland State... 阅读全文
posted @ 2014-11-25 13:03 lmlyzxiao 阅读(305) 评论(0) 推荐(0)
摘要: 最近水水的开始写CF,感觉自己什么都不会,现在连水题都切不动了。。。。写一下我做的两道水题。。A. Team Olympiadtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputs... 阅读全文
posted @ 2014-11-25 12:40 lmlyzxiao 阅读(163) 评论(0) 推荐(0)