随笔分类 -  ACM---STL

摘要:Description Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on 阅读全文
posted @ 2016-05-17 16:09 UniqueColor 阅读(224) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionN frogs from different countries are standing in a line. Each country is represented by a lowercase letter. The distance between ad... 阅读全文
posted @ 2015-12-01 21:00 UniqueColor 阅读(286) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionLong long ago, there is a gunner whose name is Jack. He likes to go hunting very much. One day he go to the grove. There are n bird... 阅读全文
posted @ 2015-11-24 21:19 UniqueColor 阅读(234) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionThe annual school bicycle contest started. ZL is a student in this school. He is so boring because he can't ride a bike!! So he dec... 阅读全文
posted @ 2015-11-23 16:53 UniqueColor 阅读(390) 评论(0) 推荐(0) 编辑
摘要:题意:如果要切断一个长度为a的木条需要花费代价a, 问要切出要求的n个木条所需的最小代价。思路:模拟huffman树,每次选取最小的两个数加入结果,再将这两个数的和加入队列。注意priority_queue的用法,原型:1 priority_queue q; 2 priority_queue,Co... 阅读全文
posted @ 2015-11-12 21:15 UniqueColor 阅读(243) 评论(0) 推荐(0) 编辑
摘要:本题利用multiset解决。根据题意,如果我们用P(x,y)表示一个人,因为人可以相同,所以用multiset。我们会发现,如果所有人群都是有优势的,那么这些点呈现一个递减的趋势。如果刚刚插入一个人,他是否有优势该如何判断呢?只需要看他左边相邻的点的y坐标是否比他小即可。而如果这个人是有优势的,那... 阅读全文
posted @ 2015-10-13 17:58 UniqueColor 阅读(269) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionEveryone knows Matt enjoys playing games very much. Now, he is playing such a game. There are N rooms, each with one door. There ar... 阅读全文
posted @ 2015-09-07 21:42 UniqueColor 阅读(221) 评论(0) 推荐(0) 编辑
摘要:DescriptionBessie noted that although humans have many universities they can attend, cows have none. To remedy this problem, she and her fellow cows f... 阅读全文
posted @ 2015-08-30 20:17 UniqueColor 阅读(288) 评论(0) 推荐(0) 编辑
摘要:DescriptionTo avoid unsightly burns while tanning, each of the C (1 ≤ C ≤ 2500) cows must cover her hide with sunscreen when they're at the beach. Cow... 阅读全文
posted @ 2015-08-29 00:28 UniqueColor 阅读(481) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionShaolin temple is very famous for its Kongfu monks.A lot of young men go to Shaolin temple every year, trying to be a monk there. T... 阅读全文
posted @ 2015-08-14 19:27 UniqueColor 阅读(181) 评论(0) 推荐(0) 编辑
摘要:Problem Description圆桌上围坐着2n个人。其中n个人是好人,另外n个人是坏人。如果从第一个人开始数数,数到第m个人,则立即处死该人;然后从被处死的人之后开始数数,再将数到的第m个人处死……依此方法不断处死围坐在圆桌上的人。试问预先应如何安排这些好人与坏人的座位,能使得在处死n个人之... 阅读全文
posted @ 2015-08-14 16:33 UniqueColor 阅读(942) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示