快速读模板

不能与其它输入流混用

 1 inline char getChar() {
 2     static char str[300000];
 3     static int head = 0, tail = 0;
 4     if (head == tail) {
 5         tail = fread(str, 1, 300000, stdin);
 6         head = 0;
 7     }
 8     return str[head++];
 9 }
10 inline int get_int() {
11     int res = 0; char c = getChar();
12     while (!isdigit(c)) c = getChar();
13     while (isdigit(c)) res = res * 10 + c - '0', c = getChar();
14     return res;
15 }
View Code

 

posted @ 2018-09-24 02:51  hit_yjl  阅读(158)  评论(0编辑  收藏  举报