跳到正文

个人记录

一个非常快的快读(note)

XXX1234约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年10月23日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
char buf[1 << 21], *p1 = buf, *p2 = buf;

inline int qread() {
    register char c = getchar();
    register int x = 0, f = 1;
    while (c < '0' || c > '9') {
        if (c == '-') f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        x = (x << 3) + (x << 1) + (c ^ 48);
        c = getchar();
    }
    return x * f;
}
原文