![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分搜索
文章平均质量分 57
bin_gege
这个作者很懒,什么都没留下…
展开
-
hdu_2141_Can you find it?(二分)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2141 题意:叫你找三个数,使得这三个数的值为X,如果找得到就输出YES否则输出NO,注意两个32位数相加会爆int #include #include using namespace std; #define FFC(i,a,b) for(int i=a;i<=b;i++) int L,N,M,t原创 2016-05-11 22:29:20 · 355 阅读 · 0 评论 -
hdu_2446_Shell Pyramid(数学,二分)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2446 题意:题面很大,有用的就那么几句,意思就是用自然数来堆它画的那个金字塔,比如第一个金字塔的第一个数为1,第二个金字塔的第一个数为2,第三个金字塔的第一个数为5……。 题解:可以打表,最多有381W个金字塔,然后用二分搜,也可以推个公式出来(n*n*n - n)/6表示第n-1堆的最后一个数,原创 2016-05-12 09:07:32 · 790 阅读 · 0 评论 -
Codeforces Round #350 (Div. 2)_D2 - Magic Powder - 2
D2. Magic Powder - 2 time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The term of this problem is the same as原创 2016-05-06 18:54:48 · 459 阅读 · 0 评论 -
hdu_1969_pie(二分)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1969 题意:看了老半天,就是有N个饼,要分给f+1个人,每个人只能一样多,不能拼凑,多余的丢弃,问每个人最多能分到多少 题解:将最大的那个饼拿来二分,然后无限逼近满足能分出f+1个相同大小的饼 ,的最大的答案。 #include #include const double pi=acos(-1.原创 2016-05-12 12:51:29 · 329 阅读 · 0 评论