正文
增加 7 行删除 21 行
1234567891011121314151617181920212223```cppnamespace IO{constexpr auto IO_maxn=1<<20;char IO_in[IO_maxn],IO_out[IO_maxn],*IO_p1=IO_in,*IO_p2=IO_in,*IO_p3=IO_out;inline void IO_flush(){fwrite(IO_out,1,IO_p3-IO_out,stdout);}inline char IO_getch(){return (IO_p1==IO_p2&&(IO_p2=(IO_p1=IO_in)+fread(IO_in,1,IO_maxn,stdin),IO_p1==IO_p2)?EOF:*IO_p1++);}inline void IO_putch(const char &IO_x){(IO_p3==IO_out+IO_maxn&&(IO_flush(),IO_p3=IO_out),*IO_p3++=(IO_x));}template<typename type>inline type IO_read(type &IO_x){IO_x=0;bool IO_flag(0);char IO_ch=IO_getch();while(!isdigit(IO_ch)){IO_flag^=IO_ch=='-',IO_ch=IO_getch();}while(isdigit(IO_ch)){IO_x=(IO_x<<1)+(IO_x<<3)+(IO_ch^48),IO_ch=IO_getch();}return IO_flag?IO_x=-IO_x:IO_x;}inline char IO_read(char &IO_x){do IO_x=IO_getch();while(isspace(IO_x));return IO_x;}inline void IO_read(char *IO_x){static char IO_ch;IO_read(IO_ch);do{*(IO_x++)=IO_ch;}while(!isspace(IO_ch=IO_getch())&&~IO_ch);}inline void IO_read(std::string &IO_x){static char IO_ch;IO_read(IO_ch),IO_x.clear();do{IO_x+=IO_ch;}while(!isspace(IO_ch=IO_getch())&&~IO_ch);}inline void IO_write(const char &IO_x){IO_putch(IO_x);}template<typename type>inline void IO_write(type *IO_x){while(*IO_x)IO_putch(*(IO_x++));}inline void IO_write(const std::string &IO_x){for(register int IO_i=0,IO_len=IO_x.length();IO_i<IO_len;++IO_i)IO_putch(IO_x[IO_i]);}template<typename type>inline void IO_write(type IO_x){if(IO_x<0)IO_x=-IO_x,IO_putch('-');static short IO_Stack[50],IO_top(0);do{IO_Stack[++IO_top]=IO_x%10,IO_x/=10;}while(IO_x);while(IO_top){IO_putch(IO_Stack[IO_top--]|48);}}struct IO_Basic{template<typename type>IO_Basic &operator>>(type &IO_x){IO_x=IO_read(IO_x);return (*this);}template<typename type>IO_Basic &operator<<(const type &IO_x){IO_write(IO_x);return (*this);}}IO_Cin,IO_Cout;class Flush{public:~Flush(){IO_flush();}}_;}using namespace IO;#define cin IO_Cin#define cout IO_Cout```123456789```cppconst int SZ=1<<21;char buf[SZ],*p1=buf,*p2=buf,obuf[SZ],*p3=obuf;#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,SZ,stdin),p1==p2)?EOF:*p1++)#define pc(c) ((p3-obuf==SZ&&(fwrite(obuf,1,SZ,stdout),p3=obuf)),*p3++=(c))#define flush() fwrite(obuf,1,p3-obuf,stdout)inline int rd(){int x=0;bool f=0;char c=gc();for(;!isdigit(c);f|=(c=='-'),c=gc());for(;isdigit(c);x=(x<<1)+(x<<3)+(c&15),c=gc());return (f?-x:x);}inline void wt(int x){char s[20];short t=0;x<0&&(pc('-'),x=-x);do s[t++]=x%10+48,x/=10;while(x);while(t--)pc(s[t]);}```