|
1 |
| -// Author : Amit Kumar |
2 |
| - |
3 |
| -// #include <ext/pb_ds/assoc_container.hpp> |
4 |
| -// #include <ext/pb_ds/tree_policy.hpp> |
5 |
| - |
6 |
| -// #include <iostream> |
7 |
| -// #include <algorithm> |
8 |
| -// #include <string> |
9 |
| -// #include <sstream> |
10 |
| -// #include <fstream> |
11 |
| -// #include <iomanip> |
12 |
| -// #include <chrono> |
13 |
| -// #include <numeric> |
14 |
| -// #include <utility> |
15 |
| - |
16 |
| -// #include <bitset> |
17 |
| -// #include <tuple> |
18 |
| -// #include <queue> |
19 |
| -// #include <stack> |
20 |
| -// #include <vector> |
21 |
| -// #include <array> |
22 |
| -// #include <unordered_map> |
23 |
| -// #include <unordered_set> |
24 |
| -// #include <set> |
25 |
| -// #include <map> |
26 |
| -// #include <deque> |
27 |
| - |
28 |
| -// #include <climits> |
29 |
| -// #include <cstring> |
30 |
| -// #include <cmath> |
31 |
| -// #include <cassert> |
| 1 | +// {{{ |
| 2 | +// Header Files {{{ |
| 3 | + |
| 4 | +#include <ext/pb_ds/assoc_container.hpp> |
| 5 | +#include <ext/pb_ds/tree_policy.hpp> |
| 6 | + |
| 7 | +#include <iostream> |
| 8 | +#include <algorithm> |
| 9 | +#include <string> |
| 10 | +#include <sstream> |
| 11 | +#include <fstream> |
| 12 | +#include <iomanip> |
| 13 | +#include <chrono> |
| 14 | +#include <numeric> |
| 15 | +#include <utility> |
| 16 | + |
| 17 | +#include <bitset> |
| 18 | +#include <tuple> |
| 19 | +#include <queue> |
| 20 | +#include <stack> |
| 21 | +#include <vector> |
| 22 | +#include <array> |
| 23 | +#include <unordered_map> |
| 24 | +#include <unordered_set> |
| 25 | +#include <set> |
| 26 | +#include <map> |
| 27 | +#include <deque> |
| 28 | + |
| 29 | +#include <climits> |
| 30 | +#include <cstring> |
| 31 | +#include <cmath> |
| 32 | +#include <cassert> |
32 | 33 | #include <cstdio>
|
| 34 | + |
33 | 35 | using namespace std;
|
34 |
| -// using namespace std::chrono; |
35 |
| -// using namespace placeholders; |
36 |
| -// using namespace __gnu_pbds; |
37 |
| -// template<typename TypeInfo> |
38 |
| -// using new_set = tree< // find_by_order & order_of_key |
39 |
| -// TypeInfo , |
40 |
| -// null_type , |
41 |
| -// less<TypeInfo> , |
42 |
| -// rb_tree_tag , |
43 |
| -// tree_order_statistics_node_update |
44 |
| -// > ; |
| 36 | +using namespace std::chrono; |
| 37 | + |
| 38 | +using namespace __gnu_pbds; |
| 39 | + |
| 40 | +template<typename TypeInfo> |
| 41 | +using new_set = tree< // find_by_order & order_of_key |
| 42 | +TypeInfo , |
| 43 | + null_type , |
| 44 | + less<TypeInfo> , |
| 45 | + rb_tree_tag , |
| 46 | + tree_order_statistics_node_update |
| 47 | + > ; |
| 48 | + |
| 49 | +/* }}} */ |
| 50 | +/*Debug Section{{{*/ |
| 51 | + |
| 52 | +void Log_Gen() { cerr << endl; } |
| 53 | +template <typename HEAD, typename... TAIL> |
| 54 | +void Log_Gen(HEAD H, TAIL... T) { |
| 55 | + cerr << " " << (H); |
| 56 | + Log_Gen(T...); |
| 57 | +} |
| 58 | +#ifdef HELL_JUDGE |
| 59 | +#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", Log_Gen(__VA_ARGS__) |
| 60 | +#else |
| 61 | +#define debug(...) 0 |
| 62 | +#endif |
| 63 | + |
| 64 | +/* }}} */ |
| 65 | +// defines & constants /*{{{*/ |
| 66 | + |
| 67 | +#define int int64_t |
45 | 68 | const int MAXM = (int)1e5+100;
|
46 | 69 | const int MAXN = (int)1e5+100;
|
47 | 70 | const int MOD = (int)1e9+7;
|
48 | 71 |
|
49 |
| -int main(void){ |
| 72 | +/*}}}*/ |
| 73 | +// range & VPi /*{{{*/ |
| 74 | + |
| 75 | +template<typename A, typename B> |
| 76 | +ostream& operator<<(ostream&out, const pair<A, B>&p){ |
| 77 | + out << p.first << ' ' << p.second ; |
| 78 | + return out; |
| 79 | +} |
| 80 | + |
| 81 | +template<typename A, typename B> |
| 82 | +istream& operator>>(istream&in, pair<A, B>&p){ |
| 83 | + in >> p.first >> p.second ; |
| 84 | + return in; |
| 85 | +} |
| 86 | + |
| 87 | +template<typename A> |
| 88 | +istream& operator>>(istream&in, vector<A>&vec){ |
| 89 | + for(auto&itr:vec){ |
| 90 | + in >> itr; |
| 91 | + } |
| 92 | + return in; |
| 93 | +} |
| 94 | + |
| 95 | +template<typename A> |
| 96 | +ostream& operator<<(ostream&out,const vector<A>&vec){ |
| 97 | + for(auto&itr:vec){ |
| 98 | + out << itr <<' '; // VVV |
| 99 | + } |
| 100 | + return out; |
| 101 | +} |
| 102 | + |
| 103 | +class NumberIterator : iterator<forward_iterator_tag, int> { |
| 104 | + public: |
| 105 | + int v; |
| 106 | + |
| 107 | + NumberIterator(int x) : v(x) {} |
| 108 | + |
| 109 | + operator int &() { return v; } |
| 110 | + |
| 111 | + int operator*() { return v; } |
| 112 | +}; |
| 113 | +class range : pair<int,int> { |
| 114 | + public: |
| 115 | + range(int begin, int end) : pair<int,int>(begin, max(begin, end)) {} |
| 116 | + range(int n) : pair<int,int>((int)0, max((int)0, n)) {} |
| 117 | + |
| 118 | + NumberIterator begin() { |
| 119 | + return first; |
| 120 | + } |
| 121 | + |
| 122 | + NumberIterator end() { |
| 123 | + return second; |
| 124 | + } |
| 125 | +}; |
| 126 | + |
| 127 | +/*}}}*/ |
| 128 | +// /*}}}*/ |
| 129 | +void solve(void){ |
| 130 | + |
| 131 | +} |
| 132 | +// Main Function {{{ |
| 133 | + |
| 134 | +signed main(void){ |
| 135 | + |
50 | 136 | #ifdef HELL_JUDGE
|
51 | 137 | freopen("input","r",stdin);
|
52 | 138 | freopen("output","w",stdout);
|
53 | 139 | freopen("error","w",stderr);
|
54 | 140 | #endif
|
55 |
| -// auto initial_time = high_resolution_clock::now(); |
56 | 141 |
|
| 142 | + ios::sync_with_stdio(false); // FLUSH THE STREAM IF USING puts / printf / scanf/ |
| 143 | + cin.tie(nullptr); // DISABLE FOR INTERACTIVE PROBLEMS |
| 144 | + cout.tie(nullptr); // |
57 | 145 |
|
58 |
| -// auto final_time = high_resolution_clock::now(); |
59 |
| -// cout << duration_cast<milliseconds>(final_time-initial_time).count() << " ms" << '\n'; |
| 146 | +#ifdef HELL_JUDGE |
| 147 | + auto INITIAL_TIME = high_resolution_clock::now(); |
| 148 | +#endif |
| 149 | + |
| 150 | + solve(); |
| 151 | + |
| 152 | +#ifdef HELL_JUDGE |
| 153 | + auto FINAL_TIME = high_resolution_clock::now(); |
| 154 | + cout << "Time : " |
| 155 | + << duration_cast<milliseconds>(FINAL_TIME-INITIAL_TIME).count() |
| 156 | + << " ms" << '\n'; |
| 157 | +#endif |
60 | 158 | return 0;
|
61 | 159 | }
|
62 | 160 |
|
| 161 | +/*}}}*/ |
0 commit comments