File tree Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change 1
- template <typename T>
2
- class Fenwick {
3
- public:
1
+ template <typename T> class Fenwick {
2
+ public:
4
3
vector<T> fenw;
5
4
int n;
6
5
7
- Fenwick (int _n) : n(_n) {
8
- fenw.resize (n);
9
- }
6
+ Fenwick (int _n) : n(_n) { fenw.resize (n); }
10
7
void modify (int x, T v) {
11
8
while (x < n) {
12
9
fenw[x] += v;
@@ -29,17 +26,11 @@ class Fenwick {
29
26
// }
30
27
};
31
28
32
- template <typename T>
33
- using fenwick = Fenwick<T>;
29
+ template <typename T> using fenwick = Fenwick<T>;
34
30
35
31
struct node {
36
32
// don't forget to set default value
37
33
int a = ...;
38
- inline void operator +=(const node &other) {
39
- ...
40
- }
41
- inline node operator -(const node &other) {
42
- ...
43
- return *this ;
44
- }
45
- };
34
+ inline void operator +=(const node &other) { ... }
35
+ inline node operator -(const node &other) { ... return *this ; }
36
+ };
You can’t perform that action at this time.
0 commit comments