Chủ Nhật, 2 tháng 12, 2012

template for contest (2/12/2012)


/*
Coder : Nguyen Duc Tam
template for contest
*/

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<vector>
#include<utility>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<cstring>
#include<string>
#include<cmath>
#include<cstdlib>
#include<iomanip>
#include<ctime>

using namespace std;

/*
define for statement loop
*/
#define REP(i, start, end, step) for(int i = start; i < end; i += step)
#define DOWN(i, start, end, step) for(int i = start; i > end; i -= step)
#define FOR(it,c) for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
#define ALL(c) (c).begin(), (c).end()
#define SZ(x) ((int)(x).size())

/*
define operator bit
*/
#define L(x,i) ((x) << (i))
#define R(x,i) ((x) >> (i))
#define AND(a,b) ((a) & (b))
#define OR(a,b) ((a) | (b))
#define XOR(a,b) ((a) ^ (b))
#define NOT(a) (~(a))
#define SB(x,i) (OR((x), L(1, (i)))) // x | 1 << i
#define CB(x,i) (AND((x),NOT(L(1,(i))))) // x & ~(1 << i)
#define TB(x,i) (AND((x), L(1,(i)))) // x & (1 << i)

/*
define init data
*/
#define FILL(a,val) memset(a,val,sizeof(a));
#define INIT(a,l,r,val) REP(i,l,r,1) (a)[i] = val;

/*
define convert data
*/
#define DIG(c) (int)((c) - '0')
#define CHR(c) (char)((c) + '0')
#define LOW(c) (char)((c) + 32)
#define UPP(c) (char)((c) - 32)

/*
define math function
*/
#define SQR(a) (a) * (a)

/*
define find element in container very fast.
*/
#define LO(as,x) lower_bound(ALL(as),x)
#define UP(as,x) upper_bound(ALL(as),x)
#define IOF(as,x) distance((as).begin(), LO((as),x))
#define IOL(as,x) distance((as).begin(), UP((as),x))
#define IN(as,x) ((IOF(as,x) == 0) && *(as.begin()) != x) || (IOL(as,x) > as.size())
#define ER(as,x) equal_range(ALL((as)),x)

/*
define constant
*/
#define EPS 1e-7
#define OO 1000000005
#define N 100005

#define X first
#define Y second

bool GREATER(int i, int j)
{
return i > j;
}

const int DAY[13] = {-1,31,29,31,30,31,30,31,31,30,31,30,31};
const int dx4[4] = {};
const int dy4[4] = {};
const int dx8[8] = {};
const int dy8[8] = {};


typedef pair<int,int> II;
typedef pair<II,int> III;
typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned char UC;

vector<int>::iterator it, low, up; // using lower_bound, upper_bound
pair<vector<int>::iterator, vector<int>::iterator > bound; // using function equal_range(first, last, x)


int main()
{
#define Off  true
if(Off)
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
}
return 0;
}

Không có nhận xét nào:

Đăng nhận xét