不能再快了的read
credit : http://zonelikewonderland.tk/#/user/blog/details/481e27461fe6602e138b154ca8379587
const int buffsize=1e5; char buf[buffsize],*pp=buf-1; int readsize=0,freadsize=0; inline void readinit(){ fread(buf+(((readsize+buffsize-1)%buffsize>=buffsize/2-1)?0:buffsize/2),1,buffsize/2,stdin); freadsize+=buffsize/2; } inline int read(){ if(readsize+buffsize/2>freadsize)readinit(); while((++readsize,*++pp)<'-')if(pp==buf+buffsize-1)pp=buf-1; register int x=*pp&15; if(pp==buf+buffsize-1)pp=buf-1; while((++readsize,*++pp)>'-'){ x=x*10+(*pp&15); if(pp==buf+buffsize-1)pp=buf-1; } if(pp==buf+buffsize-1)pp=buf-1; return x; }
比我那个快。