CSP-S 代码基本框架

  眼看离复赛越来越近了,最近代码打得越来越熟练了,这些是我平时做题必打的代码,在此总结一下

     

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<queue>
#include<vector>
#include<stack>
#include<map>
#define R register
#define lson l,mid,p<<1
#define rson mid+1,r,p<<1|1
#define next kkksc03
#define gh getchar
#define ph putchar
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
inline ll read();
inline void write(ll x);
inline void writeln(ll x);
inline void writesp(ll x);
inline ll chkmax(ll x,ll y){return x<y?y:x;}
inline ll chkmin(ll x,ll y){return x<y?x:y;}
inline void chkswap(ll &x,ll &y){R ll t=y;y=x;x=t;}
int main(){
} 
inline ll read(){
    ll x=0,t=1;char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-') t=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar(); 
    }
    return x*t;
}
inline void write(ll x){
    if(x<0){ph('-');x=-x;}
    if(x<=9){ph(x+'0');return;}
    write(x/10);
    ph(x%10+'0');
}
inline void writeln(ll x){
    write(x);ph('\n');
}
inline void writesp(ll x){
    write(x);ph(' ');
}

 

 

   祝2019 CSP-S ++RP,RP++!

 

      

 

     

 

posted @ 2019-10-23 18:36  月落乌啼算钱  阅读(313)  评论(0编辑  收藏  举报