-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.cpp.tmpl
69 lines (55 loc) · 1.56 KB
/
template.cpp.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <bits/stdc++.h>
using namespace std;
#define fi(a, b) for(int i=((int)(a)); i < ((int)(b)); i++)
#define fj(a, b) for(int j=((int)(a)); j < ((int)(b)); j++)
#define fk(a, b) for(int k=((int)(a)); k < ((int)(b)); k++)
#define fie(a, b) for(int i=((int)(a)); i <= ((int)(b)); i++)
#define fje(a, b) for(int j=((int)(a)); j <= ((int)(b)); j++)
#define fke(a, b) for(int k=((int)(a)); k <= ((int)(b)); k++)
#define isin(a, aset) (aset.count((a))>0)
#define isnotin(a, aset) (aset.count((a))==0)
#define a2z(v) (v).begin(),(v).end()
#define len(v) (v).size()
#define forzin(acont) for(auto z : acont)
#define MAXTOP 10000000 //this is the biggest topcoder can do
using di=deque<int>;
using vi=vector<int>;
using si=set<int>;
using pii=pair<int,int>;
using ll=long long;
using ull=unsigned long long;
using bits=bitset<50>;
template <class T>
void printv(vector<T> v)
{
copy(a2z(v),ostream_iterator<T>(cout,","));
}
template <class T>
void printd(deque<T> v)
{
copy(a2z(v),ostream_iterator<T>(cout,","));
}
std::ostream& operator<<(std::ostream& strm, const std::pair<int,int>& kvPair)
{
strm << "(" << kvPair.first << "," << kvPair.second << ")";
return strm;
}
//#define MAXN 100
//int dp[MAXN][MAXN][MAXN][MAXN];
//memset(dp, -1, sizeof(dp));
struct ${ClassName}
{
${<foreach Method.Params p}
${p.Type} ${p.Name};
${<end}
${Method.ReturnType} ${Method.Name}(${Method.Params})
{
${<foreach Method.Params p}
this->${p.Name} = ${p.Name};
${<end}
return ${Method.ReturnType;ZeroValue};
}
};
${CutBegin}
${<TestCode}
${CutEnd}