- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdefault_cpp_template.cpp
More file actions
Latest commit
161 lines (130 loc) · 3.13 KB
/
Copy pathdefault_cpp_template.cpp
File metadata and controls
161 lines (130 loc) · 3.13 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// {{{
// Header Files {{{
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<iostream>
#include<algorithm>
#include<string>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<chrono>
#include<numeric>
#include<utility>
#include<bitset>
#include<tuple>
#include<queue>
#include<stack>
#include<vector>
#include<array>
#include<unordered_map>
#include<unordered_set>
#include<set>
#include<map>
#include<deque>
#include<climits>
#include<cstring>
#include<cmath>
#include<cassert>
#include<cstdio>
usingnamespacestd;
usingnamespacestd::chrono;
usingnamespace__gnu_pbds;
template<typename TypeInfo>
using new_set = tree< // find_by_order & order_of_key
TypeInfo ,
null_type ,
less<TypeInfo> ,
rb_tree_tag ,
tree_order_statistics_node_update
> ;
/* }}} */
/*Debug Section{{{*/
voidLog_Gen() { cerr << endl; }
template <typenameHEAD, typename... TAIL>
voidLog_Gen(HEAD H, TAIL... T) {
cerr << "" << (H);
Log_Gen(T...);
}
#ifdef HELL_JUDGE
#definedebug(...) cerr << "[" << #__VA_ARGS__ << "]:", Log_Gen(__VA_ARGS__)
#else
#definedebug(...) 0
#endif
/* }}} */
// defines & constants /*{{{*/
#defineintint64_t
constintMAXM = (int)1e5+100;
constintMAXN = (int)1e5+100;
constintMOD = (int)1e9+7;
/*}}}*/
// range & VPi /*{{{*/
template<typename A, typename B>
ostream& operator<<(ostream&out, const pair<A, B>&p){
out << p.first << '' << p.second ;
return out;
}
template<typename A, typename B>
istream& operator>>(istream&in, pair<A, B>&p){
in >> p.first >> p.second ;
return in;
}
template<typename A>
istream& operator>>(istream&in, vector<A>&vec){
for(auto&itr:vec){
in >> itr;
}
return in;
}
template<typename A>
ostream& operator<<(ostream&out,const vector<A>&vec){
for(auto&itr:vec){
out << itr <<''; // VVV
}
return out;
}
classNumberIterator : iterator<forward_iterator_tag, int> {
public:
int v;
NumberIterator(int x) : v(x) {}
operatorint &() { return v; }
intoperator*() { return v; }
};
classrange : pair<int,int> {
public:
range(int begin, int end) : pair<int,int>(begin, max(begin, end)) {}
range(int n) : pair<int,int>((int)0, max((int)0, n)) {}
NumberIterator begin() {
return first;
}
NumberIterator end() {
return second;
}
};
/*}}}*/
// /*}}}*/
voidsolve(void){
}
// Main Function {{{
signedmain(void){
#ifdef HELL_JUDGE
freopen("input","r",stdin);
freopen("output","w",stdout);
freopen("error","w",stderr);
#endif
ios::sync_with_stdio(false); // FLUSH THE STREAM IF USING puts / printf / scanf/
cin.tie(nullptr); // DISABLE FOR INTERACTIVE PROBLEMS
cout.tie(nullptr); //
#ifdef HELL_JUDGE
autoINITIAL_TIME = high_resolution_clock::now();
#endif
solve();
#ifdef HELL_JUDGE
autoFINAL_TIME = high_resolution_clock::now();
cout << "Time : "
<< duration_cast<milliseconds>(FINAL_TIME-INITIAL_TIME).count()
<< " ms" << '\n';
#endif
return0;
}
/*}}}*/