2011年8月25日

三分搜索法

摘要: 二分法作为分治中最常见的方法,适用于单调函数,逼近求解某点的值。但当函数是凸性函数时,二分法就无法适用,这时三分法就可以“大显身手”~~ 如图,类似二分的定义Left和Right,mid = (Left + Right) / 2,midmid = (mid + Right) / 2; 如果mid靠近极值点,则Right = midmid;否则(即midmid靠近极值点),则Left = mid;程序模版如下:double Calc(Type a){ /* 根据题目的意思计算 */}void Solve(void){ double Left, Right; double mid, midmid. 阅读全文

posted @ 2011-08-25 21:27 NewPanderKing 阅读(6098) 评论(0) 推荐(5)

hdu Turn the corner

摘要: Turn the cornerTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 151 Accepted Submission(s): 61Problem DescriptionMr. West bought a new car! So he is travelling around the city.One day he comes to a vertical corner. The street he is currently in has 阅读全文

posted @ 2011-08-25 21:22 NewPanderKing 阅读(1063) 评论(0) 推荐(0)

hdu 2298 Toxophily

摘要: ToxophilyTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 99 Accepted Submission(s): 56Problem DescriptionThe recreation center of WHU ACM Team has indoor billiards, Ping Pang, chess and bridge, toxophily, deluxe ballrooms KTV rooms, fishing, climb 阅读全文

posted @ 2011-08-25 17:46 NewPanderKing 阅读(1173) 评论(0) 推荐(0)

hdu cup

摘要: CupTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 163 Accepted Submission(s): 57Problem DescriptionThe WHU ACM Team has a big cup, with which every member drinks water. Now, we know the volume of the water in the cup, can you tell us it height? T 阅读全文

posted @ 2011-08-25 15:45 NewPanderKing 阅读(498) 评论(0) 推荐(0)

导航