static int dp ( int i , int l ) {
  if ( i == - 1 ) return 0 ;
  if ( memo [ i ] [ l ] != - 1 ) return memo [ i ] [ l ] ;
  int t = 0 ;
  int e = dp ( i - 1 , l ) ;
  if ( a [ i ] <= l ) {
    t = dp ( i - 1 , a [ i ] ) + 1 ;
  }
  return memo [ i ] [ l ] = Math . max ( t , e ) ;
}

static int dp ( int i , int l ) { if ( i == - 1 ) return 0 ; if ( memo [ i ] [ l ] != - 1 ) return memo [ i ] [ l ] ; int t = 0 ; int e = dp ( i - 1 , l ) ; if ( a [ i ] <= l ) { t = dp ( i - 1 , a [ i ] ) + 1 ; } return memo [ i ] [ l ] = Math . max ( t , e ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (return_statement (decimal_integer_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (return_statement (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (array_access array: (identifier) index: (identifier)))) right: (decimal_integer_literal)))))) (return_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))))))