主元法是处理转移环的套路,线性递推可以设少量主元直接递推,或者是设部分主元来减少未知数的数量。 #include<cstdio>#include<cstring>#include<iostream>using namespacestd;#definedb double#defineeps 1e-12constintM =205;intread(){intx=0,f=1;charc;while((c=getchar())<'0'|| c>'9') {if(c...
C202044zxy 博客园 首页 新随笔 联系 订阅 管理 [省选集训2022] 模拟赛16 小Z与函数 题目描述 在2022/3/242022/3/24 上午,zxyzxy 看到了一个函数: int get(int n) { int res=0; for(int i=1;i<=n;i++) { int vs=0; for(int j=i;j<=n;j++) if(a[i]...
C202044zxy Rating 1500 Email 16549695@qq.com QQ Unfilled 格言 访问C202044zxy 的博客 Rating 变化 08:15:15 1100 1200 1300 1400 1500 1600 1700 1800 1900 C202044zxy AC 过的题目:共 0 道题 无
voidadd(intc){intp=last,np=last=++cnt;val[cnt]=1; a[np].len=a[p].len+1;for(;p && !a[p].ch[c];p=a[p].fa) a[p].ch[c]=np;if(!p) a[np].fa=1;else{intq=a[p].ch[c];if(a[q].len==a[p].len+1) a[np].fa=q;else{intnq=++cnt; a[nq]=a[q];a[nq].len...
#include <cstdio> #include <vector> #include <iostream> using namespace std; const int M = 505; int read() { int x=0,f=1;char c; while((c=getchar())<'0' || c>'9') {if(c=='-') f=-1;} while(c>='0' && c<='9') {x=(x<<3)+(x<<1)+(c^48);c=getchar(...
#include <cstdio> #include <iostream> #include <algorithm> #include <queue> using namespace std; const int M = 60005; const int inf = 0x3f3f3f3f; int read() { int x=0,f=1;char c; while((c=getchar())<'0' || c>'9') {if(c=='-') f=-1;} while(c>='0' && c<=...
昵称: C202044zxy 园龄: 4年5个月 粉丝: 213 关注: 57 +加关注 搜索 随笔分类 dp(123) dp---背包(27) dp---动态dp(5) dp---区间dp(11) dp---树形dp(22) dp---数位dp(7) dp---状压dp(27) 其他---cdq分治(7) 其他---博弈论(18) 其他---拆分法(16) 其他--...
C202044zxy 博客园 首页 新随笔 联系 订阅 管理 [模板] BEST 定理 一、题目 点此看题 二、解法 这篇博客主要记录我的感性理解,相信能帮助你直观地理解 BESTBEST 定理。 首先对于一条欧拉路径,我们考虑保留每个点的最后一条出边。可以证明出边一定构成一棵内向树,我们只需要证明不会构成环,而如果构成...
<iostream>using namespacestd;constintM =80005;constintup =1e8;#definepii pair<int,int>#definemake make_pairintread(){intx=0,f=1;charc;while((c=getchar())<'0'|| c>'9') {if(c=='-') f=-1;}while(c>='0'&& c<='9') {x=(x<<3)+(x<<1)+(c^48);c=getchar();}...
昵称: C202044zxy 园龄: 4年6个月 粉丝: 219 关注: 57 +加关注 搜索 随笔分类 dp(123) dp---背包(26) dp---动态dp(5) dp---区间dp(11) dp---树形dp(22) dp---数位dp(7) dp---状压dp(27) 其他---cdq分治(7) 其他---博弈论(18) 其他---拆分法(16) 其他--...