警钟敲烂!!!
原理
-
inline:把函数用对应代码替换。 -
管他什么原理,让我
CSP-J2 T3 100->0就对了! -
一个
bool变量占用内存为1B=8bit!!!(CSP限制为512MB!!!)
个人专栏: 这里请
\def{\s}{2pt} \def{\t}{2pt} \mathclap{ \color{#ccc} \begin{array}{c:c|c:c|c:c|c:c|c:c|c:c|c:c|c:c|c:c|} \kern{\s} & \kern{\s} & \kern{\s} & \kern{\s} &\kern{\s} & \kern{\s} & \kern{\s} & \kern{\s} & \kern{\s} &\kern{\s} & \kern{\s} & \kern{\s} & \kern{\s} & \kern{\s} &\kern{\s} & \kern{\s} & \kern{\s} & \kern{\s} & \kern{\s} \cr[\t]\hdashline \cr[\t]\hline \cr[\t]\hdashline \cr[\t]\hline \cr[\t] \end{array} } \def{\b}{-3pt} \mathclap{ \begin{aligned} \Huge \textrm{Y\kern{\b}H\kern{\b}S\kern{\b} \kern{\b} } \textrm{ \kern{\b}\kern{\b} \kern{\b} \kern{\b} \kern{\b} \kern{\b} \kern{\b} \kern{\b} \kern{\b} \kern{\b}\kern{\b} } \cr[-17pt] \huge\underline{\kern{123.5pt}} \cr[-13.3pt] \huge\underline{\kern{123.5pt}} \cr[5pt] 蒟蒻蒟蒻 \Huge\textrm{{\large蒟蒻 }{\large }蒟蒻 } \end{aligned} } 大事祭
2021年8月14号:注册洛谷账号祭
2021年8月14号:第一次参加模拟赛祭(并且拿到了0分(第81名)的好成绩)
2021年10月30号:个人小团队成立祭
2021年11月16号:模拟赛首次进入前15祭
2022年1月1号:50入门题AC祭
2022年1月1号:50题AC祭
2022年1月21号:100题AC祭
2022年1月21号:期末年排第56祭
2022年1月21号:期末班排第2祭
2022年1月31号:绿名祭
2022年2月7号:提交第一篇题解祭(未过审,悲)
2022年2月7号:改名祭
2022年2月9号:100入门题AC祭
2022年4月16号:OI生涯首次AK模拟赛!!!
2022年7月1日:期末挂科祭(年:168,班:11)
2022年7月19号:史无前例的最优解榜一!(然而在8月被刷掉了。。。)
2022年8月27日:第一篇真正意义上的题解过审
2022年9月19日:橙名祭
2023年10月21日:初中OI生涯结束(Update 2024.10.21:是永久的AFO……)
2023年11月20日:绿勾子拿下
祭祀堂
佛祖保佑:
//\\ \\ \\ \\ \\ \\ \\ \\ || || || || || || // // // // // // // //
//\\ \\ \\ \\ \\ \\ \\ _ooOoo_ // // // // // // //
//\\ \\ \\ \\ \\ \\ o8888888o // // // // // //
//\\ \\ \\ \\ \\ 88" . "88 // // // // //
//\\ \\ \\ \\ (| -_- |) // // // //
//\\ \\ \\ O\ = /O // // //
//\\ \\ ____/`---'\____ // //
//\\ .' \\| |// `. //
//== / \\||| : |||// \ ==
//== / _||||| -:- |||||- \ ==
//== | | \\\ - /// | | ==
//== | \_| ''\---/'' | | ==
//== \ .-\__ `-` ___/-. / ==
//== ___`. .' /--.--\ `. . ___ ==
//== ."" '< `.___\_<|>_/___.' >'"". ==
//== | | : `- \`.;`\ _ /`;.`/ - ` : | | \\
//// \ \ `-. \_ __\ /__ _/ .-` / / \\
//// ========`-.____`-.___\_____/___.-`____.-'======== \\
//// `=---=' \\
//// // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \\ \\
//// // // 佛祖保佑 永无BUG 永不修改 \\ \\ \\
//// // // // // // || || || || || || || || || || \\ \\ \\ \\ \\ \\代码宝库
1.火车头:
#pragma GCC optimize(3)
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
//程序体2.万能の神:
#include<bits/stdc++.h>
using namespace std;
int main()
{
//代码
}3.优化cin/cout:
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
//大大加速cin/cout的效率!4.快速幂:
ll quick_pow(ll a,ll k)
{
ll res=1;
while(k)
{
if(k&1)
{
res=(ll)res*a%mod;
}
k>>=1;
a=(ll)a*a%mod;
}
return res;
}5.快读快写:
#include<bits/stdc++.h>
using namespace std;
namespace my_read
{
inline int int_read()
{
int x=0;bool flag=0;char c=getchar();
if(c=='-') flag=1,c=getchar();
while(c>'9'||c<'0') c=getchar();
while(c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
return flag?-x:x;
}
inline long long_read()
{
long x=0;bool flag=0;char c=getchar();
if(c=='-') flag=1,c=getchar();
while(c>'9'||c<'0') c=getchar();
while(c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
return flag?-x:x;
}
inline long long longlong_read()
{
long long x=0;bool flag=0;char c=getchar();
if(c=='-') flag=1,c=getchar();
while(c>'9'||c<'0') c=getchar();
while(c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
return flag?-x:x;
}
inline double double_read()
{
double s=0,w=1,f=0;int i=0;char ch=getchar();
if(ch=='-') w=-1,ch=getchar();
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
if(ch=='.')
{
ch=getchar();
while(ch>='0'&&ch<='9') f=f*10+ch-'0',i++,ch=getchar();
for(int j=0;j<i;j++) f/=10;s+=f;
}
return w*s;
}
inline double long doublelong_read()
{
double long s=0,w=1,f=0;long long i=0;char ch=getchar();
if(ch=='-') w=-1,ch=getchar();
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
if(ch=='.')
{
ch=getchar();
while(ch>='0'&&ch<='9') f=f*10+ch-'0',i++,ch=getchar();
for(long long j=0;j<i;j++) f/=10;s+=f;
}
return w*s;
}
}
using namespace my_read;
inline void print(int x)
{
if(x>=10)
{
print(x/10);
}
putchar(x%10+'0');
}6.手打双端队列:
const int MAXN=1e5+10;
struct deque
{
int que[MAXN*100]; int l,r;
deque _() { l=1,r=0; }
inline void push_back(int x) { que[++r]=x; }
inline void push_front(int x) { que[--l]=x; }
inline void pop_back() { r--; }
inline void pop_front() { l++;; }
inline int front() { return que[l]; }
inline int back() { return que[r]; }
inline int size() { return r-l+1; }
inline void clear() { l=MAXN*50,r=l-1; }
};7.超快的gcd():
inline int gcd(int a,int b)
{
if(b) while((a%=b) and (b%=a));
return a+b;
}8.保留n位小数输出:
cout<<fixed<<setprecision(n)<<(double)x;9.手打图:
struct edge
{
int y,z,nxt;
};
struct gragh
{
edge e[maxn];
int head[maxn],cnt=0;
gragh() {memset(head,-1,sizeof(head));}
inline void add(int x,int y,int z)
{
e[++cnt]=(edge){y,z,head[x]};
head[x]=cnt;
}
}a;10.最美数学公式——欧拉公式:
#include<bits/stdc++.h>
using namespace std;
int main()
{
complex<double> a(0,-1),b(1,0);
printf("%d",(exp(a*acos(-1))+b).real());
return 0;
}(完结撒花!)


