本题巨多坑:
1.请不要使用
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
否则会导致格式错误 => WA
2.本题非常卡常,请使用快读
inline int read()
{
char c;int res=0,flag=1;
for(;!isdigit(c);c=getchar())if(c=='-')flag=-1;
for(;isdigit(c);c=getchar())res=res*10+c-'0';
return res*flag;
}
3.「注意」: 不保证给出的区间 [x,y]有x<=y ,如果 x>y 请交换 x , y 。