![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分答案/二分法
BUAA_Alchemist
这个作者很懒,什么都没留下…
展开
-
【二分答案】轻重搭配
传送门:https://nanti.jisuanke.com/t/36105n 个同学去动物园参观,原本每人都需要买一张门票,但售票处推出了一个优惠活动,一个体重为 x 的人可以和体重至少为 2x 配对,这样两人只需买一张票。现在给出了 n 个人的体重,请你计算他们最少需要买几张门票?输入格式第一行一个整数 n,表示人数。第二行 n 个整数,每个整数 a_i 表示每个人的体重。...原创 2019-02-10 09:06:16 · 832 阅读 · 1 评论 -
【二分答案】【动态规划】【扫描线】人以群分
传送门:https://nanti.jisuanke.com/t/36107某班有 n 个同学,每个同学有一个外向程度 ai 。由于要进行某个活动,需要把他们分成若干个小组,每个小组的人数至少为 m 人。不同外向程度的人在一个小组会产生不开心值,定义一个小组的不开心值为组内成员外向程度最大值和最小值的差,一个班级的不开心值为所有小组不开心值的最大值。那么问题来了,如何分组使得班级的不开...原创 2019-02-10 09:23:43 · 946 阅读 · 7 评论 -
【二分答案】【数学思维】codeforces1117C Magic Ship
C. Magic Shiptime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou a captain of a ship. Initially you are standing in a point (x1,y1) (obviousl...原创 2019-02-19 13:30:11 · 438 阅读 · 0 评论 -
【贪心】【二分答案】codeforces1119E Pavel and Triangles
Pavel has several sticks with lengths equal to powers of two.He has a0 sticks of length 20=1, a1 sticks of length 212^121 2, …, an−1 sticks of length 2n−12^{n−1}2n−1.Pavel wants to make the maximum ...原创 2019-04-07 10:52:29 · 357 阅读 · 0 评论