static void dfs ( int i , int c ) {
  visited [ i ] = true ;
  if ( color [ i ] != c ) ans ++ ;
  for ( int x : list [ i ] ) if ( ! visited [ x ] ) dfs ( x , color [ i ] ) ;
}

static void dfs ( int i , int c ) { visited [ i ] = true ; if ( color [ i ] != c ) ans ++ ; for ( int x : list [ i ] ) if ( ! visited [ x ] ) dfs ( x , color [ i ] ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (true))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) consequence: (expression_statement (update_expression (identifier)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (array_access array: (identifier) index: (identifier)) body: (if_statement condition: (parenthesized_expression (unary_expression operand: (array_access array: (identifier) index: (identifier)))) consequence: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (array_access array: (identifier) index: (identifier)))))))))