![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
题解
文章平均质量分 58
钟钟终
知耻而后勇,脚踏实地
展开
-
div3 C D F
https://codeforces.com/contest/1538/problem/C C 又忘记使用lower_bound()和upper_bound() 1.统计l-a[i]和r-a[i]的个数,对于每a[i]进行累加。 2. lower_bound找到第一个大于等于l-a[i]的坐标; upper_bound找到第一个大于r-a[i]的坐标; 两者做差,正好为满足条件的个数。 #include <bits/stdc++.h> using namespace std; typedef原创 2021-06-11 18:35:48 · 170 阅读 · 1 评论 -
div2.B C
https://codeforces.com/contest/1536/problem/B 题意分析了样例很快理解了,思路也很简单,就是类似进位的操作。 但是不知道怎么模拟字符串的更新,就放弃了。 后来发现: 字符串存储的ASCII值,可以利用加减直接对其进行操作。 找到一个长度最小,且字典序最小,且给定字符串中没出现的子字符串。 #include <iostream> using namespace std; int main() { int t; cin>>t原创 2021-06-07 14:29:10 · 188 阅读 · 0 评论 -
div2 .c
https://codeforces.com/contest/1526/problem/C1 stl容器: 1.采用优先队列,将队列中最小值放到队首。 2.由于题目要求,在满足累加值大于等于0的情况下,能喝的最大药剂数量。 3.如果出现负数,减去队列中最小值,则必然为正。 4.最后队列的大小就是最大数量。 #include<bits/stdc++.h> using namespace std; typedef long long ll; int a[2005]; priority_queue&l原创 2021-06-02 17:31:39 · 123 阅读 · 0 评论 -
div2. #722 B
B. Sifid and Strange Subsequences A sequence (b1,b2,…,bk) is called strange, if the absolute difference between any pair of its elements is greater than or equal to the maximum element in the sequence. Formally speaking, it’s strange if for every pair (i,j原创 2021-05-25 23:20:12 · 134 阅读 · 0 评论 -
dive2.D - Armchairs
拖了这么久,不愧是我。原创 2021-05-20 01:55:13 · 563 阅读 · 4 评论