正文
增加 67 行删除 1 行
82 行未改动8384858687888990911,003 行未改动全部展开82 行未改动}```:::::::::::success[数据结构]:::info[文艺平衡树(1016B)]FHQ Treap。1,003 行未改动全部展开82 行未改动83848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571,003 行未改动全部展开82 行未改动}```::::::info[除掉主函数的缺省源]```cpp#include<bits/stdc++.h>#include<ext/pb_ds/assoc_container.hpp>#include<ext/pb_ds/tree_policy.hpp>#include<ext/pb_ds/hash_policy.hpp>#include<ext/pb_ds/trie_policy.hpp>#include<ext/pb_ds/list_update_policy.hpp>#include<ext/pb_ds/priority_queue.hpp>#include<ext/rope>#define For(a,b,c) for(int a=(int)b;a<=(int)(c);a++)#define Fro(a,b,c) for(int a=(int)b;a>=(int)(c);a--)#define Fov(e,g) for(auto e:g)#define ms(a) memset(a,0,sizeof (a))#define msinf(a) memset(a,0x3f,sizeof (a))#define mss(a,b) memset(a,b,sizeof (a))#define mcp(a,b) memcpy(a,b,sizeof (a))#define fill(a,n,k) fill(a+1,a+1+n,k)#define fil(v,k) fill(v.begin(),v.end(),k)#define Pii pair<int,int>#define Inline __inline__#define ppc __builtin_popcount#define ctz __builtin_ctz#define fi first#define se second#define y1 y1ovo#define y2 y2ovo#define j1 j1ovo#define j2 j2ovo#define mkp make_pair#define pb push_back#define Int signed#define uint unsigned#define ll long long#define ull unsigned long long#define lll __int128#define ulll __uint128_t#define lld long double#define stdpq std::priority_queue#define Fopen(in) freopen(in".in","r",stdin);freopen(in".out","w",stdout);#ifndef ONLINE_JUDGE#define Ending return cerr<<"\nTime Used: "<<fixed<<setprecision(0)<<clock()<<" ms",0#else#define Ending return 0#endif#define LL#ifdef LL#define int long long#define inf 0x3f3f3f3f3f3f3f3f#else#define inf 0x3f3f3f3f#endifusing namespace std;using namespace __gnu_pbds;using namespace __gnu_cxx;namespace fast_IO{constexpr int BITSIZE=1<<16;char inBuffer[BITSIZE],outBuffer[BITSIZE],*startPtr=inBuffer,*endPtr=inBuffer,*outPtr=outBuffer;#ifdef ONLINE_JUDGE#define getchar() ((startPtr==endPtr&&(endPtr=(startPtr=inBuffer)+fread(inBuffer,1,BITSIZE,stdin),startPtr==endPtr)?EOF:*startPtr++))#endif#define putchar(x) ((outPtr==outBuffer+BITSIZE&&(fwrite(outBuffer,outPtr-outBuffer,1,stdout),outPtr=outBuffer),*outPtr++=x))#define cin io#define cout io#define Happy cout.flush();void read(){}void write(){}template<typename T>bool read(T&s){s=0;int w=1;char c;while(c=getchar(),!isdigit(c)&&c!=EOF)if(c=='-')w=-1;if(c==EOF)return 0;while(isdigit(c))s=s*10+c-48,c=getchar();return s*=w,1;}bool read(char&s){while(s=getchar(),isspace(s));return s!=EOF;}bool read(char*s){char c;while(c=getchar(),isspace(c));if(c==EOF)return 0;while(!isspace(c)&&c!=EOF)*s++=c,c=getchar();return *s=0,1;}bool read(std::string&s){s="";char c;while(c=getchar(),isspace(c));if(c==EOF)return 0;while(!isspace(c)&&c!=EOF)s+=c,c=getchar();return 1;}template<typename T>bool read_f(T&x){x=0;T w=1;char c;while(c=getchar(),!isdigit(c)&&c!=EOF)if(c=='-')w=-1;if(c==EOF)return 0;while(isdigit(c))x=x*10+(c^48),c=getchar();if(c=='.'){T f=0,k=1;while(c=getchar(),isdigit(c))f=f*10+(c^48),k*=10;x+=f/k;}x*=w;return 1;}bool read(float&x){return read_f(x);}bool read(double&x){return read_f(x);}bool read(long double&x){return read_f(x);}template<size_t N>bool read(std::bitset<N>&b){b.reset();char c;while(c=getchar(),c!='0'&&c!='1'&&c!=EOF);if(c==EOF)return 0;static char buf[N+5];int i=0;do{buf[i++]=c;c=getchar();}while((c=='0'||c=='1')&&i<N);for(int j=0;j<=i-1;j++)if(buf[j]=='1')b[i-1-j]=1;return 1;}template<typename T>void write(T x){if(x<0)putchar('-'),x=-x;static char st[45];int tp=0;do st[++tp]=x%10+48,x/=10;while(x);while(tp)putchar(st[tp--]);}void write(char x){putchar(x);}void write(char*x){int l=strlen(x);for(int i=0;i<l;i++)putchar(x[i]);}void write(const char*x){int l=strlen(x);for(int i=0;i<l;i++)putchar(x[i]);}void write(std::string x){for(char c:x)putchar(c);}template<typename T>void writef(T x,int k){if(x<0)putchar('-'),x=-x;x+=0.5*pow(10,-k);ull n=x;write(n);if(k>0){putchar('.');x-=n;For(i,1,k){x*=10;int c=(int)x;putchar(c+48);x-=c;}}}[[deprecated]]void write(float x){writef(x,6);} [[deprecated]]void write(long double x){writef(x,6);} [[deprecated]]void write(double x){writef(x,6);}template<size_t N>void write(std::bitset<N>b){write(b.to_string());}template<typename T,typename ...Tp>void write(T x,Tp ...y){write(x),write(y...);}template<typename T,typename ...Tp>void read(T &x,Tp &...y){read(x),read(y...);}struct FstIO{bool s=1;void flush(){fwrite(outBuffer,outPtr-outBuffer,1,stdout);outPtr=outBuffer;}~FstIO(){flush();}explicit operator bool()const{return s;}}io;template<typename T>FstIO&operator>>(FstIO&i,T&b){i.s=read(b);return i;}template<typename T>FstIO&operator<<(FstIO&i,T b){write(b);return i;}}using namespace fast_IO;void freopen(string name="test",int type=1,string aaa="",string bbb=""){if(type==1){freopen((name+".in").c_str(),"r",stdin),freopen((name+".out").c_str(),"w",stdout);}else if(type==2){freopen((name+aaa).c_str(),"r",stdin),freopen((name+bbb).c_str(),"w",stdout);}else if(type==3){freopen((name+aaa).c_str(),"r",stdin),freopen((name+bbb).c_str(),"wb",stdout);}else if(type==4){freopen((name+aaa).c_str(),"wb",stdout);}else{return;}}class FastRand{private:ull s[4];ull rotl(const ull x,int k){return(x<<k)|(x>>(64-k));}ull next(){const ull res=rotl(s[0]+s[3],23)+s[0];const ull t=s[1]<<17;s[2]^=s[0];s[3]^=s[1];s[1]^=s[2];s[0]^=s[3];s[2]^=t;s[3]=rotl(s[3],45);return res;}public:FastRand(){mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());For(i,0,3)s[i]=rng();}int randint(int l,int r){ull range=(ull)r-l+1,v;if(range==0)return next();ull mask=(1ULL<<(64-__builtin_clzll(range-1)))-1;while((v=(next()&mask))>=range);return v+l;}double frand(double l,double r){const union {ull i;double d;}u={.i=0x3FF0000000000000ULL|(next()>>12)};return (u.d-1.0)*(r-l)+l;}}Rand;```:::::::::::success[数据结构]:::info[文艺平衡树(1016B)]FHQ Treap。1,003 行未改动全部展开