比赛时自己用的,方便
#include<bits/stdc++.h>
#define mem(x) memset(x,0,sizeof(x))
using namespace std;
typedef long long ll;
const ll maxn=1e5+10;
const ll mod=1e9+7;
const ll inf=0x7f7f7f7f;
template<typename T>void read(T &x)
{
x = 0;char ch = getchar();ll f = 1;
while(!isdigit(ch)){if(ch == '-')f*=-1;ch=getchar();}
while(isdigit(ch)){x = x*10+ch-48;ch=getchar();}x*=f;
}
template<typename T>void write(T x)
{
if(x<0)
{
putchar('-');
x=-x;
}
if(x>9)
{
write(x/10);
}
putchar(x%10+'0');
}
ll T;
bool flag;
int main()
{
read(T);
while(T--)
{
}
return 0;
}
本文提供了一个比赛时使用的代码模板,包含快速输入输出、内存初始化、常用数据类型定义及宏定义等,适用于C++编程竞赛,提高了编码效率和代码可读性。
9106

被折叠的 条评论
为什么被折叠?



