code stringlengths 31 2.27k | tokenized_code stringlengths 30 1.69k | sexp stringlengths 115 9.43k |
|---|---|---|
public static void main ( String [ ] args ) throws IOException {
Scanner sc = new Scanner ( System . in ) ;
int n = sc . nextInt ( ) ;
int [ ] a = new int [ n ] ;
for ( int i = 0 ;
i < n ;
i ++ ) a [ i ] = sc . nextInt ( ) ;
long ans = help ( a ) ;
System . out . println ( ans ) ;
}
| public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; long ans = help ( a ) ; System . out . println ( ans ) ; } | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (varia... |
static long help ( int [ ] a ) {
if ( a [ 0 ] != 0 ) return 0 ;
int maxDist = 0 ;
for ( int w : a ) maxDist = Math . max ( maxDist , w ) ;
int [ ] rec = new int [ maxDist + 1 ] ;
for ( int w : a ) rec [ w ] ++ ;
if ( rec [ 0 ] != 1 ) return 0 ;
for ( int i = 1 ;
i <= maxDist ;
i ++ ) {
if ( rec [ ... | static long help ( int [ ] a ) { if ( a [ 0 ] != 0 ) return 0 ; int maxDist = 0 ; for ( int w : a ) maxDist = Math . max ( maxDist , w ) ; int [ ] rec = new int [ maxDist + 1 ] ; for ( int w : a ) rec [ w ] ++ ; if ( rec [ 0 ] != 1 ) return 0 ; for ( int i = 1 ; i <= maxDist ; i ++ ) { if ( rec [ i ] < 1 ) return 0 ; }... | (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 (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array... |
static long power ( long base , long p ) {
long ans = 1 ;
while ( p > 0 ) {
if ( p % 2 == 1 ) ans = ans * base % mod ;
base = base * base % mod ;
p /= 2 ;
}
return ans ;
}
| static long power ( long base , long p ) { long ans = 1 ; while ( p > 0 ) { if ( p % 2 == 1 ) ans = ans * base % mod ; base = base * base % mod ; p /= 2 ; } return ans ; } | (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... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
int n = sc . nextInt ( ) ;
int [ ] a = new int [ n ] ;
int [ ] d = new int [ n ] ;
int dmax = 0 ;
for ( int i = 0 ;
i < n ;
i ++ ) {
a [ i ] = sc . nextInt ( ) ;
d [ a [ i ] ] ++ ;
dmax = Math . max ( a ... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] d = new int [ n ] ; int dmax = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; d [ a [ i ] ] ++ ; dmax = Math . max ( a [ i ] , dmax ) ; } if ( a [ ... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static long pow ( long a , long n ) {
long x = 1 ;
while ( n > 0 ) {
if ( n % 2 == 1 ) {
x = x * a % MOD ;
}
a = a * a % MOD ;
n >>= 1 ;
}
return x ;
}
| public static long pow ( long a , long n ) { long x = 1 ; while ( n > 0 ) { if ( n % 2 == 1 ) { x = x * a % MOD ; } a = a * a % MOD ; n >>= 1 ; } return x ; } | (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... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
int N = sc . nextInt ( ) ;
int M = sc . nextInt ( ) ;
UnionFind uf = new UnionFind ( N ) ;
for ( int i = 0 ;
i < M ;
i ++ ) {
int a = sc . nextInt ( ) - 1 ;
int b = sc . nextInt ( ) - 1 ;
uf . union ( a , ... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; UnionFind uf = new UnionFind ( N ) ; for ( int i = 0 ; i < M ; i ++ ) { int a = sc . nextInt ( ) - 1 ; int b = sc . nextInt ( ) - 1 ; uf . union ( a , b ) ; } System . out . pri... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
for ( int i = 0 ;
i < N ;
i ++ ) node [ i ] = new Node ( ) ;
for ( int i = 0 ;
i < M ;
i ++ ) {
int a = sc . nextInt ( ) ;
int b = sc . nextInt ( ) ;
node [ a - 1 ] . to . add ( b - 1 ) ;
node [ b - 1 ] . to . add ( a - 1 ) ;
}
int count = 0 ... | public static void main ( String [ ] args ) { for ( int i = 0 ; i < N ; i ++ ) node [ i ] = new Node ( ) ; for ( int i = 0 ; i < M ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; node [ a - 1 ] . to . add ( b - 1 ) ; node [ b - 1 ] . to . add ( a - 1 ) ; } int count = 0 ; for ( int i = 0 ; i < N ; i ++... | (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 (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_decl... |
public static void solve ( Node n ) {
for ( int i = 0 ;
i < n . to . size ( ) ;
i ++ ) {
int next = n . to . get ( i ) ;
if ( node [ next ] . visit ) continue ;
node [ next ] . visit = true ;
solve ( node [ next ] ) ;
}
}
| public static void solve ( Node n ) { for ( int i = 0 ; i < n . to . size ( ) ; i ++ ) { int next = n . to . get ( i ) ; if ( node [ next ] . visit ) continue ; node [ next ] . visit = true ; solve ( node [ next ] ) ; } } | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integ... |
public static void main ( String [ ] args ) {
int N = sc . nextInt ( ) ;
int M = sc . nextInt ( ) ;
UnionFind uf = new UnionFind ( N ) ;
uf . init ( N ) ;
for ( int i = 0 ;
i < M ;
i ++ ) {
int a = sc . nextInt ( ) - 1 ;
int b = sc . nextInt ( ) - 1 ;
uf . unite ( a , b ) ;
}
for ( int i =... | public static void main ( String [ ] args ) { int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; UnionFind uf = new UnionFind ( N ) ; uf . init ( N ) ; for ( int i = 0 ; i < M ; i ++ ) { int a = sc . nextInt ( ) - 1 ; int b = sc . nextInt ( ) - 1 ; uf . unite ( a , b ) ; } for ( int i = 0 ; i < N ; i ++ ) { uf . fin... | (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identif... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
int N = sc . nextInt ( ) ;
int M = sc . nextInt ( ) ;
for ( int i = 0 ;
i < N ;
i ++ ) node [ i ] = new Node ( ) ;
for ( int i = 0 ;
i < M ;
i ++ ) {
int a = sc . nextInt ( ) ;
int b = sc . nextInt ( ) ;
... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int M = sc . nextInt ( ) ; for ( int i = 0 ; i < N ; i ++ ) node [ i ] = new Node ( ) ; for ( int i = 0 ; i < M ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; node [ a - 1 ] . to . add (... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void solve ( Node n ) {
for ( int i = 0 ;
i < n . to . size ( ) ;
i ++ ) {
int next = n . to . get ( i ) ;
if ( node [ next ] . visit ) continue ;
node [ next ] . visit = true ;
solve ( node [ next ] ) ;
}
}
| public static void solve ( Node n ) { for ( int i = 0 ; i < n . to . size ( ) ; i ++ ) { int next = n . to . get ( i ) ; if ( node [ next ] . visit ) continue ; node [ next ] . visit = true ; solve ( node [ next ] ) ; } } | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integ... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
int n = sc . nextInt ( ) ;
int m = sc . nextInt ( ) ;
UnionFindTree uft = new UnionFindTree ( n ) ;
for ( int i = 0 ;
i < m ;
i ++ ) {
int a = sc . nextInt ( ) ;
int b = sc . nextInt ( ) ;
uft . union ( a ... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; UnionFindTree uft = new UnionFindTree ( n ) ; for ( int i = 0 ; i < m ; i ++ ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; uft . union ( a - 1 , b - 1 ) ; } System .... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) throws Exception {
Scanner sc = new Scanner ( System . in ) ;
String n = sc . next ( ) , m = sc . next ( ) ;
if ( n . length ( ) > m . length ( ) ) System . out . println ( n ) ;
else System . out . println ( m ) ;
}
| public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; String n = sc . next ( ) , m = sc . next ( ) ; if ( n . length ( ) > m . length ( ) ) System . out . println ( n ) ; else System . out . println ( m ) ; } | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (varia... |
public static void main ( String [ ] args ) {
InputStream inputStream = System . in ;
OutputStream outputStream = System . out ;
FastScanner in = new FastScanner ( inputStream ) ;
PrintWriter out = new PrintWriter ( outputStream ) ;
TaskA solver = new TaskA ( ) ;
solver . solve ( 1 , in , out ) ;
out . cl... | public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastScanner in = new FastScanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
private static boolean isPrintableChar ( int c ) {
return c >= 33 && c <= 126 ;
}
| private static boolean isPrintableChar ( int c ) { return c >= 33 && c <= 126 ; } | (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: (identifier) right: (decimal_integer_literal)) right: (binary_expression le... |
public static void main ( String [ ] args ) {
MyScanner sc = new MyScanner ( ) ;
String s = sc . next ( ) ;
String s1 = sc . next ( ) ;
int a = s . length ( ) ;
int b = s1 . length ( ) ;
System . out . println ( a > b ? s : s1 ) ;
}
| public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; String s = sc . next ( ) ; String s1 = sc . next ( ) ; int a = s . length ( ) ; int b = s1 . length ( ) ; System . out . println ( a > b ? s : s1 ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
static int l_min ( int [ ] a ) {
Arrays . sort ( a ) ;
return a [ 0 ] ;
}
| static int l_min ( int [ ] a ) { Arrays . sort ( a ) ; return a [ 0 ] ; } | (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 (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (ar... |
static int l_max ( int [ ] a ) {
int l = a . length ;
Arrays . sort ( a ) ;
return a [ l - 1 ] ;
}
| static int l_max ( int [ ] a ) { int l = a . length ; Arrays . sort ( a ) ; return a [ l - 1 ] ; } | (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: (ident... |
static int nextInt ( ) {
return Integer . parseInt ( sc . next ( ) ) ;
}
| static int nextInt ( ) { return Integer . parseInt ( sc . next ( ) ) ; } | (method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters) body: (block (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))) |
static int [ ] nextIntArray ( int n ) {
return IntStream . range ( 0 , n ) . map ( i -> nextInt ( ) ) . toArray ( ) ;
}
| static int [ ] nextIntArray ( int n ) { return IntStream . range ( 0 , n ) . map ( i -> nextInt ( ) ) . toArray ( ) ; } | (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 (return_statement (method_invocation object: (method_invocation object: (method_invocation obje... |
static int max ( int ... ar ) {
Arrays . sort ( ar ) ;
return ar [ ar . length - 1 ] ;
}
| static int max ( int ... ar ) { Arrays . sort ( ar ) ; return ar [ ar . length - 1 ] ; } | (method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (spread_parameter (integral_type) (variable_declarator name: (identifier)))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (re... |
static int min ( int ... ar ) {
Arrays . sort ( ar ) ;
return ar [ 0 ] ;
}
| static int min ( int ... ar ) { Arrays . sort ( ar ) ; return ar [ 0 ] ; } | (method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (spread_parameter (integral_type) (variable_declarator name: (identifier)))) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (re... |
public static void main ( String [ ] args ) {
String a = sc . next ( ) , b = sc . next ( ) ;
out . println ( a . length ( ) > b . length ( ) ? a : b ) ;
}
| public static void main ( String [ ] args ) { String a = sc . next ( ) , b = sc . next ( ) ; out . println ( a . length ( ) > b . length ( ) ? a : b ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
InputStream inputStream = System . in ;
OutputStream outputStream = System . out ;
InputReader in = new InputReader ( inputStream ) ;
PrintWriter out = new PrintWriter ( outputStream ) ;
Task solver = new Task ( ) ;
solver . solve ( 1 , in , out ) ;
out . clos... | public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Task solver = new Task ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
int n = sc . nextInt ( ) ;
int [ ] a = new int [ n ] ;
int [ ] b = new int [ n ] ;
int [ ] c = new int [ n ] ;
for ( int i = 0 ;
i < n ;
i ++ ) {
a [ i ] = sc . nextInt ( ) ;
}
for ( int i = 0 ;
i < n ;
... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int [ ] b = new int [ n ] ; int [ ] c = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = sc . next... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
int n = sc . nextInt ( ) ;
Integer [ ] A = new Integer [ n ] , B = new Integer [ n ] , C = new Integer [ n ] ;
for ( int i = 0 ;
i < n ;
i ++ ) A [ i ] = sc . nextInt ( ) ;
for ( int i = 0 ;
i < n ;
i ++ ) B [ i ] = sc . nextInt ( ) ;
for ( int i = 0 ;
i... | public static void main ( String [ ] args ) { int n = sc . nextInt ( ) ; Integer [ ] A = new Integer [ n ] , B = new Integer [ n ] , C = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) A [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) B [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) C [ i ... | (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identif... |
static int gInt ( ) {
return Integer . parseInt ( s . next ( ) ) ;
}
| static int gInt ( ) { return Integer . parseInt ( s . next ( ) ) ; } | (method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters) body: (block (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))) |
public static void main ( String [ ] $ ) {
int n = gInt ( ) ;
int [ ] a = in ( n ) , b = in ( n ) , c = in ( n ) ;
long [ ] v1 = new long [ n ] , v2 = new long [ n ] ;
{
int v = 0 ;
for ( int i = 0 ;
i < n ;
++ i ) {
for ( ;
v < n && a [ v ] < b [ i ] ;
++ v ) {
}
v... | public static void main ( String [ ] $ ) { int n = gInt ( ) ; int [ ] a = in ( n ) , b = in ( n ) , c = in ( n ) ; long [ ] v1 = new long [ n ] , v2 = new long [ n ] ; { int v = 0 ; for ( int i = 0 ; i < n ; ++ i ) { for ( ; v < n && a [ v ] < b [ i ] ; ++ v ) { } v1 [ i ] = v ; } } Arrays . parallelPrefix ( v1 , Long ... | (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identif... |
static int [ ] in ( int n ) {
return IntStream . range ( 0 , n ) . map ( i -> gInt ( ) ) . sorted ( ) . toArray ( ) ;
}
| static int [ ] in ( int n ) { return IntStream . range ( 0 , n ) . map ( i -> gInt ( ) ) . sorted ( ) . toArray ( ) ; } | (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 (return_statement (method_invocation object: (method_invocation object: (method_invocation obje... |
public static void main ( String [ ] args ) throws Exception {
Scanner sc = new Scanner ( System . in ) ;
int n = Integer . parseInt ( sc . next ( ) ) ;
int [ ] a = new int [ n ] ;
for ( int i = 0 ;
i < n ;
i ++ ) a [ i ] = Integer . parseInt ( sc . next ( ) ) ;
int [ ] b = new int [ n ] ;
for ( int i =... | public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = Integer . parseInt ( sc . next ( ) ) ; int [ ] b = new int [ n ] ; for ( int i = 0 ; i < n ; i +... | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (varia... |
public static void main ( String [ ] args ) {
try ( Scanner sc = new Scanner ( System . in ) ;
) {
new Main ( ) . solve ( sc ) ;
}
}
| public static void main ( String [ ] args ) { try ( Scanner sc = new Scanner ( System . in ) ; ) { new Main ( ) . solve ( sc ) ; } } | (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 (try_with_resources_statement resources: (resource_specification (resource type: (type_identifier... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
String a = sc . next ( ) ;
System . out . println ( sc . next ( ) . replaceAll ( a , "" ) ) ;
}
| public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; System . out . println ( sc . next ( ) . replaceAll ( a , " " ) ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
InputStream inputStream = System . in ;
OutputStream outputStream = System . out ;
FastScanner in = new FastScanner ( inputStream ) ;
PrintWriter out = new PrintWriter ( outputStream ) ;
TaskA solver = new TaskA ( ) ;
solver . solve ( 1 , in , out ) ;
out . cl... | public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastScanner in = new FastScanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskA solver = new TaskA ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
private static boolean isPrintableChar ( int c ) {
return c >= 33 && c <= 126 ;
}
| private static boolean isPrintableChar ( int c ) { return c >= 33 && c <= 126 ; } | (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: (identifier) right: (decimal_integer_literal)) right: (binary_expression le... |
public static void main ( String [ ] args ) {
InputStream inputStream = System . in ;
OutputStream outputStream = System . out ;
InputReader in = new InputReader ( inputStream ) ;
PrintWriter out = new PrintWriter ( outputStream ) ;
Task solver = new Task ( ) ;
solver . solve ( 1 , in , out ) ;
out . clos... | public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Task solver = new Task ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] $ ) {
Scanner sc = new Scanner ( in ) ;
char x = sc . next ( ) . charAt ( 0 ) ;
String s = sc . next ( ) ;
for ( int i = 0 ;
i < s . length ( ) ;
i ++ ) {
if ( s . charAt ( i ) != x ) out . print ( s . charAt ( i ) ) ;
}
out . println ( ) ;
}
| public static void main ( String [ ] $ ) { Scanner sc = new Scanner ( in ) ; char x = sc . next ( ) . charAt ( 0 ) ; String s = sc . next ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) != x ) out . print ( s . charAt ( i ) ) ; } out . println ( ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
String a = sc . next ( ) ;
String b = sc . next ( ) ;
String s = "EQUAL" ;
if ( a . length ( ) > b . length ( ) ) {
System . out . println ( "GREATER" ) ;
System . exit ( 0 ) ;
}
if ( a . length ( ) < b . leng... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String s = " EQUAL " ; if ( a . length ( ) > b . length ( ) ) { System . out . println ( " GREATER " ) ; System . exit ( 0 ) ; } if ( a . length ( ) < b . length ( ) ) { System ... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
InputStream inputStream = System . in ;
OutputStream outputStream = System . out ;
InputReader in = new InputReader ( inputStream ) ;
PrintWriter out = new PrintWriter ( outputStream ) ;
Task solver = new Task ( ) ;
solver . solve ( 1 , in , out ) ;
out . clos... | public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; Task solver = new Task ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) throws Exception {
BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
BufferedWriter out = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ;
String a = input . readLine ( ) ;
String b = input . readLine ( ) ;
String ... | public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; BufferedWriter out = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; String a = input . readLine ( ) ; String b = input . readLine ( ) ; String s = null ;... | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (varia... |
public static void main ( String [ ] args ) {
String a = sc . next ( ) , b = sc . next ( ) ;
int comp = new BigInteger ( a ) . compareTo ( new BigInteger ( b ) ) ;
if ( comp < 0 ) {
System . out . println ( "LESS" ) ;
}
else if ( comp == 0 ) {
System . out . println ( "EQUAL" ) ;
}
else {
Syst... | public static void main ( String [ ] args ) { String a = sc . next ( ) , b = sc . next ( ) ; int comp = new BigInteger ( a ) . compareTo ( new BigInteger ( b ) ) ; if ( comp < 0 ) { System . out . println ( " LESS " ) ; } else if ( comp == 0 ) { System . out . println ( " EQUAL " ) ; } else { System . out . println ( "... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
MyScanner sc = new MyScanner ( ) ;
String a = sc . next ( ) ;
String b = sc . next ( ) ;
String ans ;
int la = a . length ( ) ;
int lb = b . length ( ) ;
if ( la > lb ) {
ans = "GREATER" ;
}
else if ( la < lb ) {
ans = "LESS" ;
}
else {
if ... | public static void main ( String [ ] args ) { MyScanner sc = new MyScanner ( ) ; String a = sc . next ( ) ; String b = sc . next ( ) ; String ans ; int la = a . length ( ) ; int lb = b . length ( ) ; if ( la > lb ) { ans = " GREATER " ; } else if ( la < lb ) { ans = " LESS " ; } else { if ( a . compareTo ( b ) < 0 ) { ... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
static int l_min ( int [ ] a ) {
Arrays . sort ( a ) ;
return a [ 0 ] ;
}
| static int l_min ( int [ ] a ) { Arrays . sort ( a ) ; return a [ 0 ] ; } | (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 (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (ar... |
static int l_max ( int [ ] a ) {
int l = a . length ;
Arrays . sort ( a ) ;
return a [ l - 1 ] ;
}
| static int l_max ( int [ ] a ) { int l = a . length ; Arrays . sort ( a ) ; return a [ l - 1 ] ; } | (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: (ident... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
int n = Integer . parseInt ( sc . next ( ) ) ;
String a [ ] = new String [ n ] ;
for ( int i = 0 ;
i < n ;
i ++ ) {
a [ i ] = sc . next ( ) ;
}
Set < String > set = new HashSet < > ( ) ;
for ( int i = 0 ;
i ... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = Integer . parseInt ( sc . next ( ) ) ; String a [ ] = new String [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . next ( ) ; } Set < String > set = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { set . add... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) throws IOException {
BufferedReader stdin = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
stdin . readLine ( ) ;
long cnt = Arrays . stream ( stdin . readLine ( ) . split ( " " ) ) . sorted ( ) . distinct ( ) . count ( ) ;
String ans = cnt == 3 ? "Thr... | public static void main ( String [ ] args ) throws IOException { BufferedReader stdin = new BufferedReader ( new InputStreamReader ( System . in ) ) ; stdin . readLine ( ) ; long cnt = Arrays . stream ( stdin . readLine ( ) . split ( " ▁ " ) ) . sorted ( ) . distinct ( ) . count ( ) ; String ans = cnt == 3 ? " Three " ... | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (varia... |
public static void main ( String [ ] args ) {
boolean P = false ;
boolean W = false ;
boolean G = false ;
boolean Y = false ;
int n = sc . nextInt ( ) ;
String s ;
for ( int i = 0 ;
i < n ;
i ++ ) {
s = sc . next ( ) ;
if ( s . equals ( "P" ) ) {
P = true ;
}
else if ( s . equals... | public static void main ( String [ ] args ) { boolean P = false ; boolean W = false ; boolean G = false ; boolean Y = false ; int n = sc . nextInt ( ) ; String s ; for ( int i = 0 ; i < n ; i ++ ) { s = sc . next ( ) ; if ( s . equals ( " P " ) ) { P = true ; } else if ( s . equals ( " W " ) ) { W = true ; } else if ( ... | (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 (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifi... |
public static void main ( String [ ] args ) {
Scanner reader = new Scanner ( System . in ) ;
int N = reader . nextInt ( ) ;
String ans = "Three" ;
for ( int i = 0 ;
i < N ;
i ++ ) {
char ch = reader . next ( ) . charAt ( 0 ) ;
if ( ch == 'Y' ) {
ans = "Four" ;
}
}
System . out . print ... | public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; int N = reader . nextInt ( ) ; String ans = " Three " ; for ( int i = 0 ; i < N ; i ++ ) { char ch = reader . next ( ) . charAt ( 0 ) ; if ( ch == ' Y ' ) { ans = " Four " ; } } System . out . print ( ans ) ; reader . close ( )... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) throws Exception {
BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
int n = Integer . parseInt ( input . readLine ( ) ) ;
StringTokenizer tokenizer = new StringTokenizer ( input . readLine ( ) ) ;
String [ ] charac = {
"P" , "W... | public static void main ( String [ ] args ) throws Exception { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int n = Integer . parseInt ( input . readLine ( ) ) ; StringTokenizer tokenizer = new StringTokenizer ( input . readLine ( ) ) ; String [ ] charac = { " P " , " W " , " G ... | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (varia... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
int n = sc . nextInt ( ) , m = sc . nextInt ( ) ;
Map < Integer , Integer > map = new HashMap < > ( ) ;
int [ ] sum = new int [ n + 1 ] ;
long ans = 0 ;
sum [ 0 ] = 0 ;
map . put ( 0 , 1 ) ;
for ( int i = 1 ;
i < ... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = sc . nextInt ( ) ; Map < Integer , Integer > map = new HashMap < > ( ) ; int [ ] sum = new int [ n + 1 ] ; long ans = 0 ; sum [ 0 ] = 0 ; map . put ( 0 , 1 ) ; for ( int i = 1 ; i < n + 1 ; i ++ ) { s... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
int n = sc . nextInt ( ) ;
int m = sc . nextInt ( ) ;
int [ ] a = new int [ n + 1 ] ;
for ( int i = 1 ;
i <= n ;
i ++ ) {
a [ i ] = sc . nextInt ( ) ;
}
long [ ] sum = new long [ n + 1 ] ;
for ( int i = 1 ;
... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int [ ] a = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } long [ ] sum = new long [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { sum [ ... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String ... args ) {
int N = IN . nextInt ( ) ;
int M = IN . nextInt ( ) ;
int [ ] A = new int [ N ] ;
for ( int i = 0 ;
i < N ;
i ++ ) {
A [ i ] = IN . nextInt ( ) ;
}
HashMap < Integer , Integer > B = new HashMap < > ( ) ;
B . put ( 0 , 1 ) ;
long ans = 0 ;
int tot =... | public static void main ( String ... args ) { int N = IN . nextInt ( ) ; int M = IN . nextInt ( ) ; int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { A [ i ] = IN . nextInt ( ) ; } HashMap < Integer , Integer > B = new HashMap < > ( ) ; B . put ( 0 , 1 ) ; long ans = 0 ; int tot = 0 ; for ( int a : A ) { t... | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (spread_parameter (type_identifier) (variable_declarator name: (identifier)))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation ... |
static < T > void puts ( T arg ) {
OUT . println ( arg ) ;
}
| static < T > void puts ( T arg ) { OUT . println ( arg ) ; } | (method_declaration (modifiers) type_parameters: (type_parameters (type_parameter (type_identifier))) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (expression_statement (method_invocation object: (identifier) name: (ident... |
static void flush ( ) {
OUT . flush ( ) ;
}
| static void flush ( ) { OUT . flush ( ) ; } | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
int n = sc . nextInt ( ) ;
long m = sc . nextLong ( ) ;
long [ ] a = new long [ n ] ;
HashMap < Long , Integer > map = new HashMap < > ( ) ;
long ans = 0 ;
a [ 0 ] = sc . nextLong ( ) ;
for ( int i = 1 ;
i < n ;
... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; long m = sc . nextLong ( ) ; long [ ] a = new long [ n ] ; HashMap < Long , Integer > map = new HashMap < > ( ) ; long ans = 0 ; a [ 0 ] = sc . nextLong ( ) ; for ( int i = 1 ; i < n ; i ++ ) { a [ i ] = ... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String args [ ] ) {
Scanner sc = new Scanner ( System . in ) ;
int N = Integer . parseInt ( sc . next ( ) ) ;
int M = Integer . parseInt ( sc . next ( ) ) ;
Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ;
long sum [ ] = new long [ N + 1 ] ;
int A [ ] = new i... | public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int N = Integer . parseInt ( sc . next ( ) ) ; int M = Integer . parseInt ( sc . next ( ) ) ; Map < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; long sum [ ] = new long [ N + 1 ] ; int A [ ] = new int [ N + 1 ]... | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_... |
public static void main ( String [ ] args ) {
Scanner scanner = new Scanner ( System . in ) ;
int total = scanner . nextInt ( ) ;
int sum = 0 ;
for ( int ix = 1 ;
ix <= total ;
ix ++ ) {
sum += ix ;
}
System . out . println ( sum ) ;
}
| public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int total = scanner . nextInt ( ) ; int sum = 0 ; for ( int ix = 1 ; ix <= total ; ix ++ ) { sum += ix ; } System . out . println ( sum ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
Scanner keyboard = new Scanner ( System . in ) ;
int N = keyboard . nextInt ( ) ;
int ame = 0 ;
for ( int i = 1 ;
i <= N ;
i ++ ) {
ame += i ;
}
System . out . println ( ame ) ;
keyboard . close ( ) ;
}
| public static void main ( String [ ] args ) { Scanner keyboard = new Scanner ( System . in ) ; int N = keyboard . nextInt ( ) ; int ame = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { ame += i ; } System . out . println ( ame ) ; keyboard . close ( ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) throws Exception {
Scanner sc = new Scanner ( System . in ) ;
int N = sc . nextInt ( ) ;
System . out . println ( N * ( 1 + N ) / 2 ) ;
}
| public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; System . out . println ( N * ( 1 + N ) / 2 ) ; } | (method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (varia... |
public static void main ( String [ ] args ) {
Main main = new Main ( ) ;
main . solve ( ) ;
}
| public static void main ( String [ ] args ) { Main main = new Main ( ) ; main . solve ( ) ; } | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
public static void main ( String [ ] args ) {
try ( Scanner scanner = new Scanner ( System . in ) ) {
int n = scanner . nextInt ( ) ;
System . out . println ( n * ( n + 1 ) / 2 ) ;
}
}
| public static void main ( String [ ] args ) { try ( Scanner scanner = new Scanner ( System . in ) ) { int n = scanner . nextInt ( ) ; System . out . println ( n * ( n + 1 ) / 2 ) ; } } | (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 (try_with_resources_statement resources: (resource_specification (resource type: (type_identifier... |
public static void main ( String [ ] args ) {
Scanner sc = new Scanner ( System . in ) ;
int N = sc . nextInt ( ) ;
int [ ] p = {
2 , 3 , 5 , 7 , 11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 , 41 , 43 , 47 , 53 , 59 , 61 , 67 , 71 , 73 , 79 , 83 , 89 , 97 };
int [ ] pTotal = new int [ p . length ] ;
for ( in... | public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; int [ ] p = { 2 , 3 , 5 , 7 , 11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 , 41 , 43 , 47 , 53 , 59 , 61 , 67 , 71 , 73 , 79 , 83 , 89 , 97 } ; int [ ] pTotal = new int [ p . length ] ; for ( int i = 0 ; i < p .... | (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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (ident... |
static int legendre ( int n , int p ) {
int c = 0 ;
int m = p ;
while ( m <= n ) {
c += n / m ;
m *= p ;
}
return c ;
}
| static int legendre ( int n , int p ) { int c = 0 ; int m = p ; while ( m <= n ) { c += n / m ; m *= p ; } return c ; } | (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... |
static void primeFactor ( int n ) {
int a = 2 ;
while ( a * a <= n ) {
if ( n % a == 0 ) {
pf . merge ( a , 1 , Integer :: sum ) ;
n = n / a ;
}
else {
a ++ ;
}
}
pf . merge ( n , 1 , Integer :: sum ) ;
}
| static void primeFactor ( int n ) { int a = 2 ; while ( a * a <= n ) { if ( n % a == 0 ) { pf . merge ( a , 1 , Integer :: sum ) ; n = n / a ; } else { a ++ ; } } pf . merge ( n , 1 , Integer :: sum ) ; } | (method_declaration (modifiers) type: (void_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_st... |
static int f ( int x ) {
int cnt = 0 ;
for ( Integer i : pf . values ( ) ) if ( x - 1 <= i ) cnt ++ ;
return cnt ++ ;
}
| static int f ( int x ) { int cnt = 0 ; for ( Integer i : pf . values ( ) ) if ( x - 1 <= i ) cnt ++ ; return cnt ++ ; } | (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))) (enha... |
End of preview. Expand in Data Studio
There is no difference between 'train' and 'test', these are just used thus the csv file can be detected by huggingface. max_java_exp_len=1784 max_python_exp_len=1469
- Downloads last month
- 21