code
stringlengths
31
2.27k
tokenized_code
stringlengths
30
1.69k
sexp
stringlengths
115
9.43k
public static void main ( String [ ] args ) { System . out . println ( new p091 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p091 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static boolean isRightTriangle ( int x1 , int y1 , int x2 , int y2 ) { int a = x1 * x1 + y1 * y1 ; int b = x2 * x2 + y2 * y2 ; int c = ( x2 - x1 ) * ( x2 - x1 ) + ( y2 - y1 ) * ( y2 - y1 ) ; return a + b == c || b + c == a || c + a == b ; }
private static boolean isRightTriangle ( int x1 , int y1 , int x2 , int y2 ) { int a = x1 * x1 + y1 * y1 ; int b = x2 * x2 + y2 * y2 ; int c = ( x2 - x1 ) * ( x2 - x1 ) + ( y2 - y1 ) * ( y2 - y1 ) ; return a + b == c || b + c == a || c + a == b ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (return_statement (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))))))
public static void main ( String [ ] args ) { System . out . println ( new p113 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p113 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p071 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p071 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p003 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p003 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static long smallestFactor ( long n ) { if ( n <= 1 ) throw new IllegalArgumentException ( ) ; for ( long i = 2 , end = Library . sqrt ( n ) ; i <= end ; i ++ ) { if ( n % i == 0 ) return i ; } return n ; }
private static long smallestFactor ( long n ) { if ( n <= 1 ) throw new IllegalArgumentException ( ) ; for ( long i = 2 , end = Library . sqrt ( n ) ; i <= end ; i ++ ) { if ( n % i == 0 ) return i ; } return n ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (throw_statement (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) consequence: (return_statement (identifier))))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p125 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p125 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p121 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p121 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p025 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p025 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p127 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p127 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p120 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p120 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p124 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p124 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p172 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p172 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static BigInteger divideExactly ( BigInteger x , BigInteger y ) { BigInteger [ ] temp = x . divideAndRemainder ( y ) ; if ( temp [ 1 ] . signum ( ) != 0 ) throw new IllegalArgumentException ( "Not divisible" ) ; return temp [ 0 ] ; }
private static BigInteger divideExactly ( BigInteger x , BigInteger y ) { BigInteger [ ] temp = x . divideAndRemainder ( y ) ; if ( temp [ 1 ] . signum ( ) != 0 ) throw new IllegalArgumentException ( " Not ▁ divisible " ) ; return temp [ 0 ] ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (array_access array: (identifier) index: (decimal_integer_literal)) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (throw_statement (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))) (return_statement (array_access array: (identifier) index: (decimal_integer_literal)))))
public static void main ( String [ ] args ) { System . out . println ( new p013 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p013 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p587 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p587 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static double integral ( double x ) { double t = x - 1 ; return t - ( Math . sqrt ( x * ( 2 - x ) ) * t + Math . asin ( t ) ) / 2 ; }
private static double integral ( double x ) { double t = x - 1 ; return t - ( Math . sqrt ( x * ( 2 - x ) ) * t + Math . asin ( t ) ) / 2 ; }
(method_declaration (modifiers) type: (floating_point_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (floating_point_type) name: (identifier))) body: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (return_statement (binary_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier)))))) right: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) right: (decimal_integer_literal))))))
public static void main ( String [ ] args ) { System . out . println ( new p106 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p106 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p017 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p017 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static String toEnglish ( int n ) { if ( 0 <= n && n < 20 ) return ONES [ n ] ; else if ( 20 <= n && n < 100 ) return TENS [ n / 10 ] + ( n % 10 != 0 ? ONES [ n % 10 ] : "" ) ; else if ( 100 <= n && n < 1000 ) return ONES [ n / 100 ] + "hundred" + ( n % 100 != 0 ? "and" + toEnglish ( n % 100 ) : "" ) ; else if ( 1000 <= n && n < 1000000 ) return toEnglish ( n / 1000 ) + "thousand" + ( n % 1000 != 0 ? toEnglish ( n % 1000 ) : "" ) ; else throw new IllegalArgumentException ( ) ; }
private static String toEnglish ( int n ) { if ( 0 <= n && n < 20 ) return ONES [ n ] ; else if ( 20 <= n && n < 100 ) return TENS [ n / 10 ] + ( n % 10 != 0 ? ONES [ n % 10 ] : " " ) ; else if ( 100 <= n && n < 1000 ) return ONES [ n / 100 ] + " hundred " + ( n % 100 != 0 ? " and " + toEnglish ( n % 100 ) : " " ) ; else if ( 1000 <= n && n < 1000000 ) return toEnglish ( n / 1000 ) + " thousand " + ( n % 1000 != 0 ? toEnglish ( n % 1000 ) : " " ) ; else throw new IllegalArgumentException ( ) ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (return_statement (array_access array: (identifier) index: (identifier))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (return_statement (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (parenthesized_expression (ternary_expression condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) consequence: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) alternative: (string_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (return_statement (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (string_literal)) right: (parenthesized_expression (ternary_expression condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) consequence: (binary_expression left: (string_literal) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal))))) alternative: (string_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (return_statement (binary_expression left: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (string_literal)) right: (parenthesized_expression (ternary_expression condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) consequence: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (string_literal))))) alternative: (throw_statement (object_creation_expression type: (type_identifier) arguments: (argument_list)))))))))
public static void main ( String [ ] args ) { System . out . println ( new p046 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p046 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static boolean satisfiesConjecture ( int n ) { if ( n % 2 == 0 || Library . isPrime ( n ) ) return true ; for ( int i = 1 ; i * i * 2 <= n ; i ++ ) { if ( Library . isPrime ( n - i * i * 2 ) ) return true ; } return false ; }
private static boolean satisfiesConjecture ( int n ) { if ( n % 2 == 0 || Library . isPrime ( n ) ) return true ; for ( int i = 1 ; i * i * 2 <= n ; i ++ ) { if ( Library . isPrime ( n - i * i * 2 ) ) return true ; } return false ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (return_statement (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) consequence: (return_statement (true))))) (return_statement (false))))
public static void main ( String [ ] args ) { System . out . println ( new p038 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p038 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static boolean isPandigital ( String s ) { if ( s . length ( ) != 9 ) return false ; char [ ] temp = s . toCharArray ( ) ; Arrays . sort ( temp ) ; return new String ( temp ) . equals ( "123456789" ) ; }
private static boolean isPandigital ( String s ) { if ( s . length ( ) != 9 ) return false ; char [ ] temp = s . toCharArray ( ) ; Arrays . sort ( temp ) ; return new String ( temp ) . equals ( "123456789" ) ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (return_statement (false))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (return_statement (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (string_literal))))))
public static void main ( String [ ] args ) { System . out . println ( new p130 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p130 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int findLeastDivisibleRepunit ( int n ) { if ( n % 2 == 0 || n % 5 == 0 ) return 0 ; if ( n > Integer . MAX_VALUE / 10 ) throw new IllegalArgumentException ( "Arithmetic overflow" ) ; int sum = 1 ; int pow = 1 ; int k = 1 ; while ( sum % n != 0 ) { k ++ ; pow = pow * 10 % n ; sum = ( sum + pow ) % n ; } return k ; }
private static int findLeastDivisibleRepunit ( int n ) { if ( n % 2 == 0 || n % 5 == 0 ) return 0 ; if ( n > Integer . MAX_VALUE / 10 ) throw new IllegalArgumentException ( " Arithmetic ▁ overflow " ) ; int sum = 1 ; int pow = 1 ; int k = 1 ; while ( sum % n != 0 ) { k ++ ; pow = pow * 10 % n ; sum = ( sum + pow ) % n ; } return k ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)))) consequence: (return_statement (decimal_integer_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal)))) consequence: (throw_statement (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))) (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: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) body: (block (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p287 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p287 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p112 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p112 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static boolean isBouncy ( int x ) { if ( x < 100 ) return false ; else { boolean nonincreasing = true ; boolean nondecreasing = true ; int lastDigit = x % 10 ; x /= 10 ; while ( x != 0 ) { int digit = x % 10 ; if ( digit > lastDigit ) nondecreasing = false ; else if ( digit < lastDigit ) nonincreasing = false ; lastDigit = digit ; x /= 10 ; } return ! nonincreasing && ! nondecreasing ; } }
private static boolean isBouncy ( int x ) { if ( x < 100 ) return false ; else { boolean nonincreasing = true ; boolean nondecreasing = true ; int lastDigit = x % 10 ; x /= 10 ; while ( x != 0 ) { int digit = x % 10 ; if ( digit > lastDigit ) nondecreasing = false ; else if ( digit < lastDigit ) nonincreasing = false ; lastDigit = digit ; x /= 10 ; } return ! nonincreasing && ! nondecreasing ; } }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (false)) alternative: (block (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (false))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (false))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (binary_expression left: (unary_expression operand: (identifier)) right: (unary_expression operand: (identifier))))))))
public static void main ( String [ ] args ) { System . out . println ( new p315 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p315 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int samTransitionsMinusMaxTransitions ( int n ) { int samTrans = 0 ; int maxTrans = 0 ; long segmentState = 0 ; while ( true ) { long newState = numberToSegments ( n ) ; if ( newState == segmentState ) break ; maxTrans += Long . bitCount ( newState ^ segmentState ) ; segmentState = newState ; samTrans += 2 * Long . bitCount ( newState ) ; n = digitSum ( n ) ; } maxTrans += Long . bitCount ( segmentState ) ; return samTrans - maxTrans ; }
private static int samTransitionsMinusMaxTransitions ( int n ) { int samTrans = 0 ; int maxTrans = 0 ; long segmentState = 0 ; while ( true ) { long newState = numberToSegments ( n ) ; if ( newState == segmentState ) break ; maxTrans += Long . bitCount ( newState ^ segmentState ) ; segmentState = newState ; samTrans += 2 * Long . bitCount ( newState ) ; n = digitSum ( n ) ; } maxTrans += Long . bitCount ( segmentState ) ; return samTrans - maxTrans ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (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: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (true)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (decimal_integer_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (return_statement (binary_expression left: (identifier) right: (identifier)))))
private static long numberToSegments ( int n ) { if ( n < 0 || n > 999999999 ) throw new IllegalArgumentException ( ) ; long result = 0 ; int i = 0 ; do { result |= ( long ) DECIMAL_DIGIT_TO_SEGMENT [ n % 10 ] << ( i * 7 ) ; n /= 10 ; i ++ ; } while ( n != 0 ) ; return result ; }
private static long numberToSegments ( int n ) { if ( n < 0 || n > 999999999 ) throw new IllegalArgumentException ( ) ; long result = 0 ; int i = 0 ; do { result |= ( long ) DECIMAL_DIGIT_TO_SEGMENT [ n % 10 ] << ( i * 7 ) ; n /= 10 ; i ++ ; } while ( n != 0 ) ; return result ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (throw_statement (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (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: (decimal_integer_literal))) (do_statement body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (cast_expression type: (integral_type) value: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (update_expression (identifier)))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) (return_statement (identifier))))
private static int digitSum ( int n ) { if ( n < 0 ) throw new IllegalArgumentException ( ) ; int result = 0 ; while ( n != 0 ) { result += n % 10 ; n /= 10 ; } return result ; }
private static int digitSum ( int n ) { if ( n < 0 ) throw new IllegalArgumentException ( ) ; int result = 0 ; while ( n != 0 ) { result += n % 10 ; n /= 10 ; } return result ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (throw_statement (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p271 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p271 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static BigInteger chineseRemainderTheorem ( BigInteger a , BigInteger p , BigInteger b , BigInteger q ) { return a . add ( b . subtract ( a ) . multiply ( p . modInverse ( q ) ) . multiply ( p ) ) . mod ( p . multiply ( q ) ) ; }
private static BigInteger chineseRemainderTheorem ( BigInteger a , BigInteger p , BigInteger b , BigInteger q ) { return a . add ( b . subtract ( a ) . multiply ( p . modInverse ( q ) ) . multiply ( p ) ) . mod ( p . multiply ( q ) ) ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) body: (block (return_statement (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) name: (identifier) arguments: (argument_list (identifier))))) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))))
public static void main ( String [ ] args ) { System . out . println ( new p231 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p231 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p225 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p225 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static boolean hasTribonacciMultiple ( int modulus ) { int [ ] slow = { 1 , 1 , 1 }; int [ ] fast = slow . clone ( ) ; for ( boolean head = true ; ; head = false ) { if ( slow [ 0 ] % modulus == 0 ) return true ; if ( ! head && Arrays . equals ( slow , fast ) ) return false ; tribonacci ( slow , modulus ) ; tribonacci ( fast , modulus ) ; tribonacci ( fast , modulus ) ; } }
private static boolean hasTribonacciMultiple ( int modulus ) { int [ ] slow = { 1 , 1 , 1 } ; int [ ] fast = slow . clone ( ) ; for ( boolean head = true ; ; head = false ) { if ( slow [ 0 ] % modulus == 0 ) return true ; if ( ! head && Arrays . equals ( slow , fast ) ) return false ; tribonacci ( slow , modulus ) ; tribonacci ( fast , modulus ) ; tribonacci ( fast , modulus ) ; } }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_initializer (decimal_integer_literal) (decimal_integer_literal) (decimal_integer_literal)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) update: (assignment_expression left: (identifier) right: (false)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)) right: (decimal_integer_literal))) consequence: (return_statement (true))) (if_statement condition: (parenthesized_expression (binary_expression left: (unary_expression operand: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) consequence: (return_statement (false))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))))))
private static void tribonacci ( int [ ] state , int mod ) { int a = state [ 0 ] ; int b = state [ 1 ] ; int c = state [ 2 ] ; state [ 0 ] = b ; state [ 1 ] = c ; state [ 2 ] = ( a + b + c ) % mod ; }
private static void tribonacci ( int [ ] state , int mod ) { int a = state [ 0 ] ; int b = state [ 1 ] ; int c = state [ 2 ] ; state [ 0 ] = b ; state [ 1 ] = c ; state [ 2 ] = ( a + b + c ) % mod ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (identifier))))))
public static void main ( String [ ] args ) { System . out . println ( new p151 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p151 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p187 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p187 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p133 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p133 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static boolean hasDivisibleRepunit ( int p ) { return ( BigInteger . TEN . modPow ( EXPONENT , BigInteger . valueOf ( p * 9 ) ) . intValue ( ) - 1 ) / 9 % p == 0 ; }
private static boolean hasDivisibleRepunit ( int p ) { return ( BigInteger . TEN . modPow ( EXPONENT , BigInteger . valueOf ( p * 9 ) ) . intValue ( ) - 1 ) / 9 % p == 0 ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (return_statement (binary_expression left: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (method_invocation object: (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier) (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))))) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) right: (decimal_integer_literal)) right: (identifier)) right: (decimal_integer_literal)))))
public static void main ( String [ ] args ) { System . out . println ( new p500 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p500 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p429 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p429 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int countFactors ( int n , int p ) { if ( n == 0 ) return 0 ; else return n / p + countFactors ( n / p , p ) ; }
private static int countFactors ( int n , int p ) { if ( n == 0 ) return 0 ; else return n / p + countFactors ( n / p , p ) ; }
(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: (decimal_integer_literal))) consequence: (return_statement (decimal_integer_literal)) alternative: (return_statement (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)) (identifier))))))))
public static void main ( String [ ] args ) { System . out . println ( new p007 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p007 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p052 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p052 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static boolean multiplesHaveSameDigits ( int x ) { for ( int i = 2 ; i <= 6 ; i ++ ) { if ( ! Arrays . equals ( toSortedDigits ( x ) , toSortedDigits ( i * x ) ) ) return false ; } return true ; }
private static boolean multiplesHaveSameDigits ( int x ) { for ( int i = 2 ; i <= 6 ; i ++ ) { if ( ! Arrays . equals ( toSortedDigits ( x ) , toSortedDigits ( i * x ) ) ) return false ; } return true ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier))) (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))))))) consequence: (return_statement (false))))) (return_statement (true))))
private static char [ ] toSortedDigits ( int x ) { char [ ] result = Integer . toString ( x ) . toCharArray ( ) ; Arrays . sort ( result ) ; return result ; }
private static char [ ] toSortedDigits ( int x ) { char [ ] result = Integer . toString ( x ) . toCharArray ( ) ; Arrays . sort ( result ) ; return result ; }
(method_declaration (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p043 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p043 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static long toInteger ( int [ ] digits , int off , int len ) { long result = 0 ; for ( int i = off ; i < off + len ; i ++ ) result = result * 10 + digits [ i ] ; return result ; }
private static long toInteger ( int [ ] digits , int off , int len ) { long result = 0 ; for ( int i = off ; i < off + len ; i ++ ) result = result * 10 + digits [ i ] ; return result ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (array_access array: (identifier) index: (identifier)))))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p075 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p075 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p205 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p205 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int [ ] convolve ( int [ ] a , int [ ] b ) { int [ ] c = new int [ a . length + b . length - 1 ] ; for ( int i = 0 ; i < a . length ; i ++ ) { for ( int j = 0 ; j < b . length ; j ++ ) c [ i + j ] += a [ i ] * b [ j ] ; } return c ; }
private static int [ ] convolve ( int [ ] a , int [ ] b ) { int [ ] c = new int [ a . length + b . length - 1 ] ; for ( int i = 0 ; i < a . length ; i ++ ) { for ( int j = 0 ; j < b . length ; j ++ ) c [ i + j ] += a [ i ] * b [ j ] ; } return c ; }
(method_declaration (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (field_access object: (identifier) field: (identifier))) right: (decimal_integer_literal)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))))))) (return_statement (identifier))))
private static int sum ( int [ ] array , int start , int end ) { int sum = 0 ; for ( int i = start ; i < end ; i ++ ) sum += array [ i ] ; return sum ; }
private static int sum ( int [ ] array , int start , int end ) { int sum = 0 ; for ( int i = start ; i < end ; i ++ ) sum += array [ i ] ; return sum ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p348 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p348 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static long trySearch ( int limit ) { byte [ ] ways = new byte [ limit ] ; for ( int i = cbrt ( limit - 1 ) ; i > 1 ; i -- ) { int cube = i * i * i ; for ( int j = Library . sqrt ( limit - 1 - cube ) ; j > 1 ; j -- ) { int index = cube + j * j ; ways [ index ] = ( byte ) Math . min ( ways [ index ] + 1 , TARGET_WAYS + 1 ) ; } } long result = 0 ; int count = 0 ; for ( int i = 0 ; i < ways . length ; i ++ ) { if ( ways [ i ] == TARGET_WAYS && Library . isPalindrome ( i ) ) { result += i ; count ++ ; if ( count == TARGET_COUNT ) return result ; } } return - 1 ; }
private static long trySearch ( int limit ) { byte [ ] ways = new byte [ limit ] ; for ( int i = cbrt ( limit - 1 ) ; i > 1 ; i -- ) { int cube = i * i * i ; for ( int j = Library . sqrt ( limit - 1 - cube ) ; j > 1 ; j -- ) { int index = cube + j * j ; ways [ index ] = ( byte ) Math . min ( ways [ index ] + 1 , TARGET_WAYS + 1 ) ; } } long result = 0 ; int count = 0 ; for ( int i = 0 ; i < ways . length ; i ++ ) { if ( ways [ i ] == TARGET_WAYS && Library . isPalindrome ( i ) ) { result += i ; count ++ ; if ( count == TARGET_COUNT ) return result ; } } return - 1 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (for_statement init: (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)))))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal))))))))))) (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: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (update_expression (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (return_statement (identifier))))))) (return_statement (unary_expression operand: (decimal_integer_literal)))))
private static int cbrt ( int x ) { if ( x < 0 ) throw new IllegalArgumentException ( "Not implemented" ) ; int y = 0 ; for ( int i = 1 << 10 ; i != 0 ; i >>>= 1 ) { y |= i ; if ( y > 1290 || y * y * y > x ) y ^= i ; } return y ; }
private static int cbrt ( int x ) { if ( x < 0 ) throw new IllegalArgumentException ( " Not ▁ implemented " ) ; int y = 0 ; for ( int i = 1 << 10 ; i != 0 ; i >>>= 1 ) { y |= i ; if ( y > 1290 || y * y * y > x ) y ^= i ; } return y ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (throw_statement (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (decimal_integer_literal) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (assignment_expression left: (identifier) right: (decimal_integer_literal)) body: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier)))))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p078 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p078 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int search ( int limit ) { int [ ] partitions = new int [ limit ] ; partitions [ 0 ] = 1 ; for ( int i = 1 ; i < limit ; i ++ ) { for ( int j = i ; j < limit ; j ++ ) partitions [ j ] = ( partitions [ j ] + partitions [ j - i ] ) % MODULUS ; } for ( int i = 0 ; i < limit ; i ++ ) { if ( partitions [ i ] == 0 ) return i ; } return - 1 ; }
private static int search ( int limit ) { int [ ] partitions = new int [ limit ] ; partitions [ 0 ] = 1 ; for ( int i = 1 ; i < limit ; i ++ ) { for ( int j = i ; j < limit ; j ++ ) partitions [ j ] = ( partitions [ j ] + partitions [ j - i ] ) % MODULUS ; } for ( int i = 0 ; i < limit ; i ++ ) { if ( partitions [ i ] == 0 ) return i ; } return - 1 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))) right: (identifier))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (return_statement (identifier))))) (return_statement (unary_expression operand: (decimal_integer_literal)))))
public static void main ( String [ ] args ) { System . out . println ( new p173 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p173 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p026 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p026 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int getCycleLength ( int n ) { Map < Integer , Integer > stateToIter = new HashMap < > ( ) ; int state = 1 ; for ( int iter = 0 ; ; iter ++ ) { if ( stateToIter . containsKey ( state ) ) return iter - stateToIter . get ( state ) ; else { stateToIter . put ( state , iter ) ; state = state * 10 % n ; } } }
private static int getCycleLength ( int n ) { Map < Integer , Integer > stateToIter = new HashMap < > ( ) ; int state = 1 ; for ( int iter = 0 ; ; iter ++ ) { if ( stateToIter . containsKey ( state ) ) return iter - stateToIter . get ( state ) ; else { stateToIter . put ( state , iter ) ; state = state * 10 % n ; } } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (return_statement (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) alternative: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))))))))))
public static void main ( String [ ] args ) { System . out . println ( new p135 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p135 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p139 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p139 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p073 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p073 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int sternBrocotCount ( int leftN , int leftD , int rightN , int rightD ) { int n = leftN + rightN ; int d = leftD + rightD ; if ( d > 12000 ) return 0 ; else return 1 + sternBrocotCount ( leftN , leftD , n , d ) + sternBrocotCount ( n , d , rightN , rightD ) ; }
private static int sternBrocotCount ( int leftN , int leftD , int rightN , int rightD ) { int n = leftN + rightN ; int d = leftD + rightD ; if ( d > 12000 ) return 0 ; else return 1 + sternBrocotCount ( leftN , leftD , n , d ) + sternBrocotCount ( n , d , rightN , rightD ) ; }
(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)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (return_statement (decimal_integer_literal)) alternative: (return_statement (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier)))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier))))))))
public static void main ( String [ ] args ) { System . out . println ( new p062 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p062 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static String getCubeNumberClass ( int x ) { char [ ] digits = cube ( x ) . toString ( ) . toCharArray ( ) ; Arrays . sort ( digits ) ; return new String ( digits ) ; }
private static String getCubeNumberClass ( int x ) { char [ ] digits = cube ( x ) . toString ( ) . toCharArray ( ) ; Arrays . sort ( digits ) ; return new String ( digits ) ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (method_invocation name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (return_statement (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))))
private static BigInteger cube ( int x ) { return BigInteger . valueOf ( x ) . pow ( 3 ) ; }
private static BigInteger cube ( int x ) { return BigInteger . valueOf ( x ) . pow ( 3 ) ; }
(method_declaration (modifiers) type: (type_identifier) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (return_statement (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (decimal_integer_literal))))))
public static void main ( String [ ] args ) { System . out . println ( new p214 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p214 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p041 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p041 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int toInteger ( int [ ] digits ) { int result = 0 ; for ( int x : digits ) result = result * 10 + x ; return result ; }
private static int toInteger ( int [ ] digits ) { int result = 0 ; for ( int x : digits ) result = result * 10 + x ; return result ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p019 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p019 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int dayOfWeek ( int year , int month , int day ) { if ( year < 0 || year > 10000 || month < 1 || month > 12 || day < 1 || day > 31 ) throw new IllegalArgumentException ( ) ; int m = ( month - 3 + 4800 ) % 4800 ; int y = ( year + m / 12 ) % 400 ; m %= 12 ; return ( y + y / 4 - y / 100 + ( 13 * m + 2 ) / 5 + day + 2 ) % 7 ; }
private static int dayOfWeek ( int year , int month , int day ) { if ( year < 0 || year > 10000 || month < 1 || month > 12 || day < 1 || day > 31 ) throw new IllegalArgumentException ( ) ; int m = ( month - 3 + 4800 ) % 4800 ; int y = ( year + m / 12 ) % 400 ; m %= 12 ; return ( y + y / 4 - y / 100 + ( 13 * m + 2 ) / 5 + day + 2 ) % 7 ; }
(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)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (throw_statement (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (return_statement (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (decimal_integer_literal))) right: (decimal_integer_literal))) right: (identifier)) right: (decimal_integer_literal))) right: (decimal_integer_literal)))))
public static void main ( String [ ] args ) { System . out . println ( new p095 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p095 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p092 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p092 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static boolean isClass89 ( int x ) { while ( true ) { switch ( x ) { case 1 : return false ; case 89 : return true ; default : x = nextNumber ( x ) ; } } }
private static boolean isClass89 ( int x ) { while ( true ) { switch ( x ) { case 1 : return false ; case 89 : return true ; default : x = nextNumber ( x ) ; } } }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (while_statement condition: (parenthesized_expression (true)) body: (block (switch_expression condition: (parenthesized_expression (identifier)) body: (switch_block (switch_block_statement_group (switch_label (decimal_integer_literal)) (return_statement (false))) (switch_block_statement_group (switch_label (decimal_integer_literal)) (return_statement (true))) (switch_block_statement_group (switch_label) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))))))))))
private static int nextNumber ( int x ) { int sum = 0 ; while ( x != 0 ) { sum += ( x % 10 ) * ( x % 10 ) ; x /= 10 ; } return sum ; }
private static int nextNumber ( int x ) { int sum = 0 ; while ( x != 0 ) { sum += ( x % 10 ) * ( x % 10 ) ; x /= 10 ; } return sum ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p111 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p111 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static long toInteger ( int [ ] digits ) { long result = 0 ; for ( int x : digits ) result = result * 10 + x ; return result ; }
private static long toInteger ( int [ ] digits ) { long result = 0 ; for ( int x : digits ) result = result * 10 + x ; return result ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))))) (return_statement (identifier))))
private static long pow ( int x , int y ) { long z = 1 ; for ( int i = 0 ; i < y ; i ++ ) z *= x ; return z ; }
private static long pow ( int x , int y ) { long z = 1 ; for ( int i = 0 ; i < y ; i ++ ) z *= x ; return z ; }
(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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (identifier) right: (identifier)))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p001 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p001 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p128 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p128 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p063 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p063 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p115 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p115 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p034 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p034 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int factorialDigitSum ( int x ) { int sum = 0 ; while ( x != 0 ) { sum += FACTORIAL [ x % 10 ] ; x /= 10 ; } return sum ; }
private static int factorialDigitSum ( int x ) { int sum = 0 ; while ( x != 0 ) { sum += FACTORIAL [ x % 10 ] ; x /= 10 ; } return sum ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p304 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p304 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static long fibonacciMod ( long n ) { BigInteger a = BigInteger . ZERO ; BigInteger b = BigInteger . ONE ; for ( int i = 63 ; i >= 0 ; i -- ) { BigInteger d = a . multiply ( b . shiftLeft ( 1 ) . subtract ( a ) ) ; BigInteger e = a . pow ( 2 ) . add ( b . pow ( 2 ) ) ; a = d ; b = e ; if ( ( ( n >>> i ) & 1 ) != 0 ) { BigInteger c = a . add ( b ) ; a = b ; b = c ; } a = a . mod ( MODULUS_BI ) ; b = b . mod ( MODULUS_BI ) ; } return a . longValue ( ) ; }
private static long fibonacciMod ( long n ) { BigInteger a = BigInteger . ZERO ; BigInteger b = BigInteger . ONE ; for ( int i = 63 ; i >= 0 ; i -- ) { BigInteger d = a . multiply ( b . shiftLeft ( 1 ) . subtract ( a ) ) ; BigInteger e = a . pow ( 2 ) . add ( b . pow ( 2 ) ) ; a = d ; b = e ; if ( ( ( n >>> i ) & 1 ) != 0 ) { BigInteger c = a . add ( b ) ; a = b ; b = c ; } a = a . mod ( MODULUS_BI ) ; b = b . mod ( MODULUS_BI ) ; } return a . longValue ( ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) name: (identifier) arguments: (argument_list (identifier))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal))) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))
public static void main ( String [ ] args ) { System . out . println ( new p049 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p049 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static boolean hasSameDigits ( int x , int y ) { char [ ] xdigits = Integer . toString ( x ) . toCharArray ( ) ; char [ ] ydigits = Integer . toString ( y ) . toCharArray ( ) ; Arrays . sort ( xdigits ) ; Arrays . sort ( ydigits ) ; return Arrays . equals ( xdigits , ydigits ) ; }
private static boolean hasSameDigits ( int x , int y ) { char [ ] xdigits = Integer . toString ( x ) . toCharArray ( ) ; char [ ] ydigits = Integer . toString ( y ) . toCharArray ( ) ; Arrays . sort ( xdigits ) ; Arrays . sort ( ydigits ) ; return Arrays . equals ( xdigits , ydigits ) ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))))
public static void main ( String [ ] args ) { System . out . println ( new p090 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p090 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static boolean isArrangementValid ( int a , int b ) { if ( testBit ( a , 6 ) || testBit ( a , 9 ) ) a |= ( 1 << 6 ) | ( 1 << 9 ) ; if ( testBit ( b , 6 ) || testBit ( b , 9 ) ) b |= ( 1 << 6 ) | ( 1 << 9 ) ; for ( int [ ] sqr : SQUARES ) { if ( ! ( testBit ( a , sqr [ 0 ] ) && testBit ( b , sqr [ 1 ] ) || testBit ( a , sqr [ 1 ] ) && testBit ( b , sqr [ 0 ] ) ) ) return false ; } return true ; }
private static boolean isArrangementValid ( int a , int b ) { if ( testBit ( a , 6 ) || testBit ( a , 9 ) ) a |= ( 1 << 6 ) | ( 1 << 9 ) ; if ( testBit ( b , 6 ) || testBit ( b , 9 ) ) b |= ( 1 << 6 ) | ( 1 << 9 ) ; for ( int [ ] sqr : SQUARES ) { if ( ! ( testBit ( a , sqr [ 0 ] ) && testBit ( b , sqr [ 1 ] ) || testBit ( a , sqr [ 1 ] ) && testBit ( b , sqr [ 0 ] ) ) ) return false ; } return true ; }
(method_declaration (modifiers) type: (boolean_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: (method_invocation name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (decimal_integer_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (decimal_integer_literal))) right: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (decimal_integer_literal))))))) (enhanced_for_statement type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier) value: (identifier) body: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier) (array_access array: (identifier) index: (decimal_integer_literal)))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (array_access array: (identifier) index: (decimal_integer_literal))))) right: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier) (array_access array: (identifier) index: (decimal_integer_literal)))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (array_access array: (identifier) index: (decimal_integer_literal))))))))) consequence: (return_statement (false))))) (return_statement (true))))
private static boolean testBit ( int x , int i ) { return ( ( x >>> i ) & 1 ) != 0 ; }
private static boolean testBit ( int x , int i ) { return ( ( x >>> i ) & 1 ) != 0 ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (return_statement (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal))) right: (decimal_integer_literal)))))
public static void main ( String [ ] args ) { System . out . println ( new p118 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p118 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
private static int toInteger ( int [ ] digits , int start , int end ) { int result = 0 ; for ( int i = start ; i < end ; i ++ ) result = result * 10 + digits [ i ] ; return result ; }
private static int toInteger ( int [ ] digits , int start , int end ) { int result = 0 ; for ( int i = start ; i < end ; i ++ ) result = result * 10 + digits [ i ] ; return result ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (array_access array: (identifier) index: (identifier)))))) (return_statement (identifier))))
public static void main ( String [ ] args ) { System . out . println ( new p174 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p174 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))
public static void main ( String [ ] args ) { System . out . println ( new p109 ( ) . run ( ) ) ; }
public static void main ( String [ ] args ) { System . out . println ( new p109 ( ) . run ( ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))