跳到正文

个人记录

快输(?

Eroded约 2 分钟
原文
文章信息与版本

文章信息

发布
2022年8月5日
收录
2025年12月12日
更新
2026年11月17日
篇幅
约 2 分钟

版本

  1. v1当前

Rt,随便打的

C++
namespace io{
	static char buf[1000100],*p1 = buf,*p2 = buf,res[10001000],*k1 = res;
	#define getchar() p1 == p2 && (p2 = (p1 = buf) + fread(buf,1,1000000,stdin),p1 == p2) ? EOF : *p1++
	inline int read(){
		register int x = 0,f = 1;
		register char ch = getchar();
		while(ch < 48 || ch > 57){
			if(ch == 45) f *= -1;
			ch = getchar();
		}
		while(ch >= 48 && ch <= 57){
			x = (x << 1) + (x << 3) + (ch ^ 48);
			ch = getchar();
		}
		return x * f;
	}
	int cnt;
	inline void ps(){
		fwrite(++k1,1,cnt,stdout);
		--k1;
		return;
	}
	inline void rt(int x){
		if(x <= 9) res[++cnt] = x ^ 48;
		else {
			rt(x / 10);
			res[++cnt] = (x % 10) ^ 48;
		}
		return;
	}
	inline void write(int x){
		if(x < 0){
			res[++cnt] = 45;
			write(-x);
			return;
		}
		rt(x);
		res[++cnt] = '\n';
		if(cnt >= 9999000){
			ps();
			cnt = 0;
		}
		return;
	}
}