首页 > 其他 > 详细

fastIO模板

时间:2017-09-11 09:49:44      阅读:556      评论:0      收藏:0      [点我收藏+]

freadIO整理

 1 namespace fastIO{
 2     #define BUF_SIZE 100000
 3     bool IOerror=0;
 4     inline char nc() {
 5         static char buf[BUF_SIZE],*p1=buf+BUF_SIZE,*pend=buf+BUF_SIZE;
 6         if(p1==pend){
 7             p1=buf;
 8             pend=buf+fread(buf,1,BUF_SIZE,stdin);
 9             if(pend==p1){
10                 IOerror=1;
11                 return -1;
12             }
13         }
14         return *p1++;
15       }
16       inline bool blank(char ch) {
17           return ch== ||ch==\n||ch==\r||ch==\t;
18       }
19       inline void read(int &x) {
20           char ch;
21           while(blank(ch=nc()));
22           if(IOerror)    return;
23           for(x=ch-0;(ch=nc())>=0&&ch<=9;x=(x<<3)+(x<<1)+ch-0);
24       }
25       #undef BUF_SIZE
26   };
27 using namespace fastIO;

 

fastIO模板

原文:http://www.cnblogs.com/elpsycongroo/p/7503097.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!