![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分
YuHsin
退役Oier、ACMer,希望能在这里记录下来自己进步的点点滴滴。Github : https://github.com/YuHsin1998
知乎:https://www.zhihu.com/people/zhao-yu-xin-53-1
展开
-
反对称子串数目
题目描述定义字符串S为原串,SR为原串反转的到的字符串,SL为将原串中所有1变成0,0变成1得到的字符串。一个非空字符串,对于他的每个第i个位置的字符和倒数第i个位置的字符都不同,那么这个串为antisymmetry。特别的,如果一个字符串仅有0和1组成,那么当且仅当S=SLR的时候,他为antisymmetry。对于一个给定的01串(长度5*10^5),我们需要确定这个01串中连续.非空.且满足a原创 2016-12-31 09:52:55 · 761 阅读 · 2 评论 -
sduacm16级寒假训练 自测
POJ 3579 Median【sol】显然,每个点与其他的点形成的差是有序的,这样相当于有n组升序的序列,询问中位数。二分中位数,然后判断比他小的数的个数,复杂度n* logn*logn#include<cstdio>#include<iostream>#include<cstring>#include<cmath>#include<algorithm>using namespace原创 2017-02-16 16:15:15 · 556 阅读 · 0 评论 -
Day 1
B. Friends and Subsequences[Problems] There are two boys, every one of them has a integer sequencea a and b of length n(2*10^5). Now Being given a query of the form of pair of integers (l, r), you sho原创 2017-07-11 15:25:13 · 283 阅读 · 0 评论 -
2017暑期集训 Day 3
A - Can you solve this equation?[Problem] 询问 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y 的 小数解 [Solution] 显然,该函数单调,直接二分答案即可,最近get到二分新技巧,无脑for循环100次 [Code]#include<cstdio>#include<iostream>#include<map>原创 2017-07-13 13:58:27 · 341 阅读 · 0 评论