C++果然还是有一个模版写起来要舒服点

我的模版肯定不适合所有人(废话)

写起来自己真正舒服最重要

cmath库的函数我能手写的一般手写所以就写成了函数模版

typedef了一些东西省时间

vector的动态申请空间这点想好好利用于是define了

stack对于给图论题做栈非常方便

然后就是平常常用的一些库,比如万恶的STL哈哈

当然,模版会不断更新的

#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <climits>
#include <cstring>
#include <utility>
#include <vector>
#include <string>
#include <cstdio>
#include <bitset>
#include <ctime>
#include <cmath>
#include <stack>
#include <list>
#include <set>
#include <map>

using namespace std;

#define sci stack <int>
#define vci vector <int>
#define vcs vector <string>
#define vcd vector <double>
#define vci64 vector <long long>
#define seti set <int>
#define mseti multiset <int>

const int maxn = 100000 + 5;
const int maxm = 100000 + 5;

typedef unsigned int uint;
typedef long long int64;
typedef unsigned long long uint64;

template <class T> inline T Sqr(const T & x) { return x * x; }
template <class T> inline T Abs(const T & x) { return x > 0 ? x : -x; }
template <class T> inline T Min(const T & a, const T & b) { return a < b ? a : b; }
template <class T> inline T Max(const T & a, const T & b) { return a > b ? a : b; }
template <class T> inline T Ksm(const T & a, const T & b, const T & m) { T _ = 1; for (; b; b >>= 1, a = a * a % m) (b & 1) ? _ = _ * a % m : 0; return _ % m; }
template <class T> inline void Swap(T & a, T & b) { T _; _ = a; a = b; b = _; }

int getint()
{
   char ch = getchar(); int result = 0, res = 1;
   for (; '0' > ch || ch > '9'; ch = getchar()) ch == '-' ? res = -1 : 0;
   for (; '0' <= ch && ch <= '9'; result = result * 10 + ch - '0', ch = getchar());
   return result * res;
}

int main()
{
#ifndef ONLINE_JUDGE
   freopen(".in", "r", stdin);
   freopen(".out", "w", stdout);
#endif

   return 0;
}

还有,以后代码发ideone

代码。。。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值