尺取、二分、三分
算法 尺取、二分、三分
Water_Coder
正在学算法
展开
-
Bound Found(尺取法)
Bound FoundSignals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going through a defiant phase: “But I want to ...原创 2020-03-01 20:41:09 · 514 阅读 · 1 评论 -
Toxophily(二分+三分)
ToxophilyThe recreation center of WHU ACM Team has indoor billiards, Ping Pang, chess and bridge, toxophily, deluxe ballrooms KTV rooms, fishing, climbing, and so on.We all like toxophily.Bob is ho...原创 2020-03-01 20:06:46 · 378 阅读 · 2 评论 -
Turn the corner(三分)
Turn the cornerMr. 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 a width x, the street he wants to turn to has a...原创 2020-03-01 16:32:38 · 388 阅读 · 0 评论 -
Light Bulb(三分)
Light BulbCompared to wildleopard’s wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in his incommodi...原创 2020-03-01 12:55:18 · 311 阅读 · 0 评论 -
Monthly Expense(二分)
Monthly ExpenseFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ...原创 2020-03-01 11:04:00 · 1154 阅读 · 0 评论 -
River Hopscotch(二分+贪心)
River HopscotchEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight...原创 2020-02-28 20:56:13 · 313 阅读 · 0 评论 -
Expanding Rods(二分法)
Expanding RodsWhen a thin rod of length L is heated n degrees, it expands to a new length L’=(1+n*C)*L, where C is the coefficient of heat expansion.When a thin rod is mounted on two solid walls and...原创 2020-02-27 21:22:45 · 586 阅读 · 1 评论 -
尺取、二分、三分(函数模板)
尺取、二分、三分(函数)一、尺取设置两个下标表示区间的左右端点,根据实际情况推进两个端点求得答案。/** 给定一个序列a,求a中元素和大于等于s的子序列的最小长度 (保证a中元素都为正)*/int take() //尺取{ int l=1,r=1; int sum=a[1],ans=inf; while(r<=n) //s是要查找的元素 ...原创 2020-02-27 19:57:31 · 311 阅读 · 0 评论 -
Can you solve this equation?(二分法)
Can you solve this equation?Now,given the equation 8x^4 + 7x^3 + 2x^2 + 3x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky.InputThe first line of the input contains ...原创 2020-02-27 19:44:25 · 362 阅读 · 0 评论 -
Jessica's Reading Problem(尺取法)
Jessica’s Reading ProblemJessica’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 it. If she wants to pass it, she ha...原创 2020-02-26 20:04:36 · 365 阅读 · 0 评论