![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分
文章平均质量分 72
GrayShore
这个作者很懒,什么都没留下…
展开
-
Educational Codeforces Round 117 (Rated for Div. 2)
A题暴力枚举即可 B:(贪心+构造) 题目大意:给出a b n n为偶数,构造一个长度为n的permutation,使得前n/2项的最小值为a,后n/2项的最大值为b。 思路:先将a放到序列中,再贪心地从大到小插入,同时用桶标记插入过的数,因为插入较大的数,就能尽可能保证剩下的数的最大值足够小,插完后将剩下的没被标记的数插入,最后再遍历一遍验证合法性即可 代码: #include<bits/stdc++.h> using namespace std; typedef long long ll;原创 2021-11-23 20:34:45 · 699 阅读 · 0 评论 -
CF780B The Meeting Place Cannot Be Changed
洛谷评级就是辣鸡 原题地址:https://vjudge.z180.cn/problem/CodeForces-782B 题面: The main road in Bytecity is a straight line from south to north. Conveniently, there are coordinates measured in meters from the southernmost building in north direction. At some points on t原创 2021-01-14 21:30:21 · 197 阅读 · 1 评论