TLE on #10

P1972 [SDOI2009] HH的项链

@[sansesantongshun ](https://www.luogu.com.cn/user/866613) 你也许可以使用此类快读: ```cpp namespace io{ char buf[1048576],*p1,*p2; int x,ch; #define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1048576,stdin),p1==p2)?EOF:*p1++) inline int read(){ x=0,ch=getchar(); while(!isdigit(ch))ch=getchar(); do x=(x<<1)+(x<<3)+(ch^48),ch=getchar();while(isdigit(ch)); return x; } inline void write(const int &p){ if(9<p)write(p/10); putchar(p%10^48); } } ```
by xiaoyuhao0503 @ 2024-03-29 21:55:48


@[xiaoyuhao0503](/user/1238473) 单点查询+后缀和在常数上可以得到很大优化
by sansesantongshun @ 2024-04-16 22:12:06


|