跳到正文

个人记录

快读快写模板

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

文章信息

发布
2025年12月7日
收录
2026年5月21日
更新
2026年11月10日
篇幅
约 1 分钟

版本

  1. v2当前
  2. v1
C++
const int SZ=1<<21;
char buf[SZ],*p1=buf,*p2=buf,obuf[SZ],*p3=obuf;
#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,SZ,stdin),p1==p2)?EOF:*p1++)
#define pc(c) ((p3-obuf==SZ&&(fwrite(obuf,1,SZ,stdout),p3=obuf)),*p3++=(c))
#define flush() fwrite(obuf,1,p3-obuf,stdout)
inline int rd(){int x=0;bool f=0;char c=gc();for(;!isdigit(c);f|=(c=='-'),c=gc());for(;isdigit(c);x=(x<<1)+(x<<3)+(c&15),c=gc());return (f?-x:x);}
inline void wt(int x){char s[20];short t=0;x<0&&(pc('-'),x=-x);do s[t++]=x%10+48,x/=10;while(x);while(t--)pc(s[t]);}
原文