关于快速读入

P1744 采购特价商品

@[Kevin_ss](/space/show?uid=159011) - 楼主啊,搞错啦 - 应给是 ```cpp inline int read(){ register int ans=0;register char c=0;register bool f=0; while(!isdigit(c)) f|=c=='-',c=getchar(); while(isdigit(c)) ans=(ans<<1)+(ans<<3/*这里是3*/)+(c^'0'),c=getchar(); return f?-ans:ans; } ```
by 反手一只MJJ @ 2019-08-05 21:34:11


@[反手一只MJJ](/space/show?uid=134593) 我的天打太快看来看去没发现,谢谢你啦~
by Umaru_ @ 2019-08-05 21:36:19


其实不加fread的话这个快读貌似比scanf快不了多少QAQ
by ziye @ 2019-08-05 21:56:14


@[ziye](/space/show?uid=29832) 大数据的话就会很明显了
by ZEROLANE @ 2019-08-05 21:58:42


@[_東方零闇_](/space/show?uid=225318) 10000000个int型 实测scanf 6s左右 cin关闭流同步5s左右 这个快读3s左右 fread不到0.5s
by ziye @ 2019-08-05 22:06:47


@[ziye](/space/show?uid=29832) scanf和快读之间差别是大吧3s,我又没有说到fread
by ZEROLANE @ 2019-08-05 22:11:09


@[ziye](/space/show?uid=29832) fread加上是要快很多,我也没说不快鸭QAQ
by ZEROLANE @ 2019-08-05 22:12:27


@[_東方零闇_](/space/show?uid=225318) 嘤嘤嘤但是只有fread可以进1s其他的都得t鸭
by ziye @ 2019-08-05 22:13:52


|