枚举&&贪心
smallacmer
这个作者很懒,什么都没留下…
展开
-
2011百校联动“菜鸟杯”程序设计公开赛&&Cover The Enemy
今天下午又重新温习了菜鸟杯题,,发现好多题就是用枚举方法A掉的,,里面并没有夹杂太多方面的高级算法,,没想到就这题在比赛竟然好些做不出来,,看来自己做的题还是少啊!!!!! 思路:这一题求最小半径平方和,先把第一个塔离敌军的营地排一下序(升序,降序都可以),然后枚举所有到第一个塔的距离,通过找第一个塔不能覆盖的敌军阵营离第二个塔最大的距离得出第二个塔的半径,,还有一点要注意就是最找离第二个塔最大原创 2012-01-02 17:15:56 · 952 阅读 · 0 评论 -
2011百校联动“菜鸟杯”程序设计公开赛&&Magic Potion
这一题是个位运算题,可怜我理解能力太差,,,好大一会才明白,,,也算是个枚举题吧,,, #include #include using namespace std; int main() { int n; cin>>n; while(n--) { int m=0,p=0,i,j; int y[9],x[9]; cin>>y[1]>>y[2]>>y[3]>>原创 2012-01-03 09:37:47 · 787 阅读 · 0 评论 -
http://cdn.ac.nbutoj.com/Problem/view.xhtml?id=1181
问题描述 The game LOL is an interesting game. Recently we are playing this game. Once I used a champion named Kog'Maw - The Mouth of the Abyss. For I have to support teammate, I only have a little tim原创 2012-07-07 18:09:26 · 986 阅读 · 0 评论 -
Enumerate the Triangles&&http://cdn.ac.nbutoj.com/Contest/view/id/14/problem/E.xhtml
问题描述 Little E is doing geometry works. After drawing a lot of points on a plane, he want to enumerate all the triangles which the vertexes are three of the points to find out the one with minimum原创 2012-07-14 11:10:27 · 981 阅读 · 0 评论 -
http://cdn.ac.nbutoj.com/Problem/view.xhtml?id=1198&& I can do it!
问题描述 Given n elements, which have two properties, say Property A and Property B. For convenience, we use two integers Ai and Bi to measure the two properties. Your task is, to partition the el原创 2012-07-14 11:19:08 · 1004 阅读 · 0 评论 -
The War&&贪心算法
Description A war had broken out because a sheep from your kingdom ate some grasses which belong to your neighboring kingdom. The counselor of your kingdom had to get prepared for this war. There a原创 2012-07-16 16:37:38 · 915 阅读 · 0 评论