跳到正文

剪贴板

剪贴板 y6z2mt11

原文
剪贴板信息

剪贴板信息

收录
更新
C++
#include<ctype.h>
namespace fasti{
	char buf[1<<21],*p1=buf,*p2=buf;
	inline char getc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*(p1++);}
	inline void read(int&x){
        char c=getc(),f=0;
        for(;!isdigit(c);c=getc())f^=!(c^'-');
        for(x=0;isdigit(c);c=getc())x=x*10+(c^48);
        if(f)x=-x;--p1;
	}
	template<typename... Args>
	inline void read(int&x,Args&...args){read(x),read(args...);}
}
using fasti::getc;
using fasti::read;
namespace fasto{
	char obuf[1<<21],stk[20];int o_p=-1,tp;
	inline void flush(){fwrite(obuf,1,o_p+1,stdout),o_p=-1;}
	inline void print(char c){if(o_p==(1<<21)-1)flush();obuf[++o_p]=c;}
	void print(int x){
		for(stk[tp=0]=x%10;x>9;stk[++tp]=x%10)x/=10;
		for(;~tp;)print((char)(stk[tp--]|48));
	}
	template<typename T,typename... Args>
	void print(T x,Args... args){print(x),print(args...);}
}
using fasto::flush;
using fasto::print;