一些模板的应用

编程入门 行业动态 更新时间:2024-10-11 13:30:50

一些<a href=https://www.elefans.com/category/jswz/34/1770549.html style=模板的应用"/>

一些模板的应用

首先,是曾经的讲师LH大佬的模板

主要涉及了常用的文件头以及一些常用语句和函数的缩写

#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<time.h>
#include<queue>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pr;
const double pi=acos(-1);
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define Rep(i,u) for(int i=head[u];i;i=Next[i])
#define clr(a) memset(a,0,sizeof a)
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
ld eps=1e-9;
ll pp=1000000007;
ll mo(ll a,ll pp){if(a>=0 && a<pp)return a;a%=pp;if(a<0)a+=pp;return a;}
ll powmod(ll a,ll b,ll pp){ll ans=1;for(;b;b>>=1,a=mo(a*a,pp))if(b&1)ans=mo(ans*a,pp);return ans;}
ll read(){ll ans=0;char last=' ',ch=getchar();while(ch<'0' || ch>'9')last=ch,ch=getchar();while(ch>='0' && ch<='9')ans=ans*10+ch-'0',ch=getchar();if(last=='-')ans=-ans;return ans;
}
//head

还有就是gh大佬的快读模板

虽然我不会短时间敲出来出来就是了QWQ

#include <cctype>
#include <cstdio>template<typename T_>
inline T_ getnum()
{T_ res=0;bool flag=false;char ch=getchar();while (!isdigit(ch)){flag=flag?flag:ch=='-';ch=getchar();}while (isdigit(ch)){res=(res<<3)+(res<<1)+ch-'0';ch=getchar();}return res;
}

 

转载于:.html

更多推荐

一些模板的应用

本文发布于:2024-03-06 00:11:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1713839.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模板

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!