![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分三分
文章平均质量分 89
james_cil
这个作者很懒,什么都没留下…
展开
-
二分--LIGHTOJ 1088查找区间(水题)
#include #include #include using namespace std;const int maxN = 100005;int a[maxN];int t, tt;int n, q, x, y;int Bsearch_lower_bound(int x){ int l = 0, r = n - 1, mid = 0; while (l <=原创 2014-08-05 14:45:56 · 650 阅读 · 0 评论 -
二分--1043 - Triangle Partitioning
1043 - Triangle PartitioningPDF (English)StatisticsForumTime Limit: 0.5 second(s)Memory Limit: 32 MBSee the picture below.You are given AB, AC and B原创 2014-08-05 10:52:48 · 639 阅读 · 0 评论 -
二分---LIGHTOJ 1062
1062 - Crossed LaddersPDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBA narrow street is lined with tall buildings. An x foot long原创 2014-08-05 10:18:30 · 606 阅读 · 0 评论 -
二分---组合数,上界函数的使用
H - LIGHTOJ 1127Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionGiven n integers and a knapsack of weight W, you have to count the num原创 2014-08-06 09:46:06 · 882 阅读 · 0 评论 -
三分--Football Goal(面积最大)
#include#include#include#include#define eps 1e-9using namespace std;//308.812191double getsum(double c,double a,double b){double p=(a+b+c)/2.0;return c*c/4.0+sqrt(p*(p-a)*(p-b)*(p-c));}d原创 2014-08-07 19:26:02 · 696 阅读 · 0 评论 -
统计一个数字在排序数组中出现的次数(二分法)
#include#include#includeusing namespace std;int a[500001];int binarySearchFirstPos(int l, int r, int key){ int mid; while(l<=r){ mid =(l+r)/2; if(a[mid]<key) l=mid+1; else if(a[mid]>ke原创 2014-09-09 17:18:10 · 694 阅读 · 0 评论