跳到正文

休闲·娱乐

模板

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

文章信息

发布
2025年6月9日
收录
2025年12月12日
更新
2026年11月9日
篇幅
约 2 分钟

版本

  1. v1当前
C++
#include <bits/stdc++.h>

namespace yxc {
	#ifdef __linux__
		#define gc getchar_unlocked
		#define put putchar_unlocked
	#else
		#define gc _getchar_nolock
		#define put _putchar_nolock
	#endif
	template <typename T>
	inline T read() {
		T x = 0;
		bool f = 0;
		char ch = gc();
		while (ch > '9' || ch < '0') {
			if (ch == '-') f = 1;
			ch = gc();
		}
		do {
			x = (x << 3) + (x << 1) + (ch ^ 48);
			ch = gc();
		} while (ch >= '0' && ch <= '9');
		return f ? -x : x;
	}
	template <typename T>
	inline void write(T x) {
		if (x < 0) x = -x, put('-');
		static T sta[35];
		T top = 0;
		do {
			sta[top++] = x % 10, x /= 10;
		} while (x);
		while (top) put(sta[--top] + '0');
	}
}
using namespace yxc;
using namespace std;

using ll = long long;
using ull = unsigned long long;
using i128 = __int128;
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define frep(i, b, a) for (int i = b; i >= a; i--)
#define s second
#define f first
const int inf = (1 << 30) - 1;
const ll INF = 1LL << 60LL;
const int mod = 998244353;
原文