08 2022 档案

摘要:O(nlogn) 做法 我在考场上只想到此做法,不难想到,可以将三段用二分预处理。 xs[i]表示从ai开始总和为P的末尾编号,可以用二分处理。 最后 O(n) 判断即可。 #include <bits/stdc++.h> #define ll long long us 阅读全文
posted @ 2022-08-23 14:12 KevinLikesCoding 阅读(65) 评论(0) 推荐(0) 编辑
摘要:今天看jiangly代码的时候,发现jiangly用vector而不是数组: 于是我测试了一下。 #include <bits/stdc++.h> using namespace std; const int N=1e8; int a[N]; vector<int>b(N); vector<int> 阅读全文
posted @ 2022-08-22 21:39 KevinLikesCoding 阅读(155) 评论(0) 推荐(0) 编辑
摘要:Educational Codeforces Round 132 (Rated for Div. 2) B #include <bits/stdc++.h> #define ll long long using namespace std; const ll N=1e5+5; ll a[N],s1[ 阅读全文
posted @ 2022-08-14 10:12 KevinLikesCoding 阅读(67) 评论(0) 推荐(0) 编辑
摘要:Miller-Rabin 素数判断 #include <bits/stdc++.h> #define ll long long using namespace std; const int T=10; ll n; ll fp(ll a,ll r,ll p){ ll res=1; for(;r;r>> 阅读全文
posted @ 2022-08-12 13:35 KevinLikesCoding 阅读(40) 评论(0) 推荐(0) 编辑
摘要:多项式乘法 FFT #include <bits/stdc++.h> using namespace std; const int N=1e7+6; const double P=acos(-1); int n,m; struct node{ double x,y; node(double xx=0 阅读全文
posted @ 2022-08-09 13:10 KevinLikesCoding 阅读(69) 评论(0) 推荐(0) 编辑
摘要:计算圆周率,最简单的是莱布尼茨公式: $$ \begin{align} \arcsin x &= x-\frac{x^3}{3}+\frac{x^5}{5}-\cdot \cdot \cdot \ 代入x=1得:\frac{\pi}{4} &=\sum_{i=0}^{\infty}{\frac{(- 阅读全文
posted @ 2022-08-06 18:05 KevinLikesCoding 阅读(282) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示