卡常模板

卡常模板,必背

#pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include<iostream>
#include<cstdio>
#include<ctime>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#define Ri register int  
#define sswap(x,y) x^=y^=x^=y;
template <class T> T mmin(T x,T y){return(x)<(y)?(x):(y);}
template <class T> T mmax(T x,T y){return(x)<(y)?(y):(x);}
template <class T> T lowbit(T x){return ((x)&(-(x)));}
typedef long long ll;
using namespace std;
namespace io{
    const int MT=5e7;
    char buf[MT];ll c,sz;
    void begin(){c=0;sz=fread(buf,1,MT,stdin);}
    template<class T>
    inline bool read(T &t) 
    {
        while(c<sz&&buf[c]!='-'&&(buf[c]<'0'||buf[c]>'9'))c++;
        if(c>=sz)return false;
        bool flag=0;if(buf[c]=='-')flag=1,c++;
        for(t=0;c<sz&&'0'<=buf[c]&&buf[c]<='9';c++)t=t*10+buf[c]-'0';
        if(flag==1)t=-t;return true;
    }
}
template <typename _TpInt>
inline void write(_TpInt x)
{
    if (x<0){
        putchar('-');
        write<_TpInt>(~x+1);
    }
    else {
        if (x>9)write<_TpInt>(x/10);   
        putchar(x%10+'0');
    }
}
template <typename _ll>
inline void ...(_ll x)
{...}
int main(void)
{
    io::begin();
    io::read();
    write();
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值