rt,使用下面这个
const int LEN=114514;
char BUF[LEN],*Pin,*Pin_last,PUF[LEN],*Pout=PUF,*Pout_last=PUF+LEN-1;
char gc(){
return Pin==Pin_last&&(Pin_last=(Pin=BUF)+fread(BUF,1,LEN,stdin),Pin==Pin_last)?EOF:*Pin++;
}
void pc(char x){
if(Pout==Pout_last) fwrite(PUF,1,Pout-PUF,stdout),Pout=PUF;
*Pout++=x;
}
和下面这样
#define gc getchar
#define pc(x) putchar(x)
哪个会更快一些?还是因数据规模而定? 或者说这个属于玄学?
主席树模板2 我用上面那个比下面这个慢了将近100ms,而其他有些题我用上面那个能快200ms+