跳到正文

个人记录

超凶快读

wimpy_kitty约 2 分钟
原文
文章信息与版本

文章信息

发布
2025年8月22日
收录
2025年12月12日
更新
2026年11月18日
篇幅
约 2 分钟

版本

  1. v1当前
C++
namespace IN {
    const int MAXX_INPUT = 1000000;
    #define getc() (p1 == p2 && (p2 = (p1 = buf) + inbuf -> sgetn(buf, MAXX_INPUT), p1 == p2) ? EOF : *p1++)
    char buf[MAXX_INPUT], *p1, *p2;
    template <typename T> inline bool redi(T &x) {
        static streambuf *inbuf = cin.rdbuf();
        x = 0;
        register int f = 0, flag = false;
        register char ch = getc();
        while (!isdigit(ch)) {
        	ch = getc();
        }
        if (isdigit(ch)) x = x * 10 + ch - '0', ch = getc(),flag = true;
        while (isdigit(ch)) {
            x = x * 10 + ch - 48;
            ch = getc();
        }
        return flag;
    }
    template <typename T,typename ...Args> inline bool redi(T& a,Args& ...args) {
       return redi(a) && redi(args...);
    }
    #undef getc
}
void write(ll x){
    if(x<0)putchar('-'),x=-x;
    if(x>9)write(x/10);
    putchar(x%10+'0');
    return;
}
using IN::redi;
原文