用有限的生命,投放到无限的为蒟蒻(自己)的服务中
Think twice,code once
快读快写板子
namespace IO{
char *p1,*p2,*p3,buf[100000],buf2[100000];
#define LOCAL
#ifndef LOCAL
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++)
#define flush() (fwrite(buf2,1,p3-buf2,stdout),p3=buf2)
#define putchar(ch) (p3==buf2+100000&&flush(),*p3++=(ch))
struct Manager{
Manager(){p3=buf2;}
~Manager(){flush();}
}_;
#endif
template<typename T>
inline void read(T &x){
int f=1,ch=getchar();x=0;
while(ch!=EOF&&!isdigit(ch)){
if(ch=='-') f=-f;
ch=getchar();
}
while(isdigit(ch)){
x=(x<<3)+(x<<1)+ch-'0';
ch=getchar();
}
x*=f;
}
inline void read(char &ch){
ch=getchar();
}
inline void read(char* s){
int ch=getchar();
while(ch!=EOF&&isspace(ch)) ch=getchar();
while(ch!=EOF&&!isspace(ch)){
*s++=(char)ch;
ch=getchar();
}
*s='\0';
}
template<typename T>
inline void write(T x){
if(x<0) putchar('-'),x=-x;
if(x>9) write(x/10);
putchar(x%10+'0');
}
inline void write(char ch){
putchar(ch);
}
inline void write(const char* s){
while(*s) putchar(*s++);
}
inline void write(char* s){
while(*s) putchar(*s++);
}
template<typename T>
inline void writeln(T x){
write(x),putchar('\n');
}
template<typename T,typename... Args>
inline void read(T &&x,Args&&... args){
read(x),read(std::forward<Args>(args)...);
}
template<typename T,typename... Args>
inline void write(T x,Args... args){
write(x),putchar(' '),write(args...);
}
template<typename T,typename... Args>
inline void writeln(T x,Args... args){
write(x),putchar(' '),writeln(args...);
}
}using namespace IO;出品,必属 __ __




