namespace LgxTpre { static const int MAX=200010; static const int inf=2147483647; static const int INF=4557430888798830399; int n,q,dis[MAX],siz[MAX],f[MAX],ans; int x,y,z,k,w; vector<pii> G[MAX]; inline void lmy_forever() { read(n,q); for(int i=1;i<n;++i) read(x,y...
本文作者:LgxTpre 本文链接:https://www.cnblogs.com/LittleTwoawa/p/16873249.html 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。 posted @2022-11-09 12:42LgxTpre阅读(95) 评论(0)编辑 博客园 首页
本文作者:LgxTpre 本文链接:https://www.cnblogs.com/LittleTwoawa/p/17216184.html 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。 posted @2023-03-14 20:10LgxTpre阅读(54) 评论(0)编辑 博客园 首页
namespace LgxTpre { static const int MAX=100010; static const int inf=2147483647; static const int INF=4557430888798830399; int n,m,ans; char s[MAX]; namespace Sieve { constexpr int N=100000; int vis[N+10],P[MAX],Pcnt; vector<int> fac[MAX]; ...
LgxTpre { static const int MAX=10010; static const int inf=2147483647; static const int INF=4557430888798830399; static const int mod=1e9+7; static const int bas=131; namespace Geometry { struct Point { int x,y; Point(int X=0,
LgxTpre { static const int MAX=500000; static const int inf=2147483647; static const int INF=4557430888798830399; static const int mod=998244353; static const int bas=131; int n,val[MAX],fa[MAX]; vector<int> G[MAX]; int f[MAX][3...
LgxTpre+ 关注 园龄:2年4个月粉丝:24关注:6 2023ZR-NOIP二十连 好多不会做又不想抄怎么办???Day1A-游戏当前局面必败当且仅当后继状态全部必胜,当前局面必胜当且仅当存在一个后继状态必败。打表观察 SG 函数或者暴力搜出所有状态拓扑,可以发现后手必胜当且仅当 m=0m=0。初始集合为空是后手必胜,否则...
namespace LgxTpre { static const int MAX=8010; static const int inf=2147483647; static const int INF=4557430888798830399; static const int mod=1e9+7; static const int bas=131; char s[MAX]; int n,a[MAX],num,rop,pre[MAX]; int bck[MAX],cnt,box[MAX],con; int...
题目链接 这天做双面棋盘这道题,发现题解里面大多都是 LCT ,对于线段树套并查集的写法思路讲评很少而且不大清晰,因此有了这一篇题解。 维护联通块的数量,很容易联想到使用并查集,考虑暴力,用并查集记录每个点的连通性,最后统计块数即可。但是如果每次进行格子翻转的
namespace LgxTpre { constexpr int MAX=200010; constexpr int inf=2147483647; constexpr int INF=4557430888798830399; int n,m,k,w,v[MAX]; vector<pii> G[MAX]; unordered_map<int,int> p; int tag[MAX],dfn[MAX],ilp[MAX],tmp[MAX],lt[MAX],fa[MAX],tot; int...