随笔分类 -  算法:贪心

摘要:Wooden SticksTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10423Accepted Submission(s): 4287Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodw 阅读全文
posted @ 2014-03-11 17:30 Freecode# 阅读(345) 评论(0) 推荐(0) 编辑
摘要:最少拦截系统Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11667Accepted Submission(s): 4585Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几 阅读全文
posted @ 2014-01-20 16:21 Freecode# 阅读(1348) 评论(1) 推荐(1) 编辑
摘要:历届试题 翻硬币 时间限制:1.0s 内存限制:256.0MB问题描述小明正在玩一个“翻硬币”的游戏。桌上放着排成一排的若干硬币。我们用 * 表示正面,用 o 表示反面(是小写字母,不是零)。比如,可能情形是:**oo***oooo如果同时翻转左边的两个硬币,则变为:oooo***oooo现在小明的问题是:如果已知了初始状态和要达到的目标状态,每次只能同时翻转相邻的两个硬币,那么对特定的局面,最少要翻动多少次呢?我们约定:把翻动相邻的两个硬币叫做一步操作,那么要求:输入格式两行等长的字符串,分别表示初始状态和要达到的目标状态。每行的长度 2 using namespace std; 3 in. 阅读全文
posted @ 2014-01-12 00:05 Freecode# 阅读(5716) 评论(3) 推荐(0) 编辑
摘要:FatMouse' TradeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 36632Accepted Submission(s): 12064Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBe 阅读全文
posted @ 2014-01-01 13:35 Freecode# 阅读(226) 评论(0) 推荐(0) 编辑
摘要:Wooden SticksTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 4Accepted Submission(s) : 3Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. 阅读全文
posted @ 2013-05-19 21:24 Freecode# 阅读(219) 评论(0) 推荐(0) 编辑

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