跳到正文

个人记录

缺省源

RealDream约 7 分钟
原文
文章信息与版本

文章信息

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

版本

  1. v5当前
  2. v4
  3. v3
  4. v2
更早的 1 个版本
  1. v1
C++
#include <bits/stdc++.h>
#define gc() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin), p1 == p2) ? EOF : *p1++)
#define pc(x) (p3 - obuf < MAXSIZE ? *p3++ = x : (fwrite(obuf, 1, MAXSIZE, stdout), p3 = obuf, *p3++ = x))
#define endl '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

namespace FastIO {
	const int MAXSIZE = 1 << 20;
	char buf[MAXSIZE], *p1, *p2;
	char obuf[MAXSIZE], *p3 = obuf;

	inline int read() {
		int x = 0, f = 1;
		char ch = gc();
		while (ch < '0' || ch > '9') {
			if (ch == '-') f = -1;
			ch = gc();
		}
		while (ch >= '0' && ch <= '9') {
			x = x * 10 + ch - '0';
			ch = gc();
		}
		return x * f;
	}

	inline ll read_ll() {
		ll x = 0, f = 1;
		char ch = gc();
		while (ch < '0' || ch > '9') {
			if (ch == '-') f = -1;
			ch = gc();
		}
		while (ch >= '0' && ch <= '9') {
			x = x * 10 + ch - '0';
			ch = gc();
		}
		return x * f;
	}

	inline ull read_ull() {
		ull x = 0, f = 1;
		char ch = gc();
		while (ch < '0' || ch > '9') {
			if (ch == '-') f = -1;
			ch = gc();
		}
		while (ch >= '0' && ch <= '9') {
			x = x * 10 + ch - '0';
			ch = gc();
		}
		return x * f;
	}

	inline string read_string() {
		static char str[1000010];
		int len = 0;
		char ch = gc();
		while (ch == ' ' || ch == '\n' || ch == '	' || ch == '\r') {
			ch = gc();
		}
		while (ch != ' ' && ch != '\n' && ch != '	' && ch != '\r' && ch != EOF) {
			str[len++] = ch;
			ch = gc();
		}
		return string(str, len);
	}

	inline void write(int x) {
		static char tmp[20];
		if (x < 0) {
			pc('-');
			x = -x;
		}
		int len = 0;
		do {
			tmp[len++] = x % 10 + '0';
			x /= 10;
		} while (x);
		while (len--) pc(tmp[len]);
	}

	inline void write(const string &s) {
		for (char c : s) pc(c);
	}

	inline void write(char c) {
		pc(c);
	}

	inline void flush() {
		fwrite(obuf, 1, p3 - obuf, stdout);
		p3 = obuf;
	}

	class Reader {
	public:
		template<typename T>
		Reader& operator >> (T &x) {
			x = 0;
			T f = 1;
			char ch = gc();
			while (ch < '0' || ch > '9') {
				if (ch == '-') f = -1;
				ch = gc();
			}
			while (ch >= '0' && ch <= '9') {
				x = x * 10 + ch - '0';
				ch = gc();
			}
			x *= f;
			return *this;
		}

		Reader& operator >> (string &s) {
			static char str[1000010];
			int len = 0;
			char ch = gc();
			while (ch == ' ' || ch == '\n' || ch == '	' || ch == '\r') {
				ch = gc();
			}
			while (ch != ' ' && ch != '\n' && ch != '	' && ch != '\r' && ch != EOF) {
				str[len++] = ch;
				ch = gc();
			}
			s.assign(str, len);
			return *this;
		}

		Reader& operator >> (char &c) {
			c = gc();
			while (c == ' ' || c == '\n' || c == '	' || c == '\r') {
				c = gc();
			}
			return *this;
		}
	};

	class Writer {
	public:
		// 整数输出
		template<typename T>
		Writer& operator << (T x) {
			static char tmp[20];
			if (x < 0) {
				pc('-');
				x = -x;
			}
			if (x == 0) {
				pc('0');
				return *this;
			}
			int len = 0;
			while (x) {
				tmp[len++] = x % 10 + '0';
				x /= 10;
			}
			while (len--) pc(tmp[len]);
			return *this;
		}

		Writer& operator << (const string &s) {
			for (char c : s) pc(c);
			return *this;
		}

		Writer& operator << (const char *s) {
			while (*s) pc(*s++);
			return *this;
		}

		Writer& operator << (char c) {
			pc(c);
			return *this;
		}

		~Writer() {
			flush();
		}
	};

	Reader fin;
	Writer fout;
};

namespace RealDream {
	using namespace FastIO;

	int solve() {
		/**
		 * RealDream AK IOI
		 */

		return 0;
	}
};

int main() {
	/**
	 * Made By RealDream
	 */
	int rp = -1;
	while (rp++) {
		RealDream::solve();
	}
	return 0;
}
原文