@@ -119,12 +119,6 @@ struct functional_graph_processor {
119119 vector<int > end; // [pos[u], end[u]) denotes the subtree
120120 vector<int > size; // size of the subtree in abr
121121};
122- bool equal (const basic_string<int > &a, const vi &b) {
123- if (sz (a) != sz (b)) return 0 ;
124- for (int i = 0 ; i < sz (a); i++)
125- if (a[i] != b[i]) return 0 ;
126- return 1 ;
127- }
128122int main () {
129123 cin.tie (0 )->sync_with_stdio (0 );
130124 for (int num_tests = 100 ; num_tests--;) {
@@ -133,17 +127,12 @@ int main() {
133127 for (int i = 0 ; i < n; i++) a[i] = rnd (0 , n - 1 );
134128 auto [root_of, cycle, childs] = func_graph (a);
135129 functional_graph_processor fgp (a);
136- assert (sz (cycle) == sz (fgp.cycle ));
137- for (int i = 0 ; i < sz (cycle); i++) {
138- assert (sz (cycle[i]) == sz (fgp.cycle [i]));
139- for (int j = 0 ; j < sz (cycle[i]); j++)
140- assert (cycle[i][j] == fgp.cycle [i][j]);
141- }
130+ assert (cycle == fgp.cycle );
131+ assert (childs == fgp.abr );
142132 for (int i = 0 ; i < n; i++) {
143133 int root =
144134 cycle[root_of[i].first ][root_of[i].second ];
145135 assert (root == fgp.root_of [i]);
146- assert (equal (childs[i], fgp.abr [i]));
147136 assert ((root == i) == (fgp.cycle_id [i] != -1 ));
148137 if (root == i) {
149138 assert (root_of[i].first == fgp.cycle_id [i]);
0 commit comments