快读快写模板

· · 个人记录

#include <bits/stdc++.h>
using namespace std;

const int LO = 1 << 20;
char buffer[LO], *ss, *tt;
#define getchar() (ss == tt && (tt = (ss = buffer) + fread(buffer, 1, LO, stdin), ss == tt) ? EOF : *ss++)
char obuf[LO], *os = obuf;
#define putchar(c) (os == obuf + LO ? (fwrite(obuf, 1, LO, stdout), os = obuf) : 0, *os++ = (c))

int read(){
    int x = 0;
    char c = getchar();
    for(;c < '0' || c > '9';) c = getchar();
    for(;c >= '0' && c <= '9';c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
    return x;
}

void write(int x){
    int s[10], tp = 0;
    do{
        s[tp++] = x % 10;
        x /= 10;
    }while(x);
    for(;tp;) putchar(s[--tp] + '0');
}

int main(){

    fwrite(obuf, 1, os - obuf, stdout);
    return 0;
}