跳到正文

剪贴板

剪贴板 5l9g63mp

原文
剪贴板信息

剪贴板信息

收录
更新

旧缺省源(2023/?/? ~ 2024/2/23)

什么 ** 代码,除了难看就是难看。
关键是还有个不要脸的 @xz001 在用。

C++
#include <bits/stdc++.h>

using namespace std;

// define
#define re register
#define fi first
#define se second
#define il inline
#define co const
#define ls (u << 1)
#define rs (u << 1 | 1)
#define fup(x, l, r) for (re int x = (l), eNd = (r); x <= eNd; ++ x )
#define fdw(x, r, l) for (re int x = (r), eNd = (l); x >= eNd; -- x )
//#define int long long

// typedef
typedef pair<int, int> PII;
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

// const
const int N = 1e6 + 10, M = 2e6 + 10;
const int INF = 2e9, P = 998244353;
const double eps = 1e-6;

// debug
const bool DeBug = true;
int db_cnt;
il void db() { if (DeBug) puts("--------------"); return; }
il void db(auto a) { if (DeBug) ++ db_cnt, cout << "-- | t" << db_cnt << " : " << a << '\n'; return; }
il void db(auto a, auto b) { if (DeBug) ++ db_cnt, cout << "-- | t" << db_cnt << " : " << a << ", " << b << '\n'; return; }
il void db(auto a, auto b, auto c) { if (DeBug) ++ db_cnt, cout << "-- | t" << db_cnt << " : " << a << ", " << b << ", " << c << '\n'; return; }
il void db(auto a, auto b, auto c, auto d) { if (DeBug) ++ db_cnt, cout << "-- | t" << db_cnt << " : " << a << ", " << b << ", " << c << ", " << d << '\n'; return; }
il void db(auto a, auto b, auto c, auto d, auto e) { if (DeBug) ++ db_cnt, cout << "-- | t" << db_cnt << " : " << a << ", " << b << ", " << c << ", " << d << ", " << e << '\n'; return; }
il void db(auto *a, auto *b) { if (DeBug) { ++ db_cnt; cout << "-- | t" << db_cnt << " : {"; if (a >= b) cout << "empty"; else { cout << (*a); for (auto *i = a + 1; i < b; ++ i ) cout << ", " << *i; } cout << "}\n"; } return; }

// common functions
il int Max(co auto a, co auto b) { return a > b ? a : b; }
il int Min(co auto a, co auto b) { return a < b ? a : b; }
il LL read() { re LL x = 0; re bool f = true; re char c = getchar(); while (c < 48 || c > 57) { (c == '-') ? f = false : 0; c = getchar(); } while (c > 47 && c < 58) x = (x << 3) + (x << 1) + c - 48, c = getchar(); return f ? x : -x; }
il void read(auto *a, auto *b) { for (auto *i = a; i < b; ++ i ) *i = read(); return; }
il void write(re auto x) { (x < 0) ? putchar('-'), x = -x : 0; (x > 9) ? write(x / 10) : void(); putchar(x % 10 + 48); return; }
il void wel(co auto x) { write(x), putchar('\n'); return; }
il void wel(co auto x, co auto y) { write(x), putchar(' '), write(y), putchar('\n'); return; }
il void wel(co auto x, co auto y, co auto z) { write(x), putchar(' '), write(y), putchar(' '), write(z), putchar('\n'); return; }
il void wsp(co auto x) { write(x), putchar(' '); return; }
il void wel(auto *a, auto *b) { for (auto *i = a; i < b; ++ i ) wsp(*i); puts(""); return; }
il void wel(vector<auto> v) { for (auto i : v) wsp(i); puts(""); return; }



signed main()
{

	return 0;
}

新缺省源(2024/2/23 ~ )

新快读快写 fin/fout 代替了原来的 read()/write()。
删去了一些当时脑子抽了才写的 fup/fdw/db()/re/il/co 等,大大增加了代码的可读性。
整洁,大方,美观。

upd on 2024/4/3:增加了 fin 浮点数。
upd on 2024/6/11:删掉了 fin 浮点数。

C++
#include <bits/stdc++.h>

using namespace std;

#define int long long
typedef long long ll;
typedef unsigned long long LL;
typedef pair<int, int> PII;

struct FASTREAD {
	template <typename T>
	FASTREAD& operator >>(T& x) {
		x = 0; bool flg = false; char c = getchar();
		while (c < '0' || c > '9') flg |= (c == '-'), c = getchar();
		while (c >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0', c = getchar();
		if (flg) x = -x; return *this;
	}
	template <typename T>
	FASTREAD& operator >>(vector<T>& x) {
		for (auto it = x.begin(); it != x.end(); ++ it ) (*this) >> *it;
		return *this;
	}
}fin;

struct FASTWRITE {
	template <typename T>
	FASTWRITE& operator <<(T x) {
		if (x < 0) x = -x, putchar('-');
		static int buf[35]; int top = 0;
		do buf[top ++ ] = x % 10, x /= 10; while (x);
		while (top) putchar(buf[ -- top] + '0');
		return *this;
	}
	FASTWRITE& operator <<(char x) {
		putchar(x); return *this;
	}
	template <typename T>
	FASTWRITE& operator <<(vector<T> x) {
		for (auto it = x.begin(); it != x.end(); ++ it ) (*this) << *it, putchar(' ');
		putchar('\n');
		return *this;
	}
}fout;

const int N = 1e6 + 10, M = 2e6 + 10;
const int P = 998244353;

void Luogu_UID_748509() {

}

signed main() {
	int Testcases = 1;
//	fin >> Testcases;
	while (Testcases -- ) Luogu_UID_748509();
	return 0;
}