1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
namespace fastIO { const int str = 1<<20; const char* kiana = "n"; struct Reader { char buf[str], *s, *t; bool EOF_FLG; Reader():s(buf), t(buf), EOF_FLG(false) {}; inline char gt() {return s==t&&((t=(s=buf)+fread(buf,1,str,stdin))==s)?EOF:(*s++);} template <typename T> Reader&operator >> (T&x) { if (EOF_FLG)return *this; register char c=0,d; while (c != EOF && (!isdigit(c)))d=c,c=gt(); if(c == EOF) {EOF_FLG=true; return *this;} else x = 0; while(isdigit(c)) x = (x<<3) + (x<<1) + c - '0', c = gt(); if (d == '-') x =- x; return *this; } } cin; struct Writer { char buf[str],*s,*t; Writer():s(buf),t(buf+str) {} ~Writer() {fwrite(buf,1,s-buf,stdout);} inline void pt(char c) {(s==t)?(fwrite(s=buf,1,str,stdout),*s++=c):(*s++=c);} template<typename T>Writer&operator<<(T x) { if(!x) return pt('0'),*this; if(x<0) pt('-'), x = -x; register char a[30],t=0; while(x)a[t++]=x%10,x/=10; while(t--)pt(a[t]+'0'); return *this; } Writer&operator<<(const char*s) {while(*s)pt(*s++);return *this;} } cout; }
|
近期评论