-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefault_cpp_template.cpp
161 lines (130 loc) · 3.13 KB
/
default_cpp_template.cpp
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>
using namespace std;
using namespace std::chrono;
using namespace __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{{{*/
void Log_Gen() { cerr << endl; }
template <typename HEAD, typename... TAIL>
void Log_Gen(HEAD H, TAIL... T) {
cerr << " " << (H);
Log_Gen(T...);
}
#ifdef HELL_JUDGE
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", Log_Gen(__VA_ARGS__)
#else
#define debug(...) 0
#endif
/* }}} */
// defines & constants /*{{{*/
#define int int64_t
const int MAXM = (int)1e5+100;
const int MAXN = (int)1e5+100;
const int MOD = (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;
}
class NumberIterator : iterator<forward_iterator_tag, int> {
public:
int v;
NumberIterator(int x) : v(x) {}
operator int &() { return v; }
int operator*() { return v; }
};
class range : 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;
}
};
/*}}}*/
// /*}}}*/
void solve(void){
}
// Main Function {{{
signed main(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
auto INITIAL_TIME = high_resolution_clock::now();
#endif
solve();
#ifdef HELL_JUDGE
auto FINAL_TIME = high_resolution_clock::now();
cout << "Time : "
<< duration_cast<milliseconds>(FINAL_TIME-INITIAL_TIME).count()
<< " ms" << '\n';
#endif
return 0;
}
/*}}}*/