20
20
#define UB upper_bound
21
21
#define fr (x ) freopen(x," r" ,stdin)
22
22
#define fw (x ) freopen(x," w" ,stdout)
23
- #define iout (x ) printf(" %d\n " ,x)
24
- #define lout (x ) printf(" %lld\n " ,x)
25
23
#define REP (x, l, u ) for (ll x = l;x<u;x++)
26
24
#define RREP (x, l, u ) for (ll x = l;x>=u;x--)
27
25
#define complete_unique (a ) a.erase(unique(a.begin(),a.end()),a.end())
@@ -45,22 +43,11 @@ typedef double db;
45
43
typedef long double ld;
46
44
using namespace __gnu_pbds ; // required
47
45
using namespace std ;
48
- template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
46
+ template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
49
47
typedef vector<ll> VLL;
50
48
typedef vector<int > VI;
51
- const int block_size = 320 ;
52
- typedef complex <ll> point;
53
49
const ll mod = 1e9 + 7 ;
54
- const ll inf = 1e9 + 7 ;
55
- const ld eps = 1e-9 ;
56
- const db PI = atan(1 ) * 4 ;
57
50
58
- template <typename T>
59
- inline int sign (const T &a) {
60
- if (a < 0 )return -1 ;
61
- if (a > 0 )return 1 ;
62
- return 0 ;
63
- }
64
51
65
52
string to_string (string s) { return ' "' + s + ' "' ; }
66
53
@@ -104,21 +91,6 @@ inline bool upmin(T &a, const S &b) { return a > b ? a = b, 1 : 0; }
104
91
template <typename T, typename S>
105
92
inline bool upmax (T &a, const S &b) { return a < b ? a = b, 1 : 0 ; }
106
93
107
- template <typename T>
108
- inline void in (T &x) {
109
- x = 0 ;
110
- T f = 1 ;
111
- char ch = getchar ();
112
- while (!isdigit (ch)) {
113
- if (ch == ' -' ) f = -1 ;
114
- ch = getchar ();
115
- }
116
- while (isdigit (ch)) {
117
- x = x * 10 + ch - ' 0' ;
118
- ch = getchar ();
119
- }
120
- x *= f;
121
- }
122
94
123
95
ull twop (ll x) { return 1ULL << x; }
124
96
@@ -134,27 +106,6 @@ ll inverse(ll a, ll m) {
134
106
return MOD ((1 - inverse (m, a) * m) / a, m);
135
107
}
136
108
137
- template <typename A, typename B>
138
- inline void in (A &x, B &y) {
139
- in (x);
140
- in (y);
141
- }
142
-
143
- template <typename A, typename B, typename C>
144
- inline void in (A &x, B &y, C &z) {
145
- in (x);
146
- in (y);
147
- in (z);
148
- }
149
-
150
- template <typename A, typename B, typename C, typename D>
151
- inline void in (A &x, B &y, C &z, D &d) {
152
- in (x);
153
- in (y);
154
- in (z);
155
- in (d);
156
- }
157
-
158
109
template <typename T>
159
110
T sqr (T x) { return x * x; }
160
111
@@ -170,13 +121,9 @@ ll fast(ll a, ll b, ll mod) {
170
121
if (b < 0 )a = inverse (a, mod), b = -b;
171
122
ll ans = 1 ;
172
123
while (b) {
173
- if (b & 1 ) {
174
- b--;
175
- ans = ans * a % mod;
176
- } else {
177
- a = a * a % mod;
178
- b /= 2 ;
179
- }
124
+ if (b & 1 )ans = ans * a % mod;
125
+ a = a * a % mod;
126
+ b /= 2 ;
180
127
}
181
128
return ans % mod;
182
129
}
@@ -199,7 +146,7 @@ signed main() {
199
146
int t = 1 ;
200
147
// in(t);
201
148
for (int i = 1 ; i <= t; i++) {
202
- // cout<<"Case #"<<i<<":";
149
+ // cout<<"Case #"<<i<<": ";
203
150
SOLVE::main ();
204
151
205
152
}
0 commit comments