警示后人
查看原帖
警示后人
800703
xxxxxxxb楼主2023/10/4 00:07

这题快读不可以用cin解绑,尽管大多数情况下它可以 附fread快读:

#include <bits/stdc++.h>
using namespace std;
namespace IO {
    #define ll long long
    const int MAX = 1<<23;
    char buf[MAX],*p1=buf,*p2=buf;
    char obuf[MAX],*o=obuf;
    #define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
    template<typename T = ll>
    inline T read() {
        T res = 0;
        int f = 1;
        char c = gc();
        while(!isdigit(c)) {
            if(c=='-') f=-1;
            c=gc();
        }
        while(isdigit(c)) {
            res = (res<<3)+(res<<1)+(c^48);
            c=gc();
        }
        return res*f;
    }
    void print(ll x) {
        if(x > 9) print(x/10);
        *o++=(x%10)+'0';
    }
    void pc(char c) {
        *o++=c;
    }
    void write(ll x,char end) {
        if(x<0) pc('-');
        print(abs(x));
        pc(end);
    }
    void flush() {
        fwrite(obuf,o-obuf,1,stdout);
        o = obuf;
    }
    #undef ll
}
using IO::read,IO::write,IO::flush;
2023/10/4 00:07
加载中...