完全平方数 + 题目链接: "https://ac.nowcoder.com/acm/contest/37/A" 涉及知识点: + 暴力/二分 solution: + $祝大家周末愉快$ + $[1,n]区间的完全平方数的个数等于$ $\sqrt{n}$ + $[L,R]区间的完全平方数的个数可以理 ...
分类:
其他好文 时间:
2020-04-11 10:18:41
阅读次数:
63
听说位运算挺好玩的,那这节总结一下ACM中可能用到的位运算技巧。(可能更新) XOR运算极为重要!!(过[LC136](只出现一次的数字 - 力扣(LeetCode)):数组中每个数字都出现两次,只有一个出现一次,找到出现一次的数字) 1. 如果我们对 0 和二进制位做 XOR 运算,得到的仍然是这 ...
分类:
其他好文 时间:
2020-04-11 10:14:45
阅读次数:
66
题目:https://vjudge.net/contest/364745#problem/B 先用三分求出最高点Y,然后在进行二分,求出角度 注意写法 PI的弧度是 acos(-1)/2-EPS接近90度的时候相当于除以0二分的精度可以用迭代次数来保证,比如100次 #include <iostre ...
分类:
其他好文 时间:
2020-04-10 00:57:31
阅读次数:
82
A.CodeForces-124A (简单数学题) #include<cstdio> #include<algorithm> #include<iostream> #include<cmath> using namespace std; int main(){ int a,b,n; scanf("% ...
分类:
其他好文 时间:
2020-04-09 15:32:13
阅读次数:
84
前置知识: 混合图:一幅图中既有单向边,又有双向边。 混合图(既有有向边又有无向边的图)中欧拉环、欧拉路径的判定需要用到网络流这个算法!!! 有向图的欧拉回路的条件:所有的节点出度等于入度。 下面这两题基本差不多,但是建边啊、判断欧拉图啊等还是有区别的。 总之最后都是需要判断是否为满流,如果为满流则 ...
分类:
其他好文 时间:
2020-04-09 14:11:58
阅读次数:
134
``` #include #include #define int long long using namespace std; const int N=4010,mod=1e9+7; int a[N]; int e[N*N],ne[N*N],idx,h[N]; int st[N]; int ans... ...
分类:
其他好文 时间:
2020-04-09 10:53:11
阅读次数:
150
``` #include #include #include #include #include #include using namespace std; #define LL long long const int N=1010; int val[N][N]; int res[N][N]; ch... ...
分类:
其他好文 时间:
2020-04-09 10:34:36
阅读次数:
114
题意 给一个字符串$s$,求最长回文子串 题解 马拉车算法的模板题。 首先,预处理字符串$s$,在每个字符的左边和右边都插上一个特殊符号,比如 ,目的是保证字符串的长度为奇数。举例来说, $\rightarrow$ ,`abcd a b c d a b c @ a b c $`。(如果声明的是全局变 ...
分类:
其他好文 时间:
2020-04-08 22:34:50
阅读次数:
73
"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says. "The second problem is, given an positiv ...
分类:
其他好文 时间:
2020-04-08 22:33:31
阅读次数:
83
A:https://vjudge.net/contest/366415#problem A是是找规律的题目,找几个数据就可以得出答案。或者自己一步步论证得出,做题的说话是一步步论证得出的。 #include<iostream> #include<cstdio> #include<set> #incl ...
分类:
其他好文 时间:
2020-04-08 21:02:34
阅读次数:
92