跳到正文

剪贴板

剪贴板 pqh6byrx

原文
剪贴板信息

剪贴板信息

收录
更新

Sublime setting (accoders)

Sublime setting (cnblogs)

JSON
{
	"theme": "Default Dark.sublime-theme",
	"font_size": 14,
	"color_scheme": "Packages/Color Scheme - Default/Mariana.sublime-color-scheme",
	"save_on_focus_lost": true,
	"caret_style": "smooth",
	"font_face": "JetBrains Mono",
	"save_on_focus_lost": true,
	"word_wrap": true,
}

JetBrains Mono (luogu)

JetBrains Mono (cnblogs)

Sublime snippets

HTML
<snippet>
	<content><![CDATA[#include <bits/stdc++.h>
#define _for(i, a, b) for (int i = a; i <= b; ++i)
#define for_(i, a, b) for (int i = a; i >= b; --i)
#define far(i, vec) for (auto i : vec)
#define bdmd int mid = (l + r) >> 1
typedef long double ldb;
typedef long long ll;
typedef double db;
typedef std::pair <int, int> pii;
typedef std::pair <ll, ll> pll;
const int N = 1e5 + 10, P = 998244353;
namespace IO {
	int rnt () {
		int x = 0, w = 1; char c = getchar ();
		while (!isdigit (c)) { if (c == '-') w = -1; c = getchar (); }
		while (isdigit (c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar ();
		return x * w;
	}
}
namespace SOLVE {
	using namespace IO;
	int n, a[N], ans;
	void In () {
		n = rnt ();
		_for (i, 1, n) a[i] = rnt ();
		return;
	}
	void Solve () {

		return;
	}
	void Out () {
		printf ("%d\n", ans);
		return;
	}
}
int main () {
#ifndef ONLINE_JUDGE
	freopen ("data.in", "r", stdin);
	// freopen ("data.out", "w", stdout);
#endif
	SOLVE::In ();
	SOLVE::Solve ();
	SOLVE::Out ();
	return 0;
} /*

*/]]></content>
	<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
	<tabTrigger>base</tabTrigger>
	<!-- Optional: Set a scope to limit where the snippet will trigger -->
	<scope>source.c++</scope>
</snippet>

缺省源

C++
#include <bits/stdc++.h>
#define _for(i, a, b) for (int i = a; i <= b; ++i)
#define for_(i, a, b) for (int i = a; i >= b; --i)
#define far(i, vec) for (auto i : vec)
#define bdmd int mid = (l + r) >> 1
typedef long double ldb;
typedef long long ll;
typedef double db;
typedef std::pair <int, int> pii;
typedef std::pair <ll, ll> pll;
const int N = 1e5 + 10, P = 998244353;
namespace IO {
	int rnt () {
		int x = 0, w = 1; char c = getchar ();
		while (!isdigit (c)) { if (c == '-') w = -1; c = getchar (); }
		while (isdigit (c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar ();
		return x * w;
	}
}
namespace SOLVE {
	using namespace IO;
	int n, a[N], ans;
	void In () {
		n = rnt ();
		_for (i, 1, n) a[i] = rnt ();
		return;
	}
	void Solve () {

		return;
	}
	void Out () {
		printf ("%d\n", ans);
		return;
	}
}
int main () {
#ifndef ONLINE_JUDGE
	freopen ("data.in", "r", stdin);
	// freopen ("data.out", "w", stdout);
#endif
	SOLVE::In ();
	SOLVE::Solve ();
	SOLVE::Out ();
	return 0;
} /*

*/
C++
namespace Extentions {
// #define USE_UNSIGNED_TYPE
#ifdef USE_UNSIGNED_TYPE
	using u32 = std::uint32_t;
	using u64 = std::uint64_t;
#endif
// #define USE_CHECKMAX_ANS_MIN
#ifdef USE_CHECKMAX_ANS_MIN
	template <typename T> T& chkmax (T& a, T b) { if (a < b) a = b; return a; }
	template <typename T> T& chkmin (T& a, T b) { if (a > b) a = b; return a; }
#endif
// #define USE_RAND
#ifdef USE_RAND
	std::mt19937 rnd (std::chrono::system_clock::now ().time_since_epoch ().count ());
#endif
// #define USE_MOD_FUNCTION
#ifdef USE_MOD_FUNCTION
	template <typename T1, typename T2> T1 add (T1 a, T2 b) { return (a += b) >= P ? a - P : a; } template <typename T1, typename T2> void addi (T1& a, T2 b) { (a += b) >= P ? a -= P : a; return; } template <typename T1, typename...Args> T1 add (T1 a, Args...b) { return add (a, add (b...)); } template <typename T1, typename...Args> void addi (T1& a, Args...b) { addi (a, add (b...)); return; }
	template <typename T1, typename T2> T1 sub (T1 a, T2 b) { return (a -= b) < 0 ? a + P : a; } template <typename T1, typename T2> void subi (T1& a, T2 b) { (a -= b) < 0 ? a += P : a; return; } template <typename T1, typename...Args> T1 sub (T1 a, Args...b) { return sub (a, add (b...)); } template <typename T1, typename...Args> void subi (T1& a, Args...b) { subi (a, add (b...)); return; }
	template <typename T1, typename T2> T1 mul (T1 a, T2 b) { return (1ll * a * b) % P; } template <typename T1, typename T2> void muli (T1& a, T2 b) { a = mul (a, b); return; } template <typename T1, typename...Args> T1 mul (T1 a, Args...b) { return mul (a, mul (b...)); } template <typename T1, typename...Args> void muli (T1& a, Args...b) { muli (a, mul (b...)); return; }
#endif
// #define USE_FPOW
#ifdef USE_FPOW
	template <typename T1, typename T2> T1 fpow (T1 a, T2 b, T1 ans = 1) { for (b < 0 ? b += P - 1 : 0; b; a = a * a % P, b >>= 1) if (b & 1) ans = 1ll * ans * a % P; return ans; }
#endif
} // namespace Extentions
using namespace Extentions;

快读快输

C++
namespace IO {
	constexpr int SIZE = (1 << 19);
	char in[SIZE], out[SIZE], * p1 = in, * p2 = in, * p3 = out;
#define gc() (p1 == p2 && (p2 = (p1 = in) + fread (in, 1, SIZE, stdin), p1 == p2) ? EOF : *p1++)
	inline int rnt () {
		int x = 0, w = 1; char c = gc ();
		while (!isdigit (c)) c = gc ();
		while (isdigit (c)) x = (x << 3) + (x << 1) + (c ^ 48), c = gc ();
		return x * w;
	}
	char pbuf[SIZE], * pp = pbuf;
	inline void push (const char& c) {
		if (pp - pbuf == 1 << 20) fwrite (pbuf, 1, 1 << 20, stdout), pp = pbuf;
		*pp++ = c;
	}
	inline void write (int x) {
		static int sta[35];
		int top = 0;
		do { sta[top++] = x % 10, x /= 10; } while (x);
		while (top) push (sta[--top] + '0');
		return;
	}
}  // namespace IO

vscode setting

setting

JSON
{
    "workbench.iconTheme": "material-icon-theme",
    "files.autoSave": "afterDelay",
    "editor.cursorBlinking": "smooth",
    "editor.cursorSmoothCaretAnimation": "on",
    "editor.fontFamily": "'JetBrains Mono', Consolas, 'Courier New', monospace",
    "editor.fontLigatures": true,
    "files.autoSaveDelay": 100,
    "files.defaultLanguage": "cpp",
    "workbench.list.smoothScrolling": true,
    "editor.smoothScrolling": true,
    "editor.mouseWheelZoom": true,
    "editor.multiCursorModifier": "ctrlCmd",
    "editor.insertSpaces": false,
    "workbench.colorTheme": "SynthWave '84",
    "code-runner.runInTerminal": true,
    "code-runner.saveAllFilesBeforeRun": true,
    "code-runner.saveFileBeforeRun": true,
    "code-runner.executorMap": {
        "cpp": "cd $dir && g++ $fileName -std=c++17 -O2 -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
    },
    "cnblogsClient.linux.workspace": "/home/hzoi/K8He/Blog",
    "C_Cpp.formatting": "vcFormat",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "sameLine",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.function": "sameLine",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.lambda": "sameLine",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.namespace": "sameLine",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.type": "sameLine",
    "C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyFunction": true,
    "C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyType": true,
    "C_Cpp.vcFormat.space.beforeFunctionOpenParenthesis": "insert",
    "C_Cpp.vcFormat.space.beforeLambdaOpenParenthesis": true,
    "editor.formatOnType": true,
}

beybindings

JSON
// Place your key bindings in this file to override the defaultsauto[]
[
    {
        "key": "ctrl+f11",
        "command": "workbench.action.toggleFullScreen",
        "when": "!isIOS"
    },
    {
        "key": "f11",
        "command": "-workbench.action.toggleFullScreen",
        "when": "!isIOS"
    },
    {
        "key": "f11",
        "command": "code-runner.run"
    },
    {
        "key": "ctrl+alt+n",
        "command": "-code-runner.run"
    }
]

user snippets

JSON
{
	// Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and
	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
	// same ids are connected.
	// Example:
	// "Print to console": {
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// }
	"base": {
		"prefix": "base",
		"isFileTemplate": true,
		"body": [
			"#include <bits/stdc++.h>",
			"#define _for(i, a, b) for (int i = a; i <= b; ++i)",
			"#define for_(i, a, b) for (int i = a; i >= b; --i)",
			"#define far(i, vec) for (auto i : vec)",
			"#define bdmd int mid = (l + r) >> 1",
			"typedef long double ldb;",
			"typedef long long ll;",
			"typedef double db;",
			"typedef std::pair <int, int> pii;",
			"typedef std::pair <ll, ll> pll;",
			"namespace IO {",
			"\tint rnt () {",
			"\t\tint x = 0, w = 1; char c = getchar ();",
			"\t\twhile (!isdigit (c)) { if (c == '-') w = -1; c = getchar (); }",
			"\t\twhile (isdigit (c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar ();",
			"\t\treturn x * w;",
			"\t}",
			"} // namespace IO",
			"const int N = 1e5 + 10, P = 998244353;",
			"namespace SOLVE {",
			"\tusing namespace IO;",
			"\tint n, a[N], ans;",
			"\tvoid In () {",
			"\t\tn = rnt ();",
			"\t\t_for (i, 1, n) a[i] = rnt ();",
			"\t\treturn;",
			"\t}",
			"\tvoid Solve () {",
			"\t\t",
			"\t\treturn;",
			"\t}",
			"\tvoid Out () {",
			"\t\tprintf (\"%d\\n\", ans);",
			"\t\treturn;",
			"\t}",
			"}",
			"int main () {",
			"#ifndef ONLINE_JUDGE",
			"\tfreopen (\"data.in\", \"r\", stdin);",
			"\t// freopen (\"data.out\", \"w\", stdout);",
			"#endif",
			"\tSOLVE::In ();",
			"\tSOLVE::Solve ();",
			"\tSOLVE::Out ();",
			"\treturn 0;",
			"} /*",
			"",
			"*/",
		]
	},
	"test_base": {
		"prefix": "test_base",
		"isFileTemplate": true,
		"body": [
			"#include <bits/stdc++.h>",
			"#define _for(i, a, b) for (int i = a; i <= b; ++i)",
			"#define for_(i, a, b) for (int i = a; i >= b; --i)",
			"#define far(i, vec) for (auto i : vec)",
			"#define bdmd int mid = (l + r) >> 1",
			"typedef long double ldb;",
			"typedef long long ll;",
			"typedef double db;",
			"typedef std::pair <int, int> pii;",
			"typedef std::pair <ll, ll> pll;",
			"namespace IO {",
			"\tint rnt () {",
			"\t\tint x = 0, w = 1; char c = getchar ();",
			"\t\twhile (!isdigit (c)) { if (c == '-') w = -1; c = getchar (); }",
			"\t\twhile (isdigit (c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar ();",
			"\t\treturn x * w;",
			"\t}",
			"} // namespace IO",
			"const int N = 1e5 + 10, P = 998244353;",
			"namespace SOLVE {",
			"\tusing namespace IO;",
			"\tint n, a[N], ans;",
			"\tvoid In () {",
			"\t\tn = rnt ();",
			"\t\t_for (i, 1, n) a[i] = rnt ();",
			"\t\treturn;",
			"\t}",
			"\tvoid Solve () {",
			"\t\t",
			"\t\treturn;",
			"\t}",
			"\tvoid Out () {",
			"\t\tprintf (\"%d\\n\", ans);",
			"\t\treturn;",
			"\t}",
			"}",
			"int main () {",
			"#ifndef ONLINE_JUDGE",
			"\tfreopen (\"$TM_FILENAME_BASE.in\", \"r\", stdin);",
			"\t// freopen (\"$TM_FILENAME_BASE.out\", \"w\", stdout);",
			"#else",
			"\tfreopen (\"$TM_FILENAME_BASE.in\", \"r\", stdin);",
			"\tfreopen (\"$TM_FILENAME_BASE.out\", \"w\", stdout);",
			"#endif",
			"\tSOLVE::In ();",
			"\tSOLVE::Solve ();",
			"\tSOLVE::Out ();",
			"\treturn 0;",
			"} /*",
			"",
			"*/",
		]
	},
	"POLY":{
		"prefix": "POLY",
		"body": [
			"namespace POLY {",
			"\tconst int P=998244353,g=3,invg=332748118;int rev[N],omega[2][N];",
			"\tusing u32 = std::uint32_t;using u64 = std::uint64_t;",
			"\tstd::mt19937 rnd (std::chrono::system_clock::now ().time_since_epoch ().count ());",
			"\ttemplate<typename T1,typename T2>T1 add(T1 a,T2 b){return(a+=b)>=POLY::P?a-POLY::P:a;}template<typename T1,typename T2>void addi(T1&a,T2 b){(a+=b)>=POLY::P?a-=POLY::P:a;return;}template<typename T1,typename...Args>T1 add(T1 a,Args...b){return add(a,add(b...));}template<typename T1,typename...Args>void addi(T1&a,Args...b){addi(a,add(b...));return;}",
			"\ttemplate<typename T1,typename T2>T1 sub(T1 a,T2 b){return(a-=b)<0?a+POLY::P:a;}template<typename T1,typename T2>void subi(T1&a,T2 b){(a-=b)<0?a+=POLY::P:a;return;}template<typename T1,typename...Args>T1 sub(T1 a,Args...b){return sub(a,add(b...));}template<typename T1,typename...Args>void subi(T1&a,Args...b){subi(a,add(b...));return;}",
			"\ttemplate<typename T1,typename T2>T1 mul(T1 a,T2 b){return(1ll*a*b)%POLY::P;}template<typename T1,typename T2>void muli(T1&a,T2 b){a=mul(a,b);return;}template<typename T1,typename...Args>T1 mul(T1 a,Args...b){return mul(a,mul(b...));}template<typename T1,typename...Args>void muli(T1&a,Args...b){muli(a,mul(b...));return;}",
			"\ttemplate<typename T1,typename T2>T1 FastPow(T1 a,T2 b){T1 ans=1;while(b){if(b&1)muli(ans,a);muli(a,a),b>>=1;}return ans;}template<typename T>T Inv(T a){return FastPow(a,POLY::P-2);}",
			"\tint PreWork(const int &n){int lim=1,l=0;while(lim<=n)lim<<=1,++l;_for(i,0,lim)rev[i]=(rev[i>>1]>>1)|((i&1)<<(l-1));omega[0][0]=omega[1][0]=1;omega[0][1]=FastPow(g,(POLY::P-1)/lim);omega[1][1]=FastPow(invg,(POLY::P-1)/lim);_for(i,2,lim)omega[0][i]=mul(omega[0][i-1],omega[0][1]),omega[1][i]=mul(omega[1][i-1],omega[1][1]);return lim;}",
			"\tnamespace Cipolla{int _i_;class Complex{public:int real,imag;Complex()=default;Complex(int _real,int _imag):real(_real),imag(_imag){}void operator*=(Complex b){int tmp1=add(mul(real,b.real),mul(imag,b.imag,_i_));int tmp2=add(mul(real,b.imag),mul(imag,b.real));real=tmp1,imag=tmp2;return;}};int FastPow(Complex a,int b){Complex ans(1,0);while(b){if(b&1)ans*=a;a*=a,b>>=1;}return ans.real;}int Cipolla(int n){if (!n)return 0;if (POLY::FastPow(n,(POLY::P-1)>>1)==POLY::P-1)return -1;int a;while(a){a=rnd()%POLY::P,_i_=sub(mul(a,a),n);if(POLY::FastPow(_i_,(POLY::P-1)>>1)==POLY::P-1)break;}return FastPow(Complex(a,1),(POLY::P+1)>>1);}};",
			"\ttemplate<typename T = int>class Poly {",
			"\tprivate:std::vector<T>A;",
			"\tpublic:",
			"\t\tPoly()=default;Poly(int len){A.resize(len);return;}Poly(std::vector<T>_A):A(_A){}Poly(T* bg,T* ed){A.assign(bg,ed);return;}Poly(T* bg,int len){A.assign(bg,bg+len);return;}",
			"\t\tT& operator[](const int& x){return A[x];}T operator[](const int& x)const{return A[x];}",
			"\t\tint deg()const{return A.size()-1;}int len()const{return A.size();}void Resize(int len){A.resize(len);return;}",
			"\t\tT* begin(){return A.begin();}T* end(){return A.end();}",
			"\t\tvoid Cover(T* bg,T* ed){A.assign(bg,ed);return;}void Cover(T* bg,int len){A.assign(bg,bg+len);return;}",
			"\t\tvoid NTT(int lim,bool type){Resize(lim);_for(i,0,lim-1)if(i<rev[i])std::swap(A[i],A[rev[i]]);for(int mid=1,t=lim>>1;mid<lim;mid<<=1,t>>=1){for(int R=mid<<1,j=0;j<lim;j+=R){_for(k,0,mid-1){T x=A[j+k],y=mul(omega[type][t*k],A[j+mid+k]);A[j+k]=add(x,y),A[j+mid+k]=sub(x,y);}}}if(type==1){T inv_lim=FastPow(lim,POLY::P-2);_for(i,0,lim-1)A[i]=mul(A[i],inv_lim);}return;}",
			"\t\tfriend Poly operator+(Poly F,Poly G){F.Resize(std::max(F.len(),G.len()));_for(i,0,G.deg())addi(F[i],G[i]);return F;}Poly operator+=(Poly G){Resize(std::max(len(),G.len()));_for(i,0,G.deg())addi(A[i],G[i]);return(*this);}",
			"\t\tfriend Poly operator+(Poly F,T x){addi(F[0],x);return F;}friend Poly operator+(T x,Poly F){addi(F[0],x);return F;}Poly operator+=(T x){addi(A[0],x);return(*this);}",
			"\t\tfriend Poly operator-(Poly F,Poly G){F.Resize(std::max(F.len(),G.len()));_for(i,0,G.deg())subi(F[i],G[i]);return F;}Poly operator-=(Poly G){Resize(std::max(len(),G.len()));_for(i,0,G.deg())subi(A[i],G[i]);return(*this);}",
			"\t\tfriend Poly operator-(Poly F,T x){subi(F[0],x);return F;}friend Poly operator-(T x,Poly F){subi(F[0],x);return F;}Poly operator-=(T x){subi(A[0],x);return(*this);}",
			"\t\tfriend Poly operator*(Poly F,Poly G){int lim=PreWork(F.deg()+G.deg());F.NTT(lim,0),G.NTT(lim,0);_for(i,0,lim-1)muli(F[i],G[i]);F.NTT(lim,1);return F;}Poly operator*=(Poly G){int lim=PreWork(deg()+G.deg());NTT(lim,0),G.NTT(lim,0);_for(i,0,lim-1)muli(A[i],G[i]);NTT(lim,1);return(*this);}",
			"\t\tfriend Poly operator*(Poly F,T x){_for(i,0,F.deg())muli(F[i],x);return F;}friend Poly operator*(T x,Poly F){_for(i,0,F.deg())muli(F[i],x);return F;}Poly operator*=(T x){_for(i,0,deg())muli(A[i],x);return(*this);}",
			"\t\tfriend Poly operator/(Poly F,T x){x=POLY::Inv(x);return F*x;}friend Poly operator/(T x,Poly F){x=POLY::Inv(x);return F*x;}Poly operator/=(T x){x=POLY::Inv(x);(*this)*=x;return(*this);}",
			"\t\tPoly Inv(){Poly G(1);if(A.empty())return G;G[0]=POLY::Inv(A[0]);Poly t[2];for(int l=2;l<(len()<<1);l<<=1){t[0].Cover(A.begin(),std::min(l,len()));t[1]=G,t[1].Resize(std::min(l,len()));int lim=PreWork(t[0].deg()+t[1].deg()+1);t[0].NTT(lim,0),t[1].NTT(lim,0),G.Resize(lim);_for(i,0,lim-1)G[i]=mul(sub(2,mul(t[0][i],t[1][i])),t[1][i]);G.NTT(lim,1),G.Resize(l);}G.Resize(len());return G;}",
			"\t\tPoly Sqrt(){Poly G(1);G[0]=Cipolla::Cipolla(A[0]),G[0]=std::min(G[0],POLY::P-G[0]);T inv2=POLY::Inv(2);Poly t[2];for(int l=2;l<(len()<<1);l<<=1){t[1].Cover(A.begin(),std::min(l,len()));G.Resize(l),t[0]=G.Inv()*t[1];_for(i,0,l-1)G[i]=mul(t[0][i]+G[i],inv2);}G.Resize(len());return G;}",
			"\t\tPoly Differential(){Poly G(len()-1);_for(i,0,deg()-1)G[i]=mul(A[i+1],i+1);return G;}void iDifferential(){_for(i,0,deg()-1)A[i]=mul(A[i+1],i+1);A.resize(len()-1);return;}",
			"\t\tPoly Integral(){Poly G(len());for_(i,deg(),1)G[i]=mul(A[i-1],POLY::Inv(i));return G;}void iIntegral(){A.resize(len());for_(i,deg(),1)A[i]=mul(A[i-1],POLY::Inv(i));A[0]=0;return;}",
			"\t\tPoly Ln(){Poly G=(Differential()*Inv()).Integral();G.Resize(len());return G;}",
			"\t\tPoly Exp(){Poly G(1),H;G[0]=1;T inv2=POLY::Inv(2);for(int l=2;l<(len()<<1);l<<=1)G.Resize(l),H.Cover(A.begin(),std::min(l,len())),H-=G.Ln(),++H[0],G*=H;G.Resize(len());return G;}",
			"\t\tPoly Power(int k){return(Ln()*k).Exp();}",
			"\t};",
			"} using poly = POLY::Poly<int>;",
		]
	},
	"_for":{
		"prefix": "_for",
		"body": "_for (${1:i}, ${2:1}, ${3:n}) $0"
	},
	"namesp":{
		"prefix": "namesp",
		"body": [
			"namespace ${1:name} {",
			"\t",
			"} // ${1:name}",
		],
		"description": "Fuck",
	}
}