![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分/三分
丿残念灬
这个作者很懒,什么都没留下…
展开
-
15年湖南ACM省赛 Internet of Lights and Switches(异或运算+状压+二分)
Internet of Lights and SwitchesTime Limit:5000MS Memory Limit:65535KB 64bit IO Format:Submit StatusDescriptionYou are a fan of "Internet of Things"(IoT, 物联网), so you buil原创 2016-08-15 20:23:02 · 957 阅读 · 0 评论 -
SCU-4527 NightMare2(Dijkstra)
涨姿势的一道题,最短路与二分的结合,求得在限定距离内,获得价值的最大值题解:二分答案(获得的最多财宝价值),Dijkstra求最短路,在获得价值为mid的情况下,如果能在时间k内走到终点,则返回true,否则返回false#include#include#include#include#includeusing namespace std;const int max原创 2016-08-08 15:03:08 · 415 阅读 · 0 评论 -
CodeForces-483B Friends and Presents(二分)
B. Friends and Presentstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have two friends. You want to pr原创 2016-09-08 20:48:21 · 453 阅读 · 0 评论 -
codeForces-743E Vladik and cards(状压+记忆化搜索+二分)
传送门:http://codeforces.com/contest/743/problem/E题意:有n个元素的序列,每个元素均是[1,8]中的整数,要求找出他的最长子序列满足以下2个条件:①在这个序列中,[1,8]每个数字出现的次数之差的绝对值不超过1;②相同的数字必须连续.输出最长子序列的长度题解:①对于每种数字保存他出现时的下标;②二分每种数字至少出现x次,因此每种元素可能出现的次数原创 2016-12-16 21:16:49 · 634 阅读 · 0 评论 -
SPOJ FACVSPOW(数论+二分)
传送门:http://www.spoj.com/problems/FACVSPOW/en/题意:给出一个数a,要求找到最小的n使得n!>a^n题解:先将不等式两边取对数得到ln(1)+ln(2)+...+ln(n)>nln(a)可以发现a#includeusing namespace std;const int MX = 3e6 + 5;double sum[MX];voi原创 2017-02-25 16:33:39 · 587 阅读 · 0 评论 -
HDU-6070 Dirt Ratio(二分+线段树+分数规划)
传送门:HDU-6070上次刚好摔倒在CF Round#427的D题上,这次又来了个类似的题目。。。题意:要求找一段区间使得区间内不同数的个数/区间长度的比值最小题解:二分+线段树设sum为区间内不同数的个数,len为区间长度我们先二分答案得到k,那么我们需要在序列中找一段区间使得它的sum/len转换一下得到sum-len*k,这是我们熟悉的分数规划现在问题就很好原创 2017-08-03 22:45:26 · 1410 阅读 · 0 评论