
二分
文章平均质量分 67
弱菜zc
打完这场就回老家结婚!
展开
-
hdu 4282 A very hard mathematic problem 二分法
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4282题意:。告诉我们K的大小,问符合这个等式的X,Y,Z的组合有多少种。因为幂次的增长速度比较快,我们可以枚举X和Z,这样我们可以把三重循环降低到二重循环,然后二分搜索每一对(X,Z)是否存在对应的Y。对于A的B次方我们可以先打表储存,使用的时候直接调用,这样也可以降低一定的时间复杂度原创 2016-05-14 17:37:37 · 755 阅读 · 0 评论 -
【2017青岛网络赛】1004 hdu 6209 The Intersection 二分
Problem DescriptionA given coefficient K leads an intersection of two curves f(x) and gK(x). In the first quadrant, the curve f is a monotone increasing function that f(x)=x√. The curve g原创 2017-09-19 19:58:47 · 1342 阅读 · 0 评论 -
你真的会二分查找吗?
引用请注明出处:http://blog.youkuaiyun.com/int64ago/article/details/7425727 看到这个标题无论你是处于怎样的心理进来看了,我觉得都是值得的。因为这个问题太简单,任何一个开始接触“真正”算法基本都是从二分查找开始的。至于二分查找都不知道是什么的可以先去找别的资料看下,再来看这篇文章。既然很简单,那么我们开始一起写一个吧,要转载 2017-08-26 15:12:41 · 454 阅读 · 0 评论 -
hdu 5726 GCD RMQ+二分枚举
GCDTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3641 Accepted Submission(s): 1313Problem DescriptionGive you a sequence of N(原创 2017-05-31 22:40:29 · 534 阅读 · 0 评论 -
UVALive - 3506 4 Values whose Sum is 0 二分
简单二分题,前两个数相加为一个数组,后两个数相加为一个数组,然后遍历第一个数组并且二分第二个数组即可。#include #include#include#includeusing namespace std;const int N=4400;int n,a[4][N],b[N*N],c[N*N];int bSearch1(int _begin, int _end, int e)原创 2017-06-24 21:19:32 · 396 阅读 · 0 评论 -
hdu 4112 Break the Chocolate 二分
Problem DescriptionBenjamin is going to host a party for his big promotion coming up.Every party needs candies, chocolates and beer, and of course Benjamin has prepared some of those. But as原创 2017-07-04 11:40:20 · 497 阅读 · 0 评论 -
【多校训练】hdu 5730 cdq+fft
Shell NecklaceTime Limit: 16000/8000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1089 Accepted Submission(s): 467Problem DescriptionPerhaps the原创 2017-06-22 21:27:03 · 665 阅读 · 0 评论 -
hdu 4004 The Frog's Games 二分+贪心
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4004题意:一条长L,(1思路:二分跳跃的最小距离,然后贪心判断是否能跳过。#include #includeusing namespace std;int a[550000],n,m,L;int ok(int k){ int num=1,last0=a[0]原创 2016-07-02 09:53:57 · 517 阅读 · 0 评论 -
51nod 1013 3的幂的和
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1013题目:求:3^0 + 3^1 +...+ 3^(N) mod 1000000007Input输入一个数N(0 Output输出:计算结果Input示例3Output示例40原创 2016-06-27 10:44:43 · 796 阅读 · 0 评论 -
51nod 1001 数组中和等于K的数对
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1001题目:给出一个整数K和一个无序数组A,A的元素为N个互不相同的整数,找出数组A中所有和等于K的数对。例如K = 8,数组A:{-1,6,5,3,4,2,9,0,8},所有和等于8的数对包括(-1,9),(0,8),(2,6),(3,5)。直原创 2016-05-26 23:36:51 · 1186 阅读 · 0 评论 -
51nod 1090 3个数和为0
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1090题目:给出一个长度为N的无序数组,数组中的元素为整数,有正有负包括0,并互不相等。从中找出所有和 = 0的3个数的组合。如果没有这样的组合,输出No Solution。如果有多个,按照3个数中最小的数从小到大排序,如果最小的数相等则按照第二原创 2016-06-06 11:39:07 · 1071 阅读 · 0 评论 -
51nod 1267 4个数和为0
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1267题目:给出N个整数,你来判断一下是否能够选出4个数,他们的和为0,可以则输出"Yes",否则输出"No"。Input第1行,1个数N,N为数组的长度(4 <= N <= 1000)第2 - N + 1行:A[i](-1原创 2016-06-06 19:32:23 · 863 阅读 · 0 评论 -
51nod 1128 正整数分组 V 二分+贪心
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1128题意:给出一个长度为N的正整数数组,不改变数组元素的顺序,将这N个数分为K组。各组中元素的和分别为S1,S2....Sk。如何分组,使得S1至Sk中的最大值最小?例如:1 2 3 4 5 6分为3组,{1 2 3} {4 5} {6},元素原创 2016-06-08 09:23:48 · 1356 阅读 · 0 评论 -
51nod 1010 只包含因子2 3 5的数
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1010题目:K的因子中只包含2 3 5。满足条件的前10个数是:2,3,4,5,6,8,9,10,12,15。所有这样的K组成了一个序列S,现在给出一个数n,求S中 >= 给定数的最小的数。例如:n = 13,S中 >= 13的最小的数是原创 2016-06-08 09:46:38 · 901 阅读 · 0 评论 -
51nod 1278 相离的圆
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1278题目:平面上有N个圆,他们的圆心都在X轴上,给出所有圆的圆心和半径,求有多少对圆是相离的。例如:4个圆分别位于1, 2, 3, 4的位置,半径分别为1, 1, 2, 1,那么{1, 2}, {1, 3} {2, 3} {2, 4} {3,原创 2016-06-09 15:14:28 · 743 阅读 · 0 评论 -
hdu 4791 Alice's Print Service 二分
Problem DescriptionAlice is providing print service, while the pricing doesn't seem to be reasonable, so people using her print service found some tricks to save money.For example, the price whe原创 2017-09-03 10:01:48 · 474 阅读 · 0 评论