版本比较
题解:【CF1843F】 Omsk Metro
正文
增加 5 行删除 5 行
56 行未改动5758596061616263646538 行未改动1041051061071081081091101111126 行未改动11912012112212312312412512612729 行未改动15715815916016116116216316416516616616716816917029 行未改动56 行未改动}using namespace FastIO;
namespace MTool{ { #define TA template<typename T,typename... Args> #define TT template<typename T> static const int Mod=998244353; TT inline void Swp(T &a,T &b) {T t=a;a=b;b=t;}38 行未改动 static const int inf=2147483647; static const int INF=4557430888798830399; static const int mod=1e9+7; static const int bas=131;
struct node { int sum,minx,premin,sufmin,maxx,premax,sufmax; node(int Val=0) {sum=minx=premin=sufmin=maxx=premax=sufmax=Val;}6 行未改动 res.minx=min({l.minx,r.minx,l.sufmin+r.premin}),res.maxx=max({l.maxx,r.maxx,l.sufmax+r.premax}); return res; } };
namespace Link_Cat_Tree { int fa[MAX],ch[MAX][2],tag[MAX],siz[MAX],val[MAX]; node lmy[MAX];29 行未改动 inline void link(int x,int y) {makeroot(x); if(findroot(y)!=x) fa[x]=y;} inline void cut (int x,int y) {makeroot(x); if(findroot(y)==x&&fa[y]==x&&!ch[y][0]) fa[y]=ch[x][1]=0,pushup(x);} } using namespace Link_Cat_Tree;
int T,n,all,con; char c; int x,y,z; struct qry{int x,y,z,ans;}q[MAX];
inline void lmy_forever() { read(T); while(T--)29 行未改动