-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.cpp
More file actions
147 lines (124 loc) · 4.4 KB
/
template.cpp
File metadata and controls
147 lines (124 loc) · 4.4 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#include<bits/stdc++.h>
using namespace std;
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// - - - - - - Data Types - - - - - - //
typedef long int LI;
typedef long long LL;
// - - - - - - Vectors - - - - - - //
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<string> VS;
typedef vector<double> VD;
typedef vector<VI> VVI;
#define scanVI(v, n) for(int i=0; i<n; i++){ int x; cin >> x; v.PB(x); }
#define scanVLLI(v, n) for(int i=0; i<n; i++){ LLI x; cin >> x; v.PB(x); }
#define scanVS(v, n) for(int i=0; i<n; i++){ string x; cin >> x; v.PB(x); }
#define scanVD(v, n) for(int i=0; i<n; i++){ double x; cin >> x; v.PB(x); }
// - - - - - - Maps - - - - - - //
typedef map<int, int> MII;
typedef map<int, string> MIS;
typedef map<int, char> MIC;
typedef map<string, int> MSI;
typedef map<char, int> MCI;
typedef map<int, VI> MIVI;
// - - - - - - Pairs - - - - - - //
typedef pair<int, int> PII;
typedef pair<string, string> PSS;
typedef pair<char, char> PCC;
typedef pair<int, string> PIS;
typedef pair<int, char> PIC;
typedef pair<string, char> PSC;
// - - - - - - Sets - - - - - - //
typedef set<int> SI;
typedef set<LL> SLL;
typedef set<string> SS;
typedef set<char> SC;
// - - - - - - - - - - - - - - - - - - //
#define PF printf
#define SF scanf
#define PB push_back
#define POP pop_back()
#define PP prev_permutation
#define NP next_permutation
#define MP make_pair
#define CLRN(a, b) memset(a, b, sizeof(a))
#define CLR(a) memset(a, 0, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define ALLN(a, n) (a, a+n)
#define BSRCN(a, n, x) binary_search(ALLN(a, n), x)
#define BSRC binary_search
#define MAX 10000007
#define MIN -10000007
#define inf int(1e6+9)
#define PI acos(-1)
#define BR PF("\n")
#define FastIO ios_base::sync_with_stdio(false)
#define READ() freopen("input.txt", "r", stdin)
#define WRITE() freopen("output.txt", "w", stdout)
#define len(a) a.length()
#define rsort(a) sort(a.rbegin(), a.rend())
#define pvec(v) for(auto x: v) cout<<x<<" "
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
/*----------------------Graph Moves----------------*/
int ROW[]={+1,-1,+0,+0};
int COL[]={+0,+0,+1,-1};
int X[]={+0,+0,+1,-1,-1,+1,-1,+1}; // Kings Move
int Y[]={-1,+1,+0,+0,+1,+1,-1,-1}; // Kings Move
int KX[]={-2, -2, -1, -1, 1, 1, 2, 2}; // Knights Move
int KY[]={-1, 1, -2, 2, -2, 2, -1, 1}; // Knights Move
/*------------------------------------------------*/
// ---------------------DEBUG---------------------//
#ifdef WOLF
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1){
cout << name << " = " << arg1 << std::endl;
}
template < typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names, ',');
cout.write(names, comma - names) << " = " << arg1 <<" | ";
__f(comma+1, args...);
}
#else
#define debug(...)
#endif
//------------------------------------------------//
void fastscan(int &number)
{
bool negative = false;
int c;
number = 0;
c = getchar();
if (c=='-')
{
negative = true;
c = getchar();
}
for (; (c>47 && c<58); c=getchar())
number = number *10 + c - 48;
if (negative)
number *= -1;
}
LL GCD(LL a, LL b) { return b == 0 ? a : GCD(b , a % b); }
int LCM(int a, int b) { return a * (b/GCD(a, b)); }
bool CMP(int a, int b) { return a>b; }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - END - - - - - - - - - - - - - - - - - - - - - - - - - //
int main()
{
// FastIO;
#ifdef WOLF
clock_t Start=clock();
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
// Code
cout<<"Hello World"<<endl;
END:
#ifdef WOLF
fprintf(stderr, "\n>>Runtime: %.10fs\n", (double) (clock() - Start) / CLOCKS_PER_SEC);
#endif
return 0;
}