@@ -45,7 +45,7 @@ using namespace std;
45
45
int timer = 0 ;
46
46
const int MAX_NODES_GRAPH = 1e5 ;
47
47
48
- struct PersistentSegmentTree {
48
+ struct persistent_segment_tree {
49
49
static const int MAX_NODES_TREE = 2e6 ;
50
50
int left_child [MAX_NODES_TREE + 1 ], right_child [MAX_NODES_TREE + 1 ],
51
51
node_value [MAX_NODES_TREE + 1 ];
@@ -92,20 +92,20 @@ struct PersistentSegmentTree {
92
92
int m = (l + r) / 2;
93
93
94
94
// Calculate the number of elements in the left child of the current range
95
- int leftSubtreeCount = node_value[left_child [a ]] + node_value[left_child [b ]] -
95
+ int left_subtree_count = node_value[left_child [a ]] + node_value[left_child [b ]] -
96
96
node_value[left_child [anc ]] - node_value[left_child [pr ]];
97
97
98
- if (leftSubtreeCount >= k) {
98
+ if (left_subtree_count >= k) {
99
99
return query(left_child[a ], left_child[b ], left_child[anc ], left_child[pr ],
100
100
l, m, k);
101
101
} else {
102
102
return query(right_child[a ], right_child[b ], right_child[anc ],
103
- right_child[pr ], m + 1, r, k - leftSubtreeCount );
103
+ right_child[pr ], m + 1, r, k - left_subtree_count );
104
104
}
105
105
}
106
106
};
107
107
108
- PersistentSegmentTree pst;
108
+ persistent_segment_tree pst;
109
109
110
110
struct Graph {
111
111
int LOG;
0 commit comments