![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
三分/二分
wineandchord
这个作者很懒,什么都没留下…
展开
-
leetcode 4. Median of Two Sorted Arrays 二分
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assume nums1 and num...原创 2020-05-05 11:02:16 · 89 阅读 · 0 评论 -
POJ 2018 Best Cow Fences 斜率优化/二分
Best Cow Fences POJ - 2018有 N(1≤N≤100,000)N(1\le N\le 100,000)N(1≤N≤100,000) 块地,每块地有 n(1≤n≤2000)n(1\le n\le2000)n(1≤n≤2000) 头牛。在这些地之间建两个篱笆,这两个篱笆中间包含的是连续的地,使得该篱笆内平均每块地的牛数最多,每两个篱笆中间至少有 F(1≤F≤N)F(1\le ...原创 2020-03-24 09:34:37 · 166 阅读 · 0 评论 -
kickstart 2020A
链接文章目录Allocation 简单贪心Plates 多重背包Workout 二分Bundling 字符串 TrieAllocation 简单贪心ProblemThere are N houses for sale. The i-th house costs Ai dollars to buy. You have a budget of B dollars to spend.What ...原创 2020-04-19 18:57:54 · 232 阅读 · 0 评论 -
洛谷 P3382 【模板】三分法
三分法求函数极值#include<iostream>#include<cstdio>#include<cmath>#define MAXN 15using namespace std;int n;double l,r,a[MAXN];double eps=1e-7;double f(double x){ double res=0; ...原创 2020-04-15 22:21:30 · 83 阅读 · 0 评论