二分
RunningBeef
这个人很帅,所以……
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2019CCPC秦皇岛 A. Angle Beats
#include<bits/stdc++.h>#define IOS std::ios_base::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0);// 快读using namespace std;typedef long long ll;const ll inf = 4e9 + 1;const int N = 2E3 + 10;struct ty{ ll x,y;// x = (xa - x2) y =原创 2021-11-19 10:46:13 · 364 阅读 · 0 评论 -
HDU - 5884
一年前入门的题目了,当时没写出来,现在填坑题目Recently, Bob has just learnt a naive sorting algorithm: merge sort. Now, Bob receives a task from Alice.Alice will give Bob N sorted sequences, and the i-th sequence includes ai elements. Bob need to merge all of these sequences.原创 2021-10-07 13:37:11 · 198 阅读 · 0 评论 -
借教室 二分答案 + 差分 + 前缀和
链接:https://ac.nowcoder.com/acm/problem/16564来源:牛客网在大学期间,经常需要租借教室。大到院系举办活动,小到学习小组自习讨论,都需要向学校申请借教室。教室的大小功能不同,借教室人的身份不同,借教室的手续也不一样。面对海量租借教室的信息,我们自然希望编程解决这个问题。我们需要处理接下来n天的借教室信息,其中第i天学校有ri个教室可供租借。共有m份订单,每份订单用三个正整数描述,分别为dj, sj, tj,表示某租借者需要从第sj天到第tj天租借教室(包括原创 2021-02-23 18:18:36 · 306 阅读 · 0 评论 -
lower_bound、upper_bound模拟及解析
解析注释在对应代码如果查找不到x,lower_bound(ll x)返回值和upper_bound(ll x)返回值相同 既从左到右第一个大于x的数思路①判断循环结束条件②判断left ,right是否进行左移右移③判断最后一次二分后x的位置(存在x)时//设查找的数为x//x 属于 [lower,upper) //二分:每次砍掉一半无用区间,但不砍掉可能存在的答案, 可以自己动手演算一遍,体会过程int lower(ll x){//左闭 找区间最左x的数组下标 in.原创 2021-02-14 22:18:43 · 462 阅读 · 0 评论 -
Pie
PieMy birthday is coming up and traditionally I’m serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This should be one piece o原创 2020-10-22 23:04:43 · 189 阅读 · 0 评论
分享