index
int64
0
0
repo_id
stringlengths
9
205
file_path
stringlengths
31
246
content
stringlengths
1
12.2M
__index_level_0__
int64
0
10k
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DYNAMIC_PROGRAMMING_SET_8_MATRIX_CHAIN_MULTIPLICATION_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DYNAMIC_PROGRAMMING_SET_8_MATRIX_CHAIN_MULTIPLICATION_1{ static int f_gold ( int p [ ] , int n ) { int m [ ] [ ] = new int [ n ] [ n ] ; int i , j , k , L , q ; for ( i = 1 ; i < n ; i ++ ) m [ i ] [ i ] = 0 ; for ( L = 2 ; L < n ; L ++ ) { for ( i = 1 ; i < n - L + 1 ; i ++ ) { j = i + L - 1 ; if ( j == n ) continue ; m [ i ] [ j ] = Integer . MAX_VALUE ; for ( k = i ; k <= j - 1 ; k ++ ) { q = m [ i ] [ k ] + m [ k + 1 ] [ j ] + p [ i - 1 ] * p [ k ] * p [ j ] ; if ( q < m [ i ] [ j ] ) m [ i ] [ j ] = q ; } } } return m [ 1 ] [ n - 1 ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,4,11,17,26,33,37,51,62,70,71,73,74,74,81,82,83,90,95,98,98}); param0.add(new int[]{-50,74,-8,2,-24,28,-86,34,-36,92,-70,-98}); param0.add(new int[]{0,0,0,1,1,1,1}); param0.add(new int[]{4,73,3,88,79,40,25,58,39,53,32,20,95,60,60,98,23,95,42,26,95,14,43,97,30,83,29,37,74,72,37,31,32,83,57,40,56,95,8,79,67,62}); param0.add(new int[]{-92,-88,-88,-88,-86,-84,-80,-78,-76,-74,-72,-68,-68,-66,-62,-42,-34,-30,-28,-24,-20,-14,-12,-10,-8,-8,-8,6,10,26,26,36,38,42,46,48,48,54,54,58,60,66,70,76,78,80,82,98}); param0.add(new int[]{1,1,0,1,0,0,1}); param0.add(new int[]{8,25,38,39,41,57,71,89}); param0.add(new int[]{76,-28,20,62,-44,8,-46,52,26,76,22,38,-36,10,2,-86,42,-62,-68,-56,10}); param0.add(new int[]{0,0,0,0,1,1,1}); param0.add(new int[]{98,96,76,76,8,4,53,34,54,10,98,46,58,7,36,72,32,59,52,99,40,52,50,43,26,93,76,90,12,82,31,50,55,34,61,78}); List<Integer> param1 = new ArrayList<>(); param1.add(20); param1.add(10); param1.add(3); param1.add(41); param1.add(47); param1.add(4); param1.add(6); param1.add(18); param1.add(5); param1.add(26); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,400
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_EQUAL_POINT_STRING_BRACKETS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_EQUAL_POINT_STRING_BRACKETS{ static int f_gold ( String str ) { int len = str . length ( ) ; int open [ ] = new int [ len + 1 ] ; int close [ ] = new int [ len + 1 ] ; int index = - 1 ; open [ 0 ] = 0 ; close [ len ] = 0 ; if ( str . charAt ( 0 ) == '(' ) open [ 1 ] = 1 ; if ( str . charAt ( len - 1 ) == ')' ) close [ len - 1 ] = 1 ; for ( int i = 1 ; i < len ; i ++ ) { if ( str . charAt ( i ) == '(' ) open [ i + 1 ] = open [ i ] + 1 ; else open [ i + 1 ] = open [ i ] ; } for ( int i = len - 2 ; i >= 0 ; i -- ) { if ( str . charAt ( i ) == ')' ) close [ i ] = close [ i + 1 ] + 1 ; else close [ i ] = close [ i + 1 ] ; } if ( open [ len ] == 0 ) return len ; if ( close [ 0 ] == 0 ) return 0 ; for ( int i = 0 ; i <= len ; i ++ ) if ( open [ i ] == close [ i ] ) index = i ; return index ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("(())))("); param0.add("))"); param0.add("(("); param0.add("))(()(()()("); param0.add(")((()(()"); param0.add("))(()"); param0.add("()))"); param0.add("()"); param0.add("1100110"); param0.add("dhfSnebD"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,401
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CIRCLE_LATTICE_POINTS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CIRCLE_LATTICE_POINTS{ static int f_gold ( int r ) { if ( r <= 0 ) return 0 ; int result = 4 ; for ( int x = 1 ; x < r ; x ++ ) { int ySquare = r * r - x * x ; int y = ( int ) Math . sqrt ( ySquare ) ; if ( y * y == ySquare ) result += 4 ; } return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(34); param0.add(56); param0.add(90); param0.add(47); param0.add(36); param0.add(63); param0.add(21); param0.add(76); param0.add(18); param0.add(75); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,402
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/LARGEST_SUBARRAY_WITH_EQUAL_NUMBER_OF_0S_AND_1S_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LARGEST_SUBARRAY_WITH_EQUAL_NUMBER_OF_0S_AND_1S_1{ static int f_gold ( int arr [ ] , int n ) { HashMap < Integer , Integer > hM = new HashMap < Integer , Integer > ( ) ; int sum = 0 ; int max_len = 0 ; int ending_index = - 1 ; int start_index = 0 ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = ( arr [ i ] == 0 ) ? - 1 : 1 ; } for ( int i = 0 ; i < n ; i ++ ) { sum += arr [ i ] ; if ( sum == 0 ) { max_len = i + 1 ; ending_index = i ; } if ( hM . containsKey ( sum + n ) ) { if ( max_len < i - hM . get ( sum + n ) ) { max_len = i - hM . get ( sum + n ) ; ending_index = i ; } } else hM . put ( sum + n , i ) ; } for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = ( arr [ i ] == - 1 ) ? 0 : 1 ; } int end = ending_index - max_len + 1 ; System . out . println ( end + " to " + ending_index ) ; return max_len ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,6,16,16,18,19,22,39,40,42,60,66,69,70,70,73,74,80,99}); param0.add(new int[]{-88,-66}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{85,98,67,27,98,13,96,32,26,44,32}); param0.add(new int[]{-96,-94,-90,-88,-86,-66,-64,-52,-46,-46,-42,-40,-38,-32,-28,-22,-16,-10,-8,-8,-4,2,10,26,26,28,28,40,40,42,50,60,66,68,72,74,86,92,94}); param0.add(new int[]{1,1,1,1,1,1,0,0,0}); param0.add(new int[]{25,64,86}); param0.add(new int[]{-4,78,-76,12,4,-38,-98,-26,-8,-98,56,0,-34,36,-90,-36,54,-68,12,-44,62,60,-34,-52,18}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{2,25,45,98,71,8,58,94,53}); List<Integer> param1 = new ArrayList<>(); param1.add(9); param1.add(1); param1.add(19); param1.add(8); param1.add(34); param1.add(4); param1.add(1); param1.add(17); param1.add(9); param1.add(8); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,403
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_AVERAGE_SUM_PARTITION_ARRAY.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_AVERAGE_SUM_PARTITION_ARRAY{ static double f_gold ( int [ ] A , int K ) { int n = A . length ; double [ ] pre_sum = new double [ n + 1 ] ; pre_sum [ 0 ] = 0 ; for ( int i = 0 ; i < n ; i ++ ) pre_sum [ i + 1 ] = pre_sum [ i ] + A [ i ] ; double [ ] dp = new double [ n ] ; double sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) dp [ i ] = ( pre_sum [ n ] - pre_sum [ i ] ) / ( n - i ) ; for ( int k = 0 ; k < K - 1 ; k ++ ) for ( int i = 0 ; i < n ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) dp [ i ] = Math . max ( dp [ i ] , ( pre_sum [ j ] - pre_sum [ i ] ) / ( j - i ) + dp [ j ] ) ; return dp [ 0 ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,11,14,27,32,37,39,49,52,53,57,62,67,67,68,69,76,77,78,81,85,85,87,91,91,91,99,99,99}); param0.add(new int[]{80,12,32,44,24,82,-40,42,26,36,58,52,-34,44,12,-18,-72,52,2,-8,22,-18,98,-60,62,92,-46,20,20,-46,52,94,0,-28,-22,80,26,-92,-50,48,-80}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{32,16,67,53,99,56,80,92,84,21,36,46,94,31,63,67,59,88,41,17,74,47,95,12,27,99,32,4,82,31,65,40,93,72,23,33,93,9,62,47}); param0.add(new int[]{-92,-86,-80,-78,-72,-70,-70,-68,-66,-62,-60,-54,-54,-52,-52,-40,-36,-32,-28,-26,-22,-22,-20,-16,-16,-8,0,6,8,10,14,18,20,42,46,52,60,66,68,70,74,86,88,88,92,94,98}); param0.add(new int[]{1,0,0,0,1,0,1,1,0,1,0,1,1,1,1,0,1,0,0}); param0.add(new int[]{1,1,3,3,6,7,10,11,12,13,16,16,22,23,24,27,28,30,30,30,31,33,35,35,39,40,41,52,52,58,59,60,61,61,66,66,71,73,74,75,75,76,80,83,85,95,96,97,97}); param0.add(new int[]{28,-52,48,96,54,94,60,18}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{26,80,12,87,90,98,46,91,38,46,20,64,53,4,60,87,44,88,22,30}); List<Integer> param1 = new ArrayList<>(); param1.add(24); param1.add(26); param1.add(15); param1.add(36); param1.add(36); param1.add(16); param1.add(34); param1.add(7); param1.add(31); param1.add(19); for(int i = 0; i < param0.size(); ++i) { if(Math.abs(1 - (0.0000001 + Math.abs(f_gold(param0.get(i),param1.get(i))) )/ (Math.abs(f_filled(param0.get(i),param1.get(i))) + 0.0000001)) < 0.001) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,404
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FRIENDS_PAIRING_PROBLEM_2.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FRIENDS_PAIRING_PROBLEM_2{ static int f_gold ( int n ) { int a = 1 , b = 2 , c = 0 ; if ( n <= 2 ) { return n ; } for ( int i = 3 ; i <= n ; i ++ ) { c = b + ( i - 1 ) * a ; a = b ; b = c ; } return c ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(24); param0.add(1); param0.add(91); param0.add(90); param0.add(89); param0.add(29); param0.add(3); param0.add(60); param0.add(75); param0.add(14); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,405
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_OPERATIONS_MAKE_GCD_ARRAY_MULTIPLE_K.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_OPERATIONS_MAKE_GCD_ARRAY_MULTIPLE_K{ static int f_gold ( int a [ ] , int n , int k ) { int result = 0 ; for ( int i = 0 ; i < n ; ++ i ) { if ( a [ i ] != 1 && a [ i ] > k ) { result = result + Math . min ( a [ i ] % k , k - a [ i ] % k ) ; } else { result = result + k - a [ i ] ; } } return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,7,27,32,36,37,44,48,50,64,86}); param0.add(new int[]{-22,6,-20,60,-74,98,52,-22}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{77,11,51,11,84,79,43,12,14,50,15,6,85,32,74,49,7,2,58}); param0.add(new int[]{-90,-66,-64,-58,-46,-44,-32,-30,-30,-22,-18,-14,12,12,18,34,44,60,70,70,74,76,86,98,98}); param0.add(new int[]{1,1,0,0,0,0,1,0,0,1,1,1,0,1,1,1,0,0,0,1,1,1,1,0,1,0,1,1,1,1,1,0,0,0,0,1,1}); param0.add(new int[]{9,22,27,27,37,53,53,56,63,73,76,81,82}); param0.add(new int[]{-46,60,80,80,42,-98,30,-48,4,-32,-78,40,52,26,88,4,22,62,88,-94,2,0,58,38,52,-50,-52,58,-62,30,-38,-8,-82,-66}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{42,69,93,82,8,23,73,1,77,39,49,4,95,85}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(5); param1.add(23); param1.add(9); param1.add(12); param1.add(36); param1.add(10); param1.add(18); param1.add(19); param1.add(12); List<Integer> param2 = new ArrayList<>(); param2.add(10); param2.add(4); param2.add(29); param2.add(17); param2.add(22); param2.add(31); param2.add(11); param2.add(19); param2.add(22); param2.add(13); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,406
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_PRODUCT_K_INTEGERS_ARRAY_POSITIVE_INTEGERS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_PRODUCT_K_INTEGERS_ARRAY_POSITIVE_INTEGERS{ public static int f_gold ( int [ ] arr , int n , int k ) { PriorityQueue < Integer > pq = new PriorityQueue < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) pq . add ( arr [ i ] ) ; int count = 0 , ans = 1 ; while ( pq . isEmpty ( ) == false && count < k ) { ans = ans * pq . element ( ) ; pq . remove ( ) ; count ++ ; } return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{57,66,91}); param0.add(new int[]{-44,86,28,-70,-12,96,-10,74,-50,-52,-6,64,-62,92,-24,90,-26,-4,-92,-24,-84,76,-92,62,-62,-86,-86,-14,50,30,62,2,-88,-78,-48}); param0.add(new int[]{0,0,1,1}); param0.add(new int[]{99,85,37,27,55,20,76,38,33,78,24,80,74,42,15,16,97,51,71,92,18,63,47,10,6,72,40,21,14,68,98,49,48,64,50,66,44,1,26,55,61,43,9,16,8,42,51,98,1}); param0.add(new int[]{-58,-12,16,18,24}); param0.add(new int[]{0,0,1,0,0,1,0,1,0,0,0,0,0,1,1,1}); param0.add(new int[]{5,10,13,14,19,21,22,25,28,36,39,44,46,53,54,55,55,67,73,75,77,78,80,84,91,94,96}); param0.add(new int[]{18,-44,46,64,86,-36,8,-10,-50,-98,-6,-38,-34,14,-34,86,58,-30,76,6,38,98,78,56,-56,-66,-58,62,92,-94}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{69,74,28,75,84,52,5,19,80,12,76,14,28,63,30,29,16,74,28,48,97,77,62,19,67,26,14,44,52,86,9,31,41,14,66,27,36,98,48,37,2,12,2}); List<Integer> param1 = new ArrayList<>(); param1.add(2); param1.add(29); param1.add(3); param1.add(36); param1.add(2); param1.add(8); param1.add(23); param1.add(23); param1.add(13); param1.add(27); List<Integer> param2 = new ArrayList<>(); param2.add(2); param2.add(21); param2.add(3); param2.add(47); param2.add(3); param2.add(15); param2.add(23); param2.add(20); param2.add(17); param2.add(23); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,407
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_PALINDROME_SUB_STRINGS_STRING.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_PALINDROME_SUB_STRINGS_STRING{ static int f_gold ( char str [ ] , int n ) { int dp [ ] [ ] = new int [ n ] [ n ] ; boolean P [ ] [ ] = new boolean [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) P [ i ] [ i ] = true ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( str [ i ] == str [ i + 1 ] ) { P [ i ] [ i + 1 ] = true ; dp [ i ] [ i + 1 ] = 1 ; } } for ( int gap = 2 ; gap < n ; gap ++ ) { for ( int i = 0 ; i < n - gap ; i ++ ) { int j = gap + i ; if ( str [ i ] == str [ j ] && P [ i + 1 ] [ j - 1 ] ) P [ i ] [ j ] = true ; if ( P [ i ] [ j ] == true ) dp [ i ] [ j ] = dp [ i ] [ j - 1 ] + dp [ i + 1 ] [ j ] + 1 - dp [ i + 1 ] [ j - 1 ] ; else dp [ i ] [ j ] = dp [ i ] [ j - 1 ] + dp [ i + 1 ] [ j ] - dp [ i + 1 ] [ j - 1 ] ; } } return dp [ 0 ] [ n - 1 ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<char [ ]> param0 = new ArrayList<>(); param0.add(new char[]{'E','E','J','P','T','U','X','Y','Z','e','f','h','l','m','n','o','z'}); param0.add(new char[]{'8','7','3','4','9','5','3','1','4','0','6','8','2','5','8','3','5','2','8','6','6','3','5','7','5','5','3','7'}); param0.add(new char[]{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1'}); param0.add(new char[]{'f','E','e','z','B','o','i','v','K','u','P','C','z','f','k','J','t','R','t','A','f','G','D','X','H','e','p','l','l','k','Z','Y','u','g','H','C','f','J','H','W'}); param0.add(new char[]{'0','0','0','1','1','1','1','1','1','2','2','2','3','3','3','3','3','4','4','4','4','4','4','5','5','5','5','6','6','7','7','9','9','9','9','9','9'}); param0.add(new char[]{'1','0','1','1','0','0','1','1','1','0','1','0','1','1','0','1','0','1','1','1','1','1','0','1','1','0','1','0','1','1','0','0','1','0','1','0','0','0','0','0','1','1','0','1','0','1'}); param0.add(new char[]{'C','C','D','F','L','M','P','X','a','f','i','j','w'}); param0.add(new char[]{'7','9','0','2','8','0','7','5','9','4','5','4','8','1','9','5','3','2','4','1','2'}); param0.add(new char[]{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1'}); param0.add(new char[]{'m','X','N','M'}); List<Integer> param1 = new ArrayList<>(); param1.add(11); param1.add(27); param1.add(23); param1.add(27); param1.add(35); param1.add(43); param1.add(9); param1.add(16); param1.add(32); param1.add(3); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,408
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MIDDLE_OF_THREE_USING_MINIMUM_COMPARISONS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MIDDLE_OF_THREE_USING_MINIMUM_COMPARISONS{ public static int f_gold ( int a , int b , int c ) { if ( ( a < b && b < c ) || ( c < b && b < a ) ) return b ; else if ( ( b < a && a < c ) || ( c < a && a < b ) ) return a ; else return c ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(56); param0.add(56); param0.add(36); param0.add(71); param0.add(3); param0.add(84); param0.add(30); param0.add(82); param0.add(90); param0.add(38); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(60); param1.add(56); param1.add(54); param1.add(70); param1.add(57); param1.add(80); param1.add(54); param1.add(70); param1.add(4); List<Integer> param2 = new ArrayList<>(); param2.add(82); param2.add(17); param2.add(51); param2.add(6); param2.add(81); param2.add(47); param2.add(85); param2.add(32); param2.add(55); param2.add(5); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,409
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SWAP_TWO_NIBBLES_BYTE.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SWAP_TWO_NIBBLES_BYTE{ static int f_gold ( int x ) { return ( ( x & 0x0F ) << 4 | ( x & 0xF0 ) >> 4 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(57); param0.add(99); param0.add(66); param0.add(97); param0.add(95); param0.add(42); param0.add(95); param0.add(89); param0.add(3); param0.add(84); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,410
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_MATRIX_ELEMENT_ELEMENT_INTEGER_DIVISION_ROW_COLUMN_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_MATRIX_ELEMENT_ELEMENT_INTEGER_DIVISION_ROW_COLUMN_1{ static int f_gold ( int n ) { int ans = 0 , temp = 0 , num ; for ( int i = 1 ; i <= n && temp < n ; i ++ ) { temp = i - 1 ; num = 1 ; while ( temp < n ) { if ( temp + i <= n ) ans += ( i * num ) ; else ans += ( ( n - temp ) * num ) ; temp += i ; num ++ ; } } return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(35); param0.add(93); param0.add(7); param0.add(81); param0.add(80); param0.add(47); param0.add(7); param0.add(41); param0.add(59); param0.add(34); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,411
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_FIBONACCI_NUMBERS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_FIBONACCI_NUMBERS{ static int f_gold ( int n ) { if ( n <= 0 ) return 0 ; int fibo [ ] = new int [ n + 1 ] ; fibo [ 0 ] = 0 ; fibo [ 1 ] = 1 ; int sum = fibo [ 0 ] + fibo [ 1 ] ; for ( int i = 2 ; i <= n ; i ++ ) { fibo [ i ] = fibo [ i - 1 ] + fibo [ i - 2 ] ; sum += fibo [ i ] ; } return sum ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(9); param0.add(50); param0.add(7); param0.add(21); param0.add(21); param0.add(91); param0.add(11); param0.add(25); param0.add(62); param0.add(4); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,412
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/LONGEST_COMMON_INCREASING_SUBSEQUENCE_LCS_LIS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LONGEST_COMMON_INCREASING_SUBSEQUENCE_LCS_LIS{ static int f_gold ( int arr1 [ ] , int n , int arr2 [ ] , int m ) { int table [ ] = new int [ m ] ; for ( int j = 0 ; j < m ; j ++ ) table [ j ] = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int current = 0 ; for ( int j = 0 ; j < m ; j ++ ) { if ( arr1 [ i ] == arr2 [ j ] ) if ( current + 1 > table [ j ] ) table [ j ] = current + 1 ; if ( arr1 [ i ] > arr2 [ j ] ) if ( table [ j ] > current ) current = table [ j ] ; } } int result = 0 ; for ( int i = 0 ; i < m ; i ++ ) if ( table [ i ] > result ) result = table [ i ] ; return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,7,9,35,43,51,51,66,88}); param0.add(new int[]{-52,52,-92,-46,-94,30,-36,18,-98,22,-36,96,-88,-50,50}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{5,74,29}); param0.add(new int[]{-84,-74,-70,-62,-56,-56,-52,-2,6,24,28,44,44,52}); param0.add(new int[]{0,0,0,1,0,1,0,0,1,1,1,1,0,0,1,0,1,0,1,1,0,0,1,0,1,1,0,0,1,0}); param0.add(new int[]{3,4,4,7,15,15,16,22,32,32,37,39,39,41,43,46,47,47,49,75,79,80,86,88,93}); param0.add(new int[]{70,-64,0,52,32,-98,38,-8,34,70,98,58,-48,-60,-28,-22,-72,82,-98,-36}); param0.add(new int[]{0,0,1,1,1,1,1,1}); param0.add(new int[]{46,87,98}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(7); param1.add(36); param1.add(1); param1.add(8); param1.add(17); param1.add(19); param1.add(16); param1.add(7); param1.add(2); List<int [ ]> param2 = new ArrayList<>(); param2.add(new int[]{10,21,38,50,65,67,87,93,99}); param2.add(new int[]{-58,40,56,-62,-92,-94,40,18,-2,-76,-78,-14,44,84,4}); param2.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param2.add(new int[]{57,33,48}); param2.add(new int[]{-98,-96,-88,-66,-32,-26,-24,-20,-4,20,48,74,90,96}); param2.add(new int[]{1,0,1,1,0,0,0,0,1,1,1,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,0}); param2.add(new int[]{9,12,15,20,22,27,28,28,30,31,35,39,47,58,58,60,73,74,76,78,80,86,95,96,98}); param2.add(new int[]{-18,88,-40,-52,30,-10,-18,-56,84,-22,-64,80,-14,-64,40,92,48,-8,24,82}); param2.add(new int[]{0,1,1,1,1,1,1,1}); param2.add(new int[]{67,31,54}); List<Integer> param3 = new ArrayList<>(); param3.add(8); param3.add(10); param3.add(22); param3.add(1); param3.add(12); param3.add(15); param3.add(14); param3.add(12); param3.add(7); param3.add(2); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,413
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_SUBSETS_DISTINCT_EVEN_NUMBERS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_SUBSETS_DISTINCT_EVEN_NUMBERS{ static int f_gold ( int arr [ ] , int n ) { HashSet < Integer > us = new HashSet < > ( ) ; int even_count = 0 ; for ( int i = 0 ; i < n ; i ++ ) if ( arr [ i ] % 2 == 0 ) us . add ( arr [ i ] ) ; even_count = us . size ( ) ; return ( int ) ( Math . pow ( 2 , even_count ) - 1 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,8,14,22,24,24,26,32,33,46,50,51,51,52,53,71,76,93}); param0.add(new int[]{-62,30,12,30,22,6,-42,80,-62,34,32,-72,-6,-16,42,82,-78,-20,-96,44,-24,-50,-50,-94,72,-90,38,84,-86,-24,-62,86,94,6,90,12,-36,0,44,4,-78,-86,-12,-18,26,32,90,76}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{70,55,67,9,78,57,31,25}); param0.add(new int[]{-98,-90,-80,-80,-68,-68,-50,-44,-38,-34,-18,-16,-10,-8,14,14,16,24,26,28,30,40,44,46,52,54,58,66,74,74,74,76,80,86,94,96}); param0.add(new int[]{0,1,1,0,1,0,0,1,0,0,1,1,1,1,0,0,0,0,0,1}); param0.add(new int[]{7,10,11,13,14,16,20,26,30,31,33,33,35,39,42,50,51,52,55,57,58,59,62,63,63,65,67,67,68,69,69,71,73,73,74,76,82,86,87,87,87,88,94,99}); param0.add(new int[]{-6,8,-14,2,-36,-44,-50,-4,-4,-22,94,-94,-62,4,-84,-82,88,84,28,76,-84,-72,14,-28,96,18,-56,-96,2,-66,62,-78,88,34,0,-48,-76,-84,-2,-98,58,38,56}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{75,92,42,5,53,78,42,97,99,56,23,16,90,1,79,49,63,95,12,21,82,31,10,35,34,80,22,73,68,68,48,11,15,60,24,57,74,18,30,57,66,97,78,65,79}); List<Integer> param1 = new ArrayList<>(); param1.add(16); param1.add(47); param1.add(32); param1.add(6); param1.add(30); param1.add(11); param1.add(39); param1.add(23); param1.add(17); param1.add(29); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,414
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_ROTATION_COUNT_ROTATED_SORTED_ARRAY_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_ROTATION_COUNT_ROTATED_SORTED_ARRAY_1{ static int f_gold ( int arr [ ] , int low , int high ) { if ( high < low ) return 0 ; if ( high == low ) return low ; int mid = low + ( high - low ) / 2 ; if ( mid < high && arr [ mid + 1 ] < arr [ mid ] ) return ( mid + 1 ) ; if ( mid > low && arr [ mid ] < arr [ mid - 1 ] ) return mid ; if ( arr [ high ] > arr [ mid ] ) return f_gold ( arr , low , mid - 1 ) ; return f_gold ( arr , mid + 1 , high ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,16,38,39,48,74,79}); param0.add(new int[]{-46,72,72,-66,96,92,40,8,94,-84,6,-90,38,-6,48,-20,-86,-76,88,-50,-44,-14,54,-6,-2,72,8,-64,-46,44,-88,50,86,38,42,-56}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{48,74,59,57,95,11,25,61,46,54,34,84,7,97,62,57,99,93,76,5,76,93,35,84,37,60,65,16,30,73,42,61,74,77,48,62,84,93,64,57,68,46,28,77}); param0.add(new int[]{-72,-68,-66,-66,-62,-62,-52,-48,-42,-42,-42,-38,-30,-22,-20,-20,-16,-16,-14,0,2,2,2,4,12,20,22,26,32,34,46,46,64,64,64,66,68,68,68,74,80,84,84,88,88,90,96,98}); param0.add(new int[]{1}); param0.add(new int[]{7,11,20,21,22,27,30,30,34,35,36,37,38,60,61,63,63,69,70,75,80,84,88,97}); param0.add(new int[]{-2,70,-40}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{71,71,27,10,97,43,55,71,6,6,77,48,77,2,83,51,61,19,2,51,26,70,20,23,54,15,6,92,35,75,8,57,50,49,88,21,36}); List<Integer> param1 = new ArrayList<>(); param1.add(6); param1.add(32); param1.add(16); param1.add(24); param1.add(29); param1.add(0); param1.add(23); param1.add(2); param1.add(30); param1.add(24); List<Integer> param2 = new ArrayList<>(); param2.add(6); param2.add(21); param2.add(29); param2.add(26); param2.add(43); param2.add(0); param2.add(22); param2.add(1); param2.add(17); param2.add(22); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,415
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/LENGTH_OF_THE_LONGEST_ARITHMATIC_PROGRESSION_IN_A_SORTED_ARRAY.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LENGTH_OF_THE_LONGEST_ARITHMATIC_PROGRESSION_IN_A_SORTED_ARRAY{ static int f_gold ( int set [ ] , int n ) { if ( n <= 2 ) return n ; int L [ ] [ ] = new int [ n ] [ n ] ; int llap = 2 ; for ( int i = 0 ; i < n ; i ++ ) L [ i ] [ n - 1 ] = 2 ; for ( int j = n - 2 ; j >= 1 ; j -- ) { int i = j - 1 , k = j + 1 ; while ( i >= 0 && k <= n - 1 ) { if ( set [ i ] + set [ k ] < 2 * set [ j ] ) k ++ ; else if ( set [ i ] + set [ k ] > 2 * set [ j ] ) { L [ i ] [ j ] = 2 ; i -- ; } else { L [ i ] [ j ] = L [ j ] [ k ] + 1 ; llap = Math . max ( llap , L [ i ] [ j ] ) ; i -- ; k ++ ; } } while ( i >= 0 ) { L [ i ] [ j ] = 2 ; i -- ; } } return llap ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,4,4,7,8,19,21,22,25,27,28,29,38,40,41,42,43,46,50,50,53,53,54,55,60,64,64,69,70,75,77,81,81,82,86,87,87,88,91,94,97}); param0.add(new int[]{40,-6,50,-18,42,78,38,-90,-44,-42,-86,78,-68,2,-32,-20,-44,54,80,54,70,26,82,-14,-74,-20,74,82}); param0.add(new int[]{0,0,0,0,1,1,1}); param0.add(new int[]{76,80}); param0.add(new int[]{-92,-90,-88,-76,-76,-60,-46,-40,-24,-8,-8,-6,2,12,36,38,58,76,80}); param0.add(new int[]{1,1,1,0,0,0,0,1,1,1,0,0,0,1,0,1,1}); param0.add(new int[]{5,8,11,27,27,32,32,37,50,51,55,61,62,68,73,83}); param0.add(new int[]{52,-74,-32,-64,-52,-60,-70,36,70,40,40,-18,90,-70,-82,-64,-8,-6,36,4,-58,62,-96,78,36,90,-70,-6,-84,24,84,32,-90,36,70,-60,-56,78,48,34,-16,80,82,58,14,-6,-8,76}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{11,21,76,45,8,49,97,66,17,11,87,4,34,89,79,88,6,91,19,56,91,25,17,90,26,59,34,32,43,17,98,39,72,78,93,43}); List<Integer> param1 = new ArrayList<>(); param1.add(27); param1.add(21); param1.add(5); param1.add(1); param1.add(13); param1.add(15); param1.add(8); param1.add(29); param1.add(27); param1.add(26); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,416
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_UNIT_DIGIT_X_RAISED_POWER_Y.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_UNIT_DIGIT_X_RAISED_POWER_Y{ static int f_gold ( int x , int y ) { int res = 1 ; for ( int i = 0 ; i < y ; i ++ ) res = ( res * x ) % 10 ; return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(33); param0.add(95); param0.add(21); param0.add(3); param0.add(40); param0.add(64); param0.add(17); param0.add(58); param0.add(44); param0.add(27); List<Integer> param1 = new ArrayList<>(); param1.add(55); param1.add(7); param1.add(63); param1.add(62); param1.add(53); param1.add(24); param1.add(23); param1.add(74); param1.add(13); param1.add(54); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,417
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_THE_ELEMENT_THAT_APPEARS_ONCE_2.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_THE_ELEMENT_THAT_APPEARS_ONCE_2{ static int f_gold ( int a [ ] , int n ) { HashSet < Integer > s = new HashSet < Integer > ( ) ; for ( int i : a ) { s . add ( i ) ; } int arr_sum = 0 ; for ( int i : a ) { arr_sum += i ; } int set_sum = 0 ; for ( int i : s ) { set_sum += i ; } return ( 3 * set_sum - arr_sum ) / 2 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,3,3,12,16,28,31,44,48,57,59,60,68,69,70,70,72,73,76,78,78,79,84,86,93,96}); param0.add(new int[]{-2,-62,8,-96,-50,-70,-48,-20,76,-54,-62,8,30,-68,-64,-94,-10,-78,-68,-98,0,30,62,-40,-36,90,-46,38,28,-86,-20,12,56,-50,82,-18,-28,-62,88,-58}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{85,33,83,92,40,53,18,39,17,71,15,85,44,12,56,77,54,87,11,74,11,9,73,72,64,98,18,13,74,64,59,44,95,56,6,96,47,36,35,51,30,39,91,74,68}); param0.add(new int[]{-94,-90,-82,-80,-74,-40,-40,-38,-36,-28,-26,-20,-16,-14,-14,-10,-8,-8,10,14,18,22,22,28,28,30,74,82}); param0.add(new int[]{1,1,1,1,1,0,1,0,1,1,0,0,0,0,1,0,1,1,1,0,1,0,0,1,0,0,1,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{2,6,6,12,13,13,15,16,24,25,29,36,42,44,47,47,47,48,51,51,55,55,55,58,58,60,61,62,62,64,66,70,70,75,76,77,78,78,79,80,80,82,83,83,84,85,90,99}); param0.add(new int[]{-94,50,-86,-94,92,-50,74,-54,54,-20,-28,-44,-94,-80,-12,-38,64,-22,38,70,-4,62,66,88,-94,72,88,32,-80,60,-70,-74,-66,82,82}); param0.add(new int[]{0,0,0,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{62,29,76,58,16,7,83,45,17,67,88,78,6,36,33,99,39,59,77,64,32,20,10,92,3,20,7,14,11,28}); List<Integer> param1 = new ArrayList<>(); param1.add(14); param1.add(26); param1.add(18); param1.add(35); param1.add(27); param1.add(35); param1.add(42); param1.add(34); param1.add(7); param1.add(26); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,418
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NUMBER_RECTANGLES_NM_GRID.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_RECTANGLES_NM_GRID{ public static long f_gold ( int n , int m ) { return ( m * n * ( n + 1 ) * ( m + 1 ) ) / 4 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(86); param0.add(33); param0.add(3); param0.add(91); param0.add(33); param0.add(13); param0.add(75); param0.add(58); param0.add(50); param0.add(4); List<Integer> param1 = new ArrayList<>(); param1.add(70); param1.add(65); param1.add(5); param1.add(12); param1.add(27); param1.add(75); param1.add(36); param1.add(64); param1.add(51); param1.add(44); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,419
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COIN_GAME_WINNER_EVERY_PLAYER_THREE_CHOICES.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COIN_GAME_WINNER_EVERY_PLAYER_THREE_CHOICES{ static boolean f_gold ( int x , int y , int n ) { boolean [ ] dp = new boolean [ n + 1 ] ; Arrays . fill ( dp , false ) ; dp [ 0 ] = false ; dp [ 1 ] = true ; for ( int i = 2 ; i <= n ; i ++ ) { if ( i - 1 >= 0 && dp [ i - 1 ] == false ) dp [ i ] = true ; else if ( i - x >= 0 && dp [ i - x ] == false ) dp [ i ] = true ; else if ( i - y >= 0 && dp [ i - y ] == false ) dp [ i ] = true ; else dp [ i ] = false ; } return dp [ n ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(6); param0.add(32); param0.add(99); param0.add(22); param0.add(26); param0.add(67); param0.add(69); param0.add(39); param0.add(7); param0.add(91); List<Integer> param1 = new ArrayList<>(); param1.add(27); param1.add(88); param1.add(18); param1.add(1); param1.add(78); param1.add(51); param1.add(57); param1.add(8); param1.add(82); param1.add(56); List<Integer> param2 = new ArrayList<>(); param2.add(51); param2.add(69); param2.add(48); param2.add(74); param2.add(95); param2.add(27); param2.add(91); param2.add(9); param2.add(41); param2.add(7); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,420
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NUMBER_VISIBLE_BOXES_PUTTING_ONE_INSIDE_ANOTHER.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_VISIBLE_BOXES_PUTTING_ONE_INSIDE_ANOTHER{ static int f_gold ( int [ ] arr , int n ) { Queue < Integer > q = new LinkedList < > ( ) ; Arrays . sort ( arr ) ; q . add ( arr [ 0 ] ) ; for ( int i = 1 ; i < n ; i ++ ) { int now = q . element ( ) ; if ( arr [ i ] >= 2 * now ) q . remove ( ) ; q . add ( arr [ i ] ) ; } return q . size ( ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,3,17,17,18,28,28,29,34,43,44,52,54,80,84,84,91,92,97}); param0.add(new int[]{-34,70,-90,-10,-26,64,4,28,24,-90,-78,72,74,80,82,-94}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{20,87,5,62,12,81,30,83,96,16,2,76,3,8,37,53,55,88}); param0.add(new int[]{-94,-92,-60,-58,-54,-42,-36,-12,-8,-2,8,14,18,20,26,32,38,56,58,60,70,78,80,86,98}); param0.add(new int[]{0,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0}); param0.add(new int[]{1,1,2,3,3,11,16,18,19,21,21,22,22,24,27,28,29,43,43,52,55,57,60,62,62,63,65,66,70,70,73,77,78,79,79,80,85,85,86,88,89,90,97,98}); param0.add(new int[]{88,12,-22,-60,30,-30,-14,80,-58,-80,-10,86,-94,-14,4,-18,-18,54,-82,-8,-68,-6,-44,-44,50,88,-78,-42,12,52,44,14,6,48,18,-30,4}); param0.add(new int[]{0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{82,62,43,39,5,90,75,50,16,83,52,69,71,3,89,10,51,69,32,96,5,43,83,12,31,81,22,59,52,47,86,49,56,90,31,59}); List<Integer> param1 = new ArrayList<>(); param1.add(12); param1.add(10); param1.add(40); param1.add(9); param1.add(18); param1.add(9); param1.add(30); param1.add(21); param1.add(7); param1.add(28); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,421
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_K_TH_GROUP_ODD_POSITIVE_NUMBERS_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_K_TH_GROUP_ODD_POSITIVE_NUMBERS_1{ public static int f_gold ( int k ) { return k * k * k ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(57); param0.add(96); param0.add(14); param0.add(64); param0.add(24); param0.add(74); param0.add(85); param0.add(27); param0.add(78); param0.add(1); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,422
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NON_REPEATING_ELEMENT_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NON_REPEATING_ELEMENT_1{ static int f_gold ( int arr [ ] , int n ) { Map < Integer , Integer > m = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( m . containsKey ( arr [ i ] ) ) { m . put ( arr [ i ] , m . get ( arr [ i ] ) + 1 ) ; } else { m . put ( arr [ i ] , 1 ) ; } } for ( int i = 0 ; i < n ; i ++ ) if ( m . get ( arr [ i ] ) == 1 ) return arr [ i ] ; return - 1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{6,7,14,18,18,18,21,25,28,38,40,42,42,45,48,50,50,50,53,54,58,59,62,65,65,66,67,68,69,73,74,76,77,83,84,85,87}); param0.add(new int[]{24,-84,86,-50,60,-36,92,70,84,40,-8,74,-24,-38,98,40,-78,-36,38,-22,-98,82,-22,80,-80,-62,16,-46,18,64,16,2,24,-92,-46,42,38,8,72,8,14,-68,18,16,-82,8,58,-2}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{59,77,13,49,90}); param0.add(new int[]{-80,-76,-66,-60,-44,-42,-38,-36,-32,-30,-24,-18,-6,2,4,14,32,42,54,70,92,98}); param0.add(new int[]{0,0,0,0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0}); param0.add(new int[]{6,22,24,27,29,30,35,42,57,59,59,63,71,73,76,98}); param0.add(new int[]{-82,-48,36}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{88,49,13,64,30,60,26,55,55,97,98,69,72,72,79,59,46,87,76,61,87,12,91,8,34,15,93,64,83,33,69,58,32,14,72,67,25,7,55,21,12,78,63}); List<Integer> param1 = new ArrayList<>(); param1.add(33); param1.add(25); param1.add(16); param1.add(2); param1.add(12); param1.add(33); param1.add(13); param1.add(1); param1.add(35); param1.add(24); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,423
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/TILING_WITH_DOMINOES.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class TILING_WITH_DOMINOES{ static int f_gold ( int n ) { int [ ] A = new int [ n + 1 ] ; int [ ] B = new int [ n + 1 ] ; A [ 0 ] = 1 ; A [ 1 ] = 0 ; B [ 0 ] = 0 ; B [ 1 ] = 1 ; for ( int i = 2 ; i <= n ; i ++ ) { A [ i ] = A [ i - 2 ] + 2 * B [ i - 1 ] ; B [ i ] = A [ i - 1 ] + B [ i - 2 ] ; } return A [ n ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(29); param0.add(13); param0.add(25); param0.add(65); param0.add(27); param0.add(42); param0.add(19); param0.add(50); param0.add(59); param0.add(13); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,424
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/BASIC_AND_EXTENDED_EUCLIDEAN_ALGORITHMS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class BASIC_AND_EXTENDED_EUCLIDEAN_ALGORITHMS{ public static int f_gold ( int a , int b ) { if ( a == 0 ) return b ; return f_gold ( b % a , a ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(46); param0.add(26); param0.add(40); param0.add(58); param0.add(25); param0.add(2); param0.add(8); param0.add(21); param0.add(82); param0.add(17); List<Integer> param1 = new ArrayList<>(); param1.add(89); param1.add(82); param1.add(12); param1.add(4); param1.add(44); param1.add(87); param1.add(65); param1.add(87); param1.add(10); param1.add(61); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,425
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_MAXIMUM_AVERAGE_SUBARRAY_OF_K_LENGTH_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_MAXIMUM_AVERAGE_SUBARRAY_OF_K_LENGTH_1{ static int f_gold ( int arr [ ] , int n , int k ) { if ( k > n ) return - 1 ; int sum = arr [ 0 ] ; for ( int i = 1 ; i < k ; i ++ ) sum += arr [ i ] ; int max_sum = sum , max_end = k - 1 ; for ( int i = k ; i < n ; i ++ ) { sum = sum + arr [ i ] - arr [ i - k ] ; if ( sum > max_sum ) { max_sum = sum ; max_end = i ; } } return max_end - k + 1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,5,11,37,41,49,49,63,98}); param0.add(new int[]{84,-72,12,0,86,-32,-18,48,60,42,8,-6,-10,-6,-52,-84,-98,76,-10,-14,-94,-48,94,-10,-20,40,-52,0,94,-68,44,-34,-26,-6,-94,34,-80,-62,-40,56,52,-20,74,-46,-88,-26,22}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{94,97,74,88,14,66,65,50,76,55,70,93,53,30,2,60,65,24,80,73,84,95,49,32,55,70,17,26,96,20,36,2,89,49,83,67,42,51,71,11,61,78,17,78,94,68}); param0.add(new int[]{-98,-90,-60,-38,38,42}); param0.add(new int[]{1,0,0,1,1,1,1}); param0.add(new int[]{4,9,17,17,19,32,35,36,37,40,44,45,47,48,48,56,56,60,61,65,66,79,83,91,93,99}); param0.add(new int[]{78,82,-92,-46,-16,-64,28,60,64,52,54,-84,70,22,24,0,-14,20,-90,30,0,86,12,72,-64,-52,86,16,-42}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{81,77,6,3,72,24,75,47,17,29,69,15,15,50,30,83,11,7,59,7,12,82,45,76,9,48,98,49,29,66,3,53,37,13,72,58,37,87,55}); List<Integer> param1 = new ArrayList<>(); param1.add(8); param1.add(34); param1.add(11); param1.add(35); param1.add(3); param1.add(3); param1.add(22); param1.add(25); param1.add(25); param1.add(34); List<Integer> param2 = new ArrayList<>(); param2.add(7); param2.add(43); param2.add(18); param2.add(33); param2.add(5); param2.add(4); param2.add(24); param2.add(27); param2.add(20); param2.add(23); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,426
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_BINARY_DIGIT_NUMBERS_SMALLER_N.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_BINARY_DIGIT_NUMBERS_SMALLER_N{ static int f_gold ( int N ) { Queue < Integer > q = new LinkedList < > ( ) ; q . add ( 1 ) ; int cnt = 0 ; int t ; while ( q . size ( ) > 0 ) { t = q . peek ( ) ; q . remove ( ) ; if ( t <= N ) { cnt ++ ; q . add ( t * 10 ) ; q . add ( t * 10 + 1 ) ; } } return cnt ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(1); param0.add(3); param0.add(150932532); param0.add(71); param0.add(44); param0.add(36); param0.add(88); param0.add(69); param0.add(53); param0.add(20); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,427
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/LENGTH_LONGEST_STRICT_BITONIC_SUBSEQUENCE.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LENGTH_LONGEST_STRICT_BITONIC_SUBSEQUENCE{ static int f_gold ( int arr [ ] , int n ) { HashMap < Integer , Integer > inc = new HashMap < Integer , Integer > ( ) ; HashMap < Integer , Integer > dcr = new HashMap < Integer , Integer > ( ) ; int len_inc [ ] = new int [ n ] ; int len_dcr [ ] = new int [ n ] ; int longLen = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int len = 0 ; if ( inc . containsKey ( arr [ i ] - 1 ) ) len = inc . get ( arr [ i ] - 1 ) ; len_inc [ i ] = len + 1 ; inc . put ( arr [ i ] , len_inc [ i ] ) ; } for ( int i = n - 1 ; i >= 0 ; i -- ) { int len = 0 ; if ( dcr . containsKey ( arr [ i ] - 1 ) ) len = dcr . get ( arr [ i ] - 1 ) ; len_dcr [ i ] = len + 1 ; dcr . put ( arr [ i ] , len_dcr [ i ] ) ; } for ( int i = 0 ; i < n ; i ++ ) if ( longLen < ( len_inc [ i ] + len_dcr [ i ] - 1 ) ) longLen = len_inc [ i ] + len_dcr [ i ] - 1 ; return longLen ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{78}); param0.add(new int[]{-6,-18,-48,58,-54,76,80,-56,86,58,-86,-86,-88,32,12,58,58,-16,86,-24,84,86,36,18,30,-32,-4,-36,-72,-4,42,94}); param0.add(new int[]{0,1}); param0.add(new int[]{92,26,72,8,66,28,34,61,28}); param0.add(new int[]{-86,-82,-76,-68,-66,-64,-62,-56,-48,-42,-38,-30,-22,-18,-10,-10,-4,-2,4,28,42,44,50,50,56,58,60,76,82,86,86,98}); param0.add(new int[]{0,0,1,0,1,1,0,0,1,0,1,1,0,1,1,1,0,0,0,0,1,0}); param0.add(new int[]{3,4,8,9,12,13,16,19,23,25,29,31,34,36,38,41,42,47,49,50,51,51,58,63,66,70,73,74,75,75,75,76,76,80,82,83,83,84,86,89,90,91,91,95,96}); param0.add(new int[]{4,-76,60,48,-14,72}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{66,80,79,72,1,67,20,67,32,40,22,64,58,67,10,21,37,49}); List<Integer> param1 = new ArrayList<>(); param1.add(0); param1.add(18); param1.add(1); param1.add(5); param1.add(25); param1.add(17); param1.add(44); param1.add(3); param1.add(17); param1.add(15); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,428
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_A_TRIPLET_THAT_SUM_TO_A_GIVEN_VALUE.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_A_TRIPLET_THAT_SUM_TO_A_GIVEN_VALUE{ static boolean f_gold ( int A [ ] , int arr_size , int sum ) { int l , r ; for ( int i = 0 ; i < arr_size - 2 ; i ++ ) { for ( int j = i + 1 ; j < arr_size - 1 ; j ++ ) { for ( int k = j + 1 ; k < arr_size ; k ++ ) { if ( A [ i ] + A [ j ] + A [ k ] == sum ) { System . out . print ( "Triplet is " + A [ i ] + ", " + A [ j ] + ", " + A [ k ] ) ; return true ; } } } } return false ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{15,18,38,47,75,88}); param0.add(new int[]{28,-2,62,38,86,-86,56,58,96,6,-28,8,68,-16,-80,-4,98,-92,4,-4,58,-62,46,64}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{19,77,17,91,6,35,22,4,30,23,97,56,78,16,22,23,95,57,43,27,47,44,23,10,3,94,55,22,93,32,89,28,64,22,13,24,38,44,6,1,80}); param0.add(new int[]{-98,-98,-94,-88,-80,-74,-68,-68,-64,-44,-36,-24,-10,-8,-8,0,4,6,8,8,12,14,16,38,50,52,54,56,66,68,76,88}); param0.add(new int[]{1,1,0,0,1,0,1,1}); param0.add(new int[]{7,22,24,30,42,44,49,49,65,70,70,74,74,75,90,95,96}); param0.add(new int[]{40,-76,-68,-86,-14,82,-20,54,-26,56,-24,-44,44,60,52,-20,80,-24,-90,-30,-2}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{33,92,6,99,83,97,49,97,85,52}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(22); param1.add(27); param1.add(22); param1.add(18); param1.add(4); param1.add(8); param1.add(11); param1.add(15); param1.add(6); List<Integer> param2 = new ArrayList<>(); param2.add(4); param2.add(18); param2.add(23); param2.add(29); param2.add(19); param2.add(5); param2.add(13); param2.add(18); param2.add(17); param2.add(7); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,429
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PRIME_NUMBERS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PRIME_NUMBERS{ static boolean f_gold ( int n ) { if ( n <= 1 ) return false ; for ( int i = 2 ; i < n ; i ++ ) if ( n % i == 0 ) return false ; return true ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(2); param0.add(74); param0.add(46); param0.add(38); param0.add(51); param0.add(48); param0.add(6); param0.add(14); param0.add(31); param0.add(10); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,430
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_SERIES_12_32_52_2N_12_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_SERIES_12_32_52_2N_12_1{ static int f_gold ( int n ) { return ( n * ( 2 * n - 1 ) * ( 2 * n + 1 ) ) / 3 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(84); param0.add(74); param0.add(91); param0.add(34); param0.add(36); param0.add(28); param0.add(70); param0.add(7); param0.add(24); param0.add(47); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,431
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_MAXIMUM_PRODUCT_OF_A_TRIPLET_IN_ARRAY_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_MAXIMUM_PRODUCT_OF_A_TRIPLET_IN_ARRAY_1{ static int f_gold ( int arr [ ] , int n ) { if ( n < 3 ) { return - 1 ; } Arrays . sort ( arr ) ; return Math . max ( arr [ 0 ] * arr [ 1 ] * arr [ n - 1 ] , arr [ n - 1 ] * arr [ n - 2 ] * arr [ n - 3 ] ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{5,8,14,15,18,21,21,21,27,29,30,33,34,34,35,37,40,41,44,44,46,49,54,58,60,61,61,63,66,69,69,70,81,82,82,90,90,90,91,92,92,96,97,99}); param0.add(new int[]{72,-32,-2,-76,-56,70,-52,12,-50,32,-98,48,-32,-90,-66,-98,56,-58,-88,50,-22,18,-60,68,70,28}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{38,69,18,72,99,49,17,76,86,53,6,94,66,5,2,62,99,5,31,81,63,91,95,74,76,18,77}); param0.add(new int[]{-92,-58,-8,20,24,24,42,98}); param0.add(new int[]{0,1,1,0,1,0,0,1,0,1,0,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,1,0,0,1,0,0,0,1,1,0,1,1,1,1,0}); param0.add(new int[]{46,64,81}); param0.add(new int[]{4,-26,20,34,-4,-40,76,94,-14,-80,42,60,92,-96,44,58,34,68,96,-8,-18,-92}); param0.add(new int[]{0,0,0,1,1,1,1,1}); param0.add(new int[]{61,17,28,18,52,58,41,75,98,79,1,97,73,17,79,4,46,70,6,83,23,94,1}); List<Integer> param1 = new ArrayList<>(); param1.add(39); param1.add(18); param1.add(17); param1.add(21); param1.add(4); param1.add(38); param1.add(1); param1.add(17); param1.add(7); param1.add(19); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,432
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PANGRAM_CHECKING.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PANGRAM_CHECKING{ public static boolean f_gold ( String str ) { boolean [ ] mark = new boolean [ 26 ] ; int index = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( 'A' <= str . charAt ( i ) && str . charAt ( i ) <= 'Z' ) index = str . charAt ( i ) - 'A' ; else if ( 'a' <= str . charAt ( i ) && str . charAt ( i ) <= 'z' ) index = str . charAt ( i ) - 'a' ; mark [ index ] = true ; } for ( int i = 0 ; i <= 25 ; i ++ ) if ( mark [ i ] == false ) return ( false ) ; return ( true ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("The quick brown fox jumps over the lazy dog "); param0.add("The quick brown fox jumps over the dog"); param0.add("abcdefghijklmnopqrstuvwxyz"); param0.add("AbcdefghijKlmnopqrstUVwxyz"); param0.add("The quicK broWn fOX jumps over the laZYy dog "); param0.add("AbcdefghijKlmnopqrstVwxyz"); param0.add("U"); param0.add("397548458372"); param0.add("11"); param0.add("iwCiUFU r"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,433
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/HEIGHT_COMPLETE_BINARY_TREE_HEAP_N_NODES.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class HEIGHT_COMPLETE_BINARY_TREE_HEAP_N_NODES{ static int f_gold ( int N ) { return ( int ) Math . ceil ( Math . log ( N + 1 ) / Math . log ( 2 ) ) - 1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(65); param0.add(94); param0.add(52); param0.add(31); param0.add(9); param0.add(1); param0.add(41); param0.add(98); param0.add(45); param0.add(24); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,434
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/HOW_CAN_WE_SUM_THE_DIGITS_OF_A_GIVEN_NUMBER_IN_SINGLE_STATEMENT_2.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class HOW_CAN_WE_SUM_THE_DIGITS_OF_A_GIVEN_NUMBER_IN_SINGLE_STATEMENT_2{ static int f_gold ( int no ) { return no == 0 ? 0 : no % 10 + f_gold ( no / 10 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(73); param0.add(91); param0.add(27); param0.add(79); param0.add(31); param0.add(84); param0.add(68); param0.add(9); param0.add(85); param0.add(35); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,435
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/POSSIBLE_TO_MAKE_A_DIVISIBLE_BY_3_NUMBER_USING_ALL_DIGITS_IN_AN_ARRAY.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class POSSIBLE_TO_MAKE_A_DIVISIBLE_BY_3_NUMBER_USING_ALL_DIGITS_IN_AN_ARRAY{ public static boolean f_gold ( int arr [ ] , int n ) { int remainder = 0 ; for ( int i = 0 ; i < n ; i ++ ) remainder = ( remainder + arr [ i ] ) % 3 ; return ( remainder == 0 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,4,9,11,12,15,16,19,21,21,23,23,24,30,31,31,32,34,37,41,41,43,45,46,47,54,58,60,62,66,66,74,74,75,75,77,77,85,89,90,92,92,93,95,98}); param0.add(new int[]{0,66,92,24,-8,88,-92,86,80,82,42,-20,-56,-2,-84,32}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{99,83,11,99,80,76,32,12,94,66,76}); param0.add(new int[]{-88,-84,-80,-80,-80,-80,-72,-68,-64,-62,-60,-52,-48,-44,-36,-24,-20,-18,-14,-8,-6,-6,-4,6,10,14,18,24,26,26,50,50,52,60,76,90,96,98}); param0.add(new int[]{0,1,0,0,1,1,0,0,0,1,1,1,0,1,0,0,0,0,0,1,1,0,1}); param0.add(new int[]{6,6,8,8,10,24,24,26,27,30,34,34,36,36,39,40,41,44,45,50,52,53,57,62,64,64,70,71,72,78,78,79,80,82,89,95,96}); param0.add(new int[]{-28,-84,-14,-20,-14,-26,28,-66,48,82,-46,-10,-94,76,56,-6,72,-92,-32,66,50,-72,64,12,48,88,-36,-12,-6,-18,-36,-34,44,40,-54}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{17,47,89,75,57,69,70,57,83,79,57,49}); List<Integer> param1 = new ArrayList<>(); param1.add(30); param1.add(14); param1.add(29); param1.add(5); param1.add(19); param1.add(14); param1.add(28); param1.add(25); param1.add(19); param1.add(8); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,436
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_NUMBER_TIMES_STRING_OCCURS_GIVEN_STRING_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_NUMBER_TIMES_STRING_OCCURS_GIVEN_STRING_1{ static int f_gold ( String a , String b ) { int m = a . length ( ) ; int n = b . length ( ) ; int lookup [ ] [ ] = new int [ m + 1 ] [ n + 1 ] ; for ( int i = 0 ; i <= n ; ++ i ) lookup [ 0 ] [ i ] = 0 ; for ( int i = 0 ; i <= m ; ++ i ) lookup [ i ] [ 0 ] = 1 ; for ( int i = 1 ; i <= m ; i ++ ) { for ( int j = 1 ; j <= n ; j ++ ) { if ( a . charAt ( i - 1 ) == b . charAt ( j - 1 ) ) lookup [ i ] [ j ] = lookup [ i - 1 ] [ j - 1 ] + lookup [ i - 1 ] [ j ] ; else lookup [ i ] [ j ] = lookup [ i - 1 ] [ j ] ; } } return lookup [ m ] [ n ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("fZOKCdZ Lav"); param0.add("2"); param0.add("1000001110"); param0.add("IAOyBzgIWHo"); param0.add("211806"); param0.add("1"); param0.add("CVaQTG"); param0.add("6265187228"); param0.add("10111101101000"); param0.add("vEi"); List<String> param1 = new ArrayList<>(); param1.add("fKA"); param1.add("187012"); param1.add("0"); param1.add("oA"); param1.add("10"); param1.add("001011100"); param1.add("CT"); param1.add("628"); param1.add("01111"); param1.add("bigsvkQG"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,437
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_DIVISIBILITY_LARGE_NUMBER_999.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_DIVISIBILITY_LARGE_NUMBER_999{ static boolean f_gold ( String num ) { int n = num . length ( ) ; if ( n == 0 && num . charAt ( 0 ) == '0' ) return true ; if ( n % 3 == 1 ) num = "00" + num ; if ( n % 3 == 2 ) num = "0" + num ; int gSum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int group = 0 ; group += ( num . charAt ( i ++ ) - '0' ) * 100 ; group += ( num . charAt ( i ++ ) - '0' ) * 10 ; group += num . charAt ( i ) - '0' ; gSum += group ; } if ( gSum > 1000 ) { num = Integer . toString ( gSum ) ; n = num . length ( ) ; gSum = f_gold ( num ) ? 1 : 0 ; } return ( gSum == 999 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("235764"); param0.add("321308924"); param0.add("101111"); param0.add("1998"); param0.add("339589"); param0.add("0000101"); param0.add("264735"); param0.add("19570453184"); param0.add("000"); param0.add("SsHh"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,438
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/K_TH_DISTINCT_OR_NON_REPEATING_ELEMENT_IN_AN_ARRAY_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class K_TH_DISTINCT_OR_NON_REPEATING_ELEMENT_IN_AN_ARRAY_1{ static int f_gold ( int arr [ ] , int n , int k ) { Map < Integer , Integer > h = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( h . containsKey ( arr [ i ] ) ) h . put ( arr [ i ] , h . get ( arr [ i ] ) + 1 ) ; else h . put ( arr [ i ] , 1 ) ; } if ( h . size ( ) < k ) return - 1 ; int dist_count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( h . get ( arr [ i ] ) == 1 ) dist_count ++ ; if ( dist_count == k ) return arr [ i ] ; } return - 1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{17,25,27,27,73,91}); param0.add(new int[]{-86,-74,-88,28,-32,20,-34,32}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{5,11,36,27,6,24,58,44,14,68}); param0.add(new int[]{-98,-98,-94,-92,-86,-86,-70,-66,-64,-64,-58,-52,-46,-44,-44,-38,-38,-28,-24,-12,-10,-4,-2,2,8,10,12,20,22,26,26,36,42,52,54,60,60,68,82,82,92,98}); param0.add(new int[]{0,1,0,0,1,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1}); param0.add(new int[]{3,8,9,10,10,13,14,16,18,23,24,25,27,28,30,33,36,39,42,42,44,45,45,48,52,52,55,55,59,59,59,60,61,61,66,66,67,68,71,72,75,76,79,80,94,94}); param0.add(new int[]{-12,56,-48,52,-96,-84,32,-12,-6,82,70,18,66,-6,-22,-46,-54,18,-14,-32,68,82,-44,-42,10,56,8,-56,24,20,-38,30,-52,-66,82,-64,68,-82,52,-88,-34,-26,94,58,-4,-84,-60}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{1,23,75,84,28,34,15,13,51,69,94,45,38,38}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(5); param1.add(33); param1.add(7); param1.add(27); param1.add(27); param1.add(44); param1.add(37); param1.add(22); param1.add(13); List<Integer> param2 = new ArrayList<>(); param2.add(3); param2.add(6); param2.add(32); param2.add(5); param2.add(27); param2.add(20); param2.add(26); param2.add(46); param2.add(21); param2.add(12); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,439
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_LARGE_NUMBER_DIVISIBLE_6_NOT.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_LARGE_NUMBER_DIVISIBLE_6_NOT{ static boolean f_gold ( String str ) { int n = str . length ( ) ; if ( ( str . charAt ( n - 1 ) - '0' ) % 2 != 0 ) return false ; int digitSum = 0 ; for ( int i = 0 ; i < n ; i ++ ) digitSum += ( str . charAt ( i ) - '0' ) ; return ( digitSum % 3 == 0 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("2112"); param0.add("1124"); param0.add("1110"); param0.add("O"); param0.add("65530186"); param0.add("132"); param0.add("UqOE"); param0.add("587"); param0.add("1010"); param0.add("QETUfLQ"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,440
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_REVERSING_SUB_ARRAY_MAKE_ARRAY_SORTED.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_REVERSING_SUB_ARRAY_MAKE_ARRAY_SORTED{ static boolean f_gold ( int arr [ ] , int n ) { int temp [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { temp [ i ] = arr [ i ] ; } Arrays . sort ( temp ) ; int front ; for ( front = 0 ; front < n ; front ++ ) { if ( temp [ front ] != arr [ front ] ) { break ; } } int back ; for ( back = n - 1 ; back >= 0 ; back -- ) { if ( temp [ back ] != arr [ back ] ) { break ; } } if ( front >= back ) { return true ; } do { front ++ ; if ( arr [ front - 1 ] < arr [ front ] ) { return false ; } } while ( front != back ) ; return true ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{5,9,9,16,17,22,32,40,45,53,57,58,66,69,76,80,91,93,94}); param0.add(new int[]{52,-76,-18,86,56}); param0.add(new int[]{0,0,1}); param0.add(new int[]{66,44,98,44}); param0.add(new int[]{-96,-62,-56,-46,-44,-38,-38,-26,-22,-22,-16,-12,-6,12,22,34,36,44,44,68,70,74,94}); param0.add(new int[]{1,1,0,0,1,1,1,1,0,1,1,1,0,0,1,1,1,0,0,1,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,0,0,1,1}); param0.add(new int[]{5,9,11,12,13,16,19,23,23,23,25,27,27,28,31,36,40,44,48,59,60,63,66,66,67,67,69,69,70,71,73,76,76,79,86,86,92,92,93,93}); param0.add(new int[]{6,82,-88,-46,-60,70,-54,-96,-94,46,-52,48,-26,-50,-92,-92,6,-6,42,0,-66,-96,66,6,-68,-30,-54,76,60,30,72,-66,-12,-74}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{62,54,36,35,36,91,45,87,74,49,15,15,73,77,63,70,74,65,11,18}); List<Integer> param1 = new ArrayList<>(); param1.add(10); param1.add(3); param1.add(1); param1.add(2); param1.add(14); param1.add(27); param1.add(34); param1.add(28); param1.add(13); param1.add(16); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,441
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/REMAINDER_7_LARGE_NUMBERS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class REMAINDER_7_LARGE_NUMBERS{ static int f_gold ( String num ) { int series [ ] = { 1 , 3 , 2 , - 1 , - 3 , - 2 }; int series_index = 0 ; int result = 0 ; for ( int i = num . length ( ) - 1 ; i >= 0 ; i -- ) { int digit = num . charAt ( i ) - '0' ; result += digit * series [ series_index ] ; series_index = ( series_index + 1 ) % 6 ; result %= 7 ; } if ( result < 0 ) result = ( result + 7 ) % 7 ; return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("K"); param0.add("850076"); param0.add("00111"); param0.add("X"); param0.add("1"); param0.add("10010001100"); param0.add(" pgPeLz"); param0.add("53212456821275"); param0.add("101"); param0.add("V"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,442
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FRIENDS_PAIRING_PROBLEM.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FRIENDS_PAIRING_PROBLEM{ static int f_gold ( int n ) { int dp [ ] = new int [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) { if ( i <= 2 ) dp [ i ] = i ; else dp [ i ] = dp [ i - 1 ] + ( i - 1 ) * dp [ i - 2 ] ; } return dp [ n ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(99); param0.add(62); param0.add(87); param0.add(87); param0.add(61); param0.add(88); param0.add(73); param0.add(62); param0.add(98); param0.add(57); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,443
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_CHARACTERS_GIVEN_STRING_CAN_REARRANGED_FORM_PALINDROME_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_CHARACTERS_GIVEN_STRING_CAN_REARRANGED_FORM_PALINDROME_1{ static boolean f_gold ( String str ) { List < Character > list = new ArrayList < Character > ( ) ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( list . contains ( str . charAt ( i ) ) ) list . remove ( ( Character ) str . charAt ( i ) ) ; else list . add ( str . charAt ( i ) ) ; } if ( str . length ( ) % 2 == 0 && list . isEmpty ( ) || ( str . length ( ) % 2 == 1 && list . size ( ) == 1 ) ) return true ; else return false ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("abccba"); param0.add("2674377254"); param0.add("11"); param0.add("abcdecba"); param0.add("26382426486138"); param0.add("111010111010"); param0.add("hUInqJXNdbfP"); param0.add("5191"); param0.add("1110101101"); param0.add("NupSrU xz"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,444
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_WHETHER_A_GIVEN_NUMBER_IS_A_POWER_OF_4_OR_NOT_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_WHETHER_A_GIVEN_NUMBER_IS_A_POWER_OF_4_OR_NOT_1{ static int f_gold ( int n ) { int count = 0 ; int x = n & ( n - 1 ) ; if ( n > 0 && x == 0 ) { while ( n > 1 ) { n >>= 1 ; count += 1 ; } return ( count % 2 == 0 ) ? 1 : 0 ; } return 0 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(1); param0.add(4); param0.add(64); param0.add(-64); param0.add(128); param0.add(1024); param0.add(45); param0.add(33); param0.add(66); param0.add(74); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,445
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_POSSIBLE_WAYS_TO_CONSTRUCT_BUILDINGS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_POSSIBLE_WAYS_TO_CONSTRUCT_BUILDINGS{ static int f_gold ( int N ) { if ( N == 1 ) return 4 ; int countB = 1 , countS = 1 , prev_countB , prev_countS ; for ( int i = 2 ; i <= N ; i ++ ) { prev_countB = countB ; prev_countS = countS ; countS = prev_countB + prev_countS ; countB = prev_countS ; } int result = countS + countB ; return ( result * result ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(17); param0.add(66); param0.add(53); param0.add(97); param0.add(34); param0.add(54); param0.add(9); param0.add(99); param0.add(59); param0.add(87); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,446
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_PAIRWISE_PRODUCTS_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_PAIRWISE_PRODUCTS_1{ static int f_gold ( int n ) { int multiTerms = n * ( n + 1 ) / 2 ; int sum = multiTerms ; for ( int i = 2 ; i <= n ; i ++ ) { multiTerms = multiTerms - ( i - 1 ) ; sum = sum + multiTerms * i ; } return sum ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(41); param0.add(50); param0.add(67); param0.add(18); param0.add(60); param0.add(6); param0.add(27); param0.add(46); param0.add(50); param0.add(20); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,447
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/REMOVE_MINIMUM_NUMBER_ELEMENTS_NO_COMMON_ELEMENT_EXIST_ARRAY.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class REMOVE_MINIMUM_NUMBER_ELEMENTS_NO_COMMON_ELEMENT_EXIST_ARRAY{ public static int f_gold ( int a [ ] , int b [ ] , int n , int m ) { HashMap < Integer , Integer > countA = new HashMap < Integer , Integer > ( ) ; HashMap < Integer , Integer > countB = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( countA . containsKey ( a [ i ] ) ) countA . put ( a [ i ] , countA . get ( a [ i ] ) + 1 ) ; else countA . put ( a [ i ] , 1 ) ; } for ( int i = 0 ; i < m ; i ++ ) { if ( countB . containsKey ( b [ i ] ) ) countB . put ( b [ i ] , countB . get ( b [ i ] ) + 1 ) ; else countB . put ( b [ i ] , 1 ) ; } int res = 0 ; Set < Integer > s = countA . keySet ( ) ; for ( int x : s ) if ( countB . containsKey ( x ) ) res += Math . min ( countB . get ( x ) , countA . get ( x ) ) ; return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,7,10,12,12,24,29,38,45,51,53,54,59,68,72,73,85,86,88,92,92,95}); param0.add(new int[]{-6,48,-70,14,-86,56,80,-64,64,-88,-14,78,14,-18,52,2,22,88}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1}); param0.add(new int[]{10,93,2,16,36,49,36,86,6,99,95,2}); param0.add(new int[]{-98,-96,-80,-64,-42,-30,-6,10,62,66,82}); param0.add(new int[]{1,1,0,1,1}); param0.add(new int[]{7,11,13,15,21,33,36,39,66,99}); param0.add(new int[]{-40}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{79,91,31,16,28,45,37,43,73,73,76,28,71,60,64,60,99,36,47,38,65,34,22,94,84,51,72,45,71,2}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{7,9,17,23,25,26,29,32,35,56,56,58,59,59,62,63,72,82,85,86,95,97}); param1.add(new int[]{-62,-58,60,-30,42,8,66,-48,-18,64,-76,-90,-48,-90,-24,64,-88,-98}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{99,28,7,21,62,89,82,41,43,77,8,14}); param1.add(new int[]{-62,-50,-42,24,44,46,52,54,60,72,72}); param1.add(new int[]{1,1,1,0,0}); param1.add(new int[]{23,36,42,44,62,65,70,78,82,89}); param1.add(new int[]{-98}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{58,94,12,27,98,38,75,20,94,43,32,90,23,41,88,2,62,96,53,57,48,79,6,16,11,46,73,57,67,7}); List<Integer> param2 = new ArrayList<>(); param2.add(15); param2.add(15); param2.add(10); param2.add(6); param2.add(9); param2.add(4); param2.add(9); param2.add(0); param2.add(31); param2.add(18); List<Integer> param3 = new ArrayList<>(); param3.add(13); param3.add(9); param3.add(10); param3.add(10); param3.add(6); param3.add(2); param3.add(9); param3.add(0); param3.add(26); param3.add(18); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,448
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/N_TH_NUMBER_WHOSE_SUM_OF_DIGITS_IS_TEN_2.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class N_TH_NUMBER_WHOSE_SUM_OF_DIGITS_IS_TEN_2{ public static int f_gold ( int n ) { int nthElement = 19 + ( n - 1 ) * 9 ; int outliersCount = ( int ) Math . log10 ( nthElement ) - 1 ; nthElement += 9 * outliersCount ; return nthElement ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(68); param0.add(70); param0.add(69); param0.add(93); param0.add(99); param0.add(44); param0.add(91); param0.add(8); param0.add(83); param0.add(51); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,449
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_MAXIMUM_AVERAGE_SUBARRAY_OF_K_LENGTH.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_MAXIMUM_AVERAGE_SUBARRAY_OF_K_LENGTH{ static int f_gold ( int [ ] arr , int n , int k ) { if ( k > n ) return - 1 ; int [ ] csum = new int [ n ] ; csum [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) csum [ i ] = csum [ i - 1 ] + arr [ i ] ; int max_sum = csum [ k - 1 ] , max_end = k - 1 ; for ( int i = k ; i < n ; i ++ ) { int curr_sum = csum [ i ] - csum [ i - k ] ; if ( curr_sum > max_sum ) { max_sum = curr_sum ; max_end = i ; } } return max_end - k + 1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,4,6,19,21,23,32,34,47,51,56,57,57,65,68,68,69,70,71,73,74,74,77,77,79,82,82,86,87,87,88,89,90,91,92}); param0.add(new int[]{24,62,-32,-28,42,-46,-96,-70,-68,60,44,34,-30,96,-26,92,62,42,-46,-38,44,54,-94,52,66,68,-96,-58,84,-2,66,30,42}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{94,6,48,34,31}); param0.add(new int[]{-98,-88,-82,-80,-76,-70,-70,-60,-60,-52,-50,-46,-44,-44,-44,-20,-18,-12,-12,-12,-10,-8,-6,-4,4,4,18,28,32,34,42,42,44,46,48,54,60,70,70,72,78,78,78,78,84,86,90,96,98}); param0.add(new int[]{0,1,0,0,1,0,1,1,0,0,1,1,0,0,0,0,0}); param0.add(new int[]{1,5,13,17,26,26,32,35,38,38,39,45,52,58,60,61,62,63,82,83,85,89,89,91}); param0.add(new int[]{-68,-52,4,-90,90,88,38,-18,86,4,14,-32,-14,-44,-88,-50,-12,-26,-68,-20,-30,22,0,14,-40,58,-6,28,-44,8,28,96,-46,-12}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{17,33,36,34,32,10,37,48,47,32,21,18,75,8,18,52,21,73,25,25,80,32,10,24,1,89,7,42,86,85,73,12,20,20,1,74,77,4,24,74,8}); List<Integer> param1 = new ArrayList<>(); param1.add(29); param1.add(23); param1.add(32); param1.add(4); param1.add(45); param1.add(15); param1.add(13); param1.add(32); param1.add(13); param1.add(20); List<Integer> param2 = new ArrayList<>(); param2.add(20); param2.add(31); param2.add(31); param2.add(3); param2.add(30); param2.add(8); param2.add(22); param2.add(22); param2.add(11); param2.add(28); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,450
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NUMBER_ORDERED_PAIRS_AI_AJ_0.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_ORDERED_PAIRS_AI_AJ_0{ static int f_gold ( int a [ ] , int n ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) if ( ( a [ i ] & a [ j ] ) == 0 ) count += 2 ; } return count ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{17,20,32,35,35,36,43,47,59,59,68,69,70,70,75,82,88,94,96,99}); param0.add(new int[]{-78,-40,58,-36,34,-12,-38,48,-66,16,50,-26,-22,46,-70,-68,-44,-52,-78,-50}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{49,57,17,37,56,61,10,3,33,33,70,35,50,85,48,65,83,21,96,19,66,43,69,17,60,87,82,3,83,44,63,19,55,58,77,76,50,96}); param0.add(new int[]{-94,-88,-86,-80,-80,-72,-64,-60,-58,-58,-58,-50,-44,-32,-8,-8,0,6,8,10,14,14,18,28,34,34,46,54,56,56,56,64,66,66,70,82,84,88,96}); param0.add(new int[]{1,1,1,0,1,0,1,1,0,0,1,0,1,0,1,1,0}); param0.add(new int[]{1,3,10,11,13,14,15,17,20,25,26,26,27,29,32,36,36,36,42,46,47,49,51,54,54,55,60,66,67,68,68,68,72,77,78,79,83,84,92,98}); param0.add(new int[]{-76,-72,16,38,-60,44,-2,-76,-76,-56,40,36,50,-50,-32,48,-96,80,84,60,84,38,-54,-42,48,30,66,-62,-52,-94,64,-16,54,98}); param0.add(new int[]{0,0,1,1,1,1}); param0.add(new int[]{63,82,22,84,11,62,18,43,57,25,4,27,62,46,55,16,1,9,10,73,36,80,95,87,47,64,27,25,70}); List<Integer> param1 = new ArrayList<>(); param1.add(17); param1.add(11); param1.add(23); param1.add(37); param1.add(33); param1.add(13); param1.add(32); param1.add(28); param1.add(5); param1.add(22); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,451
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_WHETHER_LARGE_NUMBER_DIVISIBLE_7.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_WHETHER_LARGE_NUMBER_DIVISIBLE_7{ static boolean f_gold ( String num ) { int n = num . length ( ) ; if ( n == 0 && num . charAt ( 0 ) == '0' ) return true ; if ( n % 3 == 1 ) num = "00" + num ; if ( n % 3 == 2 ) num = "0" + num ; n = num . length ( ) ; int gSum = 0 , p = 1 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { int group = 0 ; group += num . charAt ( i -- ) - '0' ; group += ( num . charAt ( i -- ) - '0' ) * 10 ; group += ( num . charAt ( i ) - '0' ) * 100 ; gSum = gSum + group * p ; p = p * - 1 ; } return ( gSum % 7 == 0 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("8955795758"); param0.add("0515"); param0.add("101"); param0.add("14"); param0.add("0"); param0.add("9250318"); param0.add("336"); param0.add("68143991"); param0.add("11010001"); param0.add("zsS"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,452
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NUMBER_SUBSEQUENCES_AB_STRING_REPEATED_K_TIMES.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_SUBSEQUENCES_AB_STRING_REPEATED_K_TIMES{ static int f_gold ( String s , int K ) { int n = s . length ( ) ; int C = 0 , c1 = 0 , c2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) == 'a' ) c1 ++ ; if ( s . charAt ( i ) == 'b' ) { c2 ++ ; C += c1 ; } } return C * K + ( K * ( K - 1 ) / 2 ) * c1 * c2 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("abbc"); param0.add("abahk"); param0.add("hugbabab"); param0.add("abadbc"); param0.add("nkg9"); param0.add("jh7dab"); param0.add("abd"); param0.add("aabb8yk"); param0.add("1111"); param0.add("PFXAhru"); List<Integer> param1 = new ArrayList<>(); param1.add(96); param1.add(7); param1.add(59); param1.add(60); param1.add(8); param1.add(41); param1.add(87); param1.add(4); param1.add(18); param1.add(8); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,453
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_SUM_BITONIC_SUBARRAY.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_SUM_BITONIC_SUBARRAY{ static int f_gold ( int arr [ ] , int n ) { int [ ] msis = new int [ n ] ; int [ ] msds = new int [ n ] ; int max_sum = Integer . MIN_VALUE ; msis [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) if ( arr [ i ] > arr [ i - 1 ] ) msis [ i ] = msis [ i - 1 ] + arr [ i ] ; else msis [ i ] = arr [ i ] ; msds [ n - 1 ] = arr [ n - 1 ] ; for ( int i = n - 2 ; i >= 0 ; i -- ) if ( arr [ i ] > arr [ i + 1 ] ) msds [ i ] = msds [ i + 1 ] + arr [ i ] ; else msds [ i ] = arr [ i ] ; for ( int i = 0 ; i < n ; i ++ ) if ( max_sum < ( msis [ i ] + msds [ i ] - arr [ i ] ) ) max_sum = msis [ i ] + msds [ i ] - arr [ i ] ; return max_sum ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{7,12,16,23,26,27,39,39,40,44,57,58,77,78,81,82,84,86,91,94,94,95,97}); param0.add(new int[]{72,38,-60,98,-52,-38,-2,94,34,56,90,46,6,-2,30,-96,-76,-96,-76,32,68,64,-32,-4,72,-62,58,20,-84,0,-96,70,-22,-56,70,-74,-90,-86,-14,82,-90,40,-64,94}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{69,31,85,84,28,28}); param0.add(new int[]{-80,-74,-24,-22,-22,4,20,28,30,32,36,58,58,68,92,94,98}); param0.add(new int[]{1,1,0,0,0,1,0,1,1,1,1}); param0.add(new int[]{2,2,2,4,6,7,8,10,15,17,19,20,21,27,28,29,32,32,40,44,46,47,49,50,50,52,55,56,58,59,64,69,73,74,74,77,80,80,84,89,91,95,96,96,97,98,98,99}); param0.add(new int[]{26,-86,8,64,-40,64,60,-16,54,-42,-86,14,-48,-20,-42,-4,-34,-52,-74,22,10}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{8,5,5,56,5,38}); List<Integer> param1 = new ArrayList<>(); param1.add(13); param1.add(37); param1.add(33); param1.add(5); param1.add(16); param1.add(10); param1.add(46); param1.add(18); param1.add(27); param1.add(3); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,454
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_GAMES_PLAYED_WINNER.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_GAMES_PLAYED_WINNER{ static int f_gold ( int N ) { int [ ] dp = new int [ N ] ; dp [ 0 ] = 1 ; dp [ 1 ] = 2 ; int i = 2 ; do { dp [ i ] = dp [ i - 1 ] + dp [ i - 2 ] ; } while ( dp [ i ++ ] <= N ) ; return ( i - 2 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(73); param0.add(28); param0.add(33); param0.add(23); param0.add(84); param0.add(31); param0.add(48); param0.add(46); param0.add(45); param0.add(90); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,455
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/EFFICIENT_SEARCH_IN_AN_ARRAY_WHERE_DIFFERENCE_BETWEEN_ADJACENT_IS_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class EFFICIENT_SEARCH_IN_AN_ARRAY_WHERE_DIFFERENCE_BETWEEN_ADJACENT_IS_1{ static int f_gold ( int arr [ ] , int n , int x ) { int i = 0 ; while ( i <= n - 1 ) { if ( arr [ i ] == x ) return i ; i += Math . abs ( arr [ i ] - x ) ; } return - 1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{5, 4, 5, 6, 5, 4, 3, 2}); param0.add(new int[]{5, 4, 5, 6, 5, 4, 3, 2}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{50,51,52,51,50,49,48}); param0.add(new int[]{-86,-68,-32,-6,6,10,30,34,58,92}); param0.add(new int[]{1,1,1,0,0,1,0,0,0,1,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,0,1,0,1,1,1,0,0}); param0.add(new int[]{58}); param0.add(new int[]{-64,78,58,36,48,80,-80,74,-98,46,-48,24,80,72,90,-46,14,68,38,58,-54,80,44,-62,34,-28,92,84,90,44,-26,88,18,22,-32,54,58,92}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{5}); List<Integer> param1 = new ArrayList<>(); param1.add(8); param1.add(8); param1.add(15); param1.add(7); param1.add(6); param1.add(27); param1.add(0); param1.add(24); param1.add(35); param1.add(0); List<Integer> param2 = new ArrayList<>(); param2.add(6); param2.add(3); param2.add(1); param2.add(49); param2.add(6); param2.add(22); param2.add(0); param2.add(34); param2.add(1); param2.add(0); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,456
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_SET_BITS_IN_AN_INTEGER_3.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_SET_BITS_IN_AN_INTEGER_3{ public static int f_gold ( int n ) { if ( n == 0 ) return 0 ; else return 1 + f_gold ( n & ( n - 1 ) ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(6); param0.add(58); param0.add(90); param0.add(69); param0.add(15); param0.add(54); param0.add(60); param0.add(51); param0.add(46); param0.add(91); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,457
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COMPUTE_N_UNDER_MODULO_P.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COMPUTE_N_UNDER_MODULO_P{ static int f_gold ( int n , int p ) { if ( n >= p ) return 0 ; int result = 1 ; for ( int i = 1 ; i <= n ; i ++ ) result = ( result * i ) % p ; return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(85); param0.add(14); param0.add(83); param0.add(30); param0.add(96); param0.add(55); param0.add(82); param0.add(12); param0.add(38); param0.add(46); List<Integer> param1 = new ArrayList<>(); param1.add(18); param1.add(13); param1.add(21); param1.add(35); param1.add(51); param1.add(58); param1.add(71); param1.add(74); param1.add(3); param1.add(73); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,458
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_SUM_PRODUCT_TWO_ARRAYS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_SUM_PRODUCT_TWO_ARRAYS{ static int f_gold ( int a [ ] , int b [ ] , int n , int k ) { int diff = 0 , res = 0 ; int temp = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int pro = a [ i ] * b [ i ] ; res = res + pro ; if ( pro < 0 && b [ i ] < 0 ) temp = ( a [ i ] + 2 * k ) * b [ i ] ; else if ( pro < 0 && a [ i ] < 0 ) temp = ( a [ i ] - 2 * k ) * b [ i ] ; else if ( pro > 0 && a [ i ] < 0 ) temp = ( a [ i ] + 2 * k ) * b [ i ] ; else if ( pro > 0 && a [ i ] > 0 ) temp = ( a [ i ] - 2 * k ) * b [ i ] ; int d = Math . abs ( pro - temp ) ; if ( d > diff ) diff = d ; } return res - diff ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{8,9,9,16,19,21,24,26,26,27,31,33,36,44,46,47,69,71,72,74,74,74,74,76,76,77,89,91,91}); param0.add(new int[]{-64,-58,26,-42,-18,-52,26,-70,0,-68,38,-98,-14,-92,-74,-90,86,-76,-8,-80,-80,54,-26,-56,48,86,-60}); param0.add(new int[]{0,0,0,0,1,1,1,1}); param0.add(new int[]{62,73,67,96,95,31,58,13,63,13,29,97,7,36,13,54,67,8,9,36,6,29,92,7,82,5,27,65,80,20,22,1,11,67,23,31,86,27,53,87,39,99,69}); param0.add(new int[]{-86,-82,-42,-30,-12,-4,14,16,20,20,22,26,30,40,46,48,48,50,60,60,66,70,74,76,90,96,96,98}); param0.add(new int[]{1,1,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,1,1,0,0,0,1,0,1,1,1,1,1,0,0,1}); param0.add(new int[]{4,7,14,14,30,38,44,49,51,53,54,56,58,62,67,76,86,86,88,91,95}); param0.add(new int[]{2,90,-92,58,56,94,12,-2,86,-70,46,-80,42,-6,72,-52,4,96,-42,50,-28,42,8,26,46,70,-2,-24,-36,50,26,70,74,-52,34,-88,-66,74,52,62,-24,-80,40,42,90}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{61,96,7,59,86,74,7,95,13,52,18,77,25,97,74,18}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{1,8,10,10,12,16,17,19,20,20,23,33,37,38,58,66,69,70,70,76,79,80,83,84,84,86,87,87,93}); param1.add(new int[]{90,-2,-8,12,-58,46,-54,-40,-10,-76,-62,66,42,-66,4,-6,50,8,-18,92,-42,30,-34,74,-86,-56,52}); param1.add(new int[]{0,0,0,0,0,1,1,1}); param1.add(new int[]{88,64,94,64,4,23,6,85,92,68,78,53,96,88,69,28,12,34,92,67,39,68,72,64,10,14,26,61,96,1,79,87,45,9,16,70,63,84,79,63,11,85,46}); param1.add(new int[]{-98,-78,-68,-68,-64,-40,-38,-38,-26,-12,-6,0,2,8,18,34,52,58,64,64,70,72,76,82,84,90,96,96}); param1.add(new int[]{1,0,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,0,0}); param1.add(new int[]{2,2,7,19,20,21,22,26,42,45,46,46,59,63,63,72,73,74,77,83,89}); param1.add(new int[]{98,62,-52,-92,-14,-92,62,86,20,36,-80,-12,-38,70,-28,-28,42,-10,94,-16,-72,-96,76,-14,-18,-12,38,14,46,16,-90,10,-34,-6,-34,-62,96,14,0,-10,32,-6,96,-72,-2}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{56,38,75,57,82,30,38,79,39,73,74,73,36,10,80,50}); List<Integer> param2 = new ArrayList<>(); param2.add(20); param2.add(20); param2.add(7); param2.add(23); param2.add(14); param2.add(20); param2.add(11); param2.add(25); param2.add(46); param2.add(13); List<Integer> param3 = new ArrayList<>(); param3.add(28); param3.add(16); param3.add(5); param3.add(23); param3.add(14); param3.add(16); param3.add(17); param3.add(25); param3.add(33); param3.add(12); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,459
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_FACTORIAL_NUMBERS_IN_A_GIVEN_RANGE.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_FACTORIAL_NUMBERS_IN_A_GIVEN_RANGE{ static int f_gold ( int low , int high ) { int fact = 1 , x = 1 ; while ( fact < low ) { fact = fact * x ; x ++ ; } int res = 0 ; while ( fact <= high ) { res ++ ; fact = fact * x ; x ++ ; } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(57); param0.add(57); param0.add(31); param0.add(62); param0.add(49); param0.add(82); param0.add(31); param0.add(5); param0.add(76); param0.add(55); List<Integer> param1 = new ArrayList<>(); param1.add(79); param1.add(21); param1.add(37); param1.add(87); param1.add(98); param1.add(76); param1.add(45); param1.add(52); param1.add(43); param1.add(6); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,460
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_THE_ELEMENT_THAT_APPEARS_ONCE.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_THE_ELEMENT_THAT_APPEARS_ONCE{ static int f_gold ( int arr [ ] , int n ) { int ones = 0 , twos = 0 ; int common_bit_mask ; for ( int i = 0 ; i < n ; i ++ ) { twos = twos | ( ones & arr [ i ] ) ; ones = ones ^ arr [ i ] ; common_bit_mask = ~ ( ones & twos ) ; ones &= common_bit_mask ; twos &= common_bit_mask ; } return ones ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{7,26,26,48,59,62,66,70,72,75,76,81,97,98}); param0.add(new int[]{-42,-48,-64,-74,56,-34,20,16,34,-84,86,38,56,-86,30,-74,-96,96,12,10,-46,10,-36,38,34,-46,-20,14,12,62,-54,20,-82,24,96}); param0.add(new int[]{0,0,1,1}); param0.add(new int[]{68,91,61,6,32,47,76,69,44,71,29,79,74,33,44,33,45,75,43,82,83,81,95,16,86,33,69,61,73,21,54,17,98,62,14,72,80,31,56,82,14,48,76}); param0.add(new int[]{-98,-96,-92,-62,-52,-42,-42,-26,4,10,14,38,64,66,72,74,82}); param0.add(new int[]{0,1,1,1,0,0,0,1,0,1}); param0.add(new int[]{53,63,63}); param0.add(new int[]{-96,-38,-26,-46,68,-36,20,-18,-10,52,40,94,-8,-64,82,-22}); param0.add(new int[]{0,0,0,0,0,1,1}); param0.add(new int[]{99,46,48,81,27,97,26,50,77,32,45,99,46}); List<Integer> param1 = new ArrayList<>(); param1.add(7); param1.add(27); param1.add(3); param1.add(38); param1.add(14); param1.add(5); param1.add(2); param1.add(15); param1.add(3); param1.add(12); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,461
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PAINTING_FENCE_ALGORITHM.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PAINTING_FENCE_ALGORITHM{ static long f_gold ( int n , int k ) { long total = k ; int mod = 1000000007 ; int same = 0 , diff = k ; for ( int i = 2 ; i <= n ; i ++ ) { same = diff ; diff = ( int ) total * ( k - 1 ) ; diff = diff % mod ; total = ( same + diff ) % mod ; } return total ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(6); param0.add(23); param0.add(89); param0.add(63); param0.add(23); param0.add(44); param0.add(81); param0.add(43); param0.add(9); param0.add(41); List<Integer> param1 = new ArrayList<>(); param1.add(30); param1.add(87); param1.add(31); param1.add(36); param1.add(68); param1.add(66); param1.add(18); param1.add(73); param1.add(42); param1.add(98); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,462
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_POSSIBLE_PATHS_TOP_LEFT_BOTTOM_RIGHT_NXM_MATRIX_2.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_POSSIBLE_PATHS_TOP_LEFT_BOTTOM_RIGHT_NXM_MATRIX_2{ static int f_gold ( int m , int n ) { int [ ] dp = new int [ n ] ; dp [ 0 ] = 1 ; for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 1 ; j < n ; j ++ ) { dp [ j ] += dp [ j - 1 ] ; } } return dp [ n - 1 ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(73); param0.add(70); param0.add(53); param0.add(80); param0.add(9); param0.add(38); param0.add(41); param0.add(80); param0.add(42); param0.add(54); List<Integer> param1 = new ArrayList<>(); param1.add(75); param1.add(5); param1.add(62); param1.add(70); param1.add(59); param1.add(48); param1.add(49); param1.add(72); param1.add(52); param1.add(1); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,463
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_A_FIXED_POINT_IN_A_GIVEN_ARRAY_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_A_FIXED_POINT_IN_A_GIVEN_ARRAY_1{ static int f_gold ( int arr [ ] , int low , int high ) { if ( high >= low ) { int mid = ( low + high ) / 2 ; if ( mid == arr [ mid ] ) return mid ; if ( mid > arr [ mid ] ) return f_gold ( arr , ( mid + 1 ) , high ) ; else return f_gold ( arr , low , ( mid - 1 ) ) ; } return - 1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{13,20,20,27,32,35,37,51,63,64,71,75,77,80,82,82,86,90,90,92,95,97,98}); param0.add(new int[]{-10, -5, 0, 3, 7}); param0.add(new int[]{0, 2, 5, 8, 17}); param0.add(new int[]{-10, -5, 3, 4, 7, 9}); param0.add(new int[]{-10, -5, 2, 4, 7, 9}); param0.add(new int[]{1,1,0,1,1,0,1,0,0}); param0.add(new int[]{1,4,16,16,19,28,34,34,35,36,37,46,49,52,54,60,60,60,63,70,75,77,80,81,81,84,85,87,93,99}); param0.add(new int[]{30,30,-94,-10,2,58}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{72,38,91,63,30,67,39,29,96,42}); List<Integer> param1 = new ArrayList<>(); param1.add(0); param1.add(0); param1.add(0); param1.add(1); param1.add(2); param1.add(0); param1.add(0); param1.add(0); param1.add(0); param1.add(0); List<Integer> param2 = new ArrayList<>(); param2.add(16); param2.add(4); param2.add(4); param2.add(5); param2.add(5); param2.add(7); param2.add(5); param2.add(5); param2.add(12); param2.add(7); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,464
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_MATRIX_ELEMENT_ELEMENT_INTEGER_DIVISION_ROW_COLUMN.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_MATRIX_ELEMENT_ELEMENT_INTEGER_DIVISION_ROW_COLUMN{ static int f_gold ( int n ) { int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) for ( int j = 1 ; j <= n ; j ++ ) ans += ( i / j ) ; return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(60); param0.add(74); param0.add(8); param0.add(74); param0.add(34); param0.add(66); param0.add(96); param0.add(11); param0.add(45); param0.add(72); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,465
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DOUBLE_FACTORIAL.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DOUBLE_FACTORIAL{ static long f_gold ( long n ) { if ( n == 0 || n == 1 ) return 1 ; return n * f_gold ( n - 2 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Long> param0 = new ArrayList<>(); param0.add(52L); param0.add(93L); param0.add(15L); param0.add(72L); param0.add(61L); param0.add(21L); param0.add(83L); param0.add(87L); param0.add(75L); param0.add(75L); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,466
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_NUMBER_WAYS_TILE_FLOOR_SIZE_N_X_M_USING_1_X_M_SIZE_TILES.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_NUMBER_WAYS_TILE_FLOOR_SIZE_N_X_M_USING_1_X_M_SIZE_TILES{ static int f_gold ( int n , int m ) { int count [ ] = new int [ n + 1 ] ; count [ 0 ] = 0 ; int i ; for ( i = 1 ; i <= n ; i ++ ) { if ( i > m ) count [ i ] = count [ i - 1 ] + count [ i - m ] ; else if ( i < m ) count [ i ] = 1 ; else count [ i ] = 2 ; } return count [ n ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(93); param0.add(17); param0.add(38); param0.add(33); param0.add(78); param0.add(40); param0.add(95); param0.add(12); param0.add(69); param0.add(78); List<Integer> param1 = new ArrayList<>(); param1.add(54); param1.add(4); param1.add(39); param1.add(64); param1.add(35); param1.add(61); param1.add(6); param1.add(8); param1.add(60); param1.add(21); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,467
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PROGRAM_PRINT_IDENTITY_MATRIX_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_PRINT_IDENTITY_MATRIX_1{ static boolean f_gold ( int mat [ ] [ ] , int N ) { for ( int row = 0 ; row < N ; row ++ ) { for ( int col = 0 ; col < N ; col ++ ) { if ( row == col && mat [ row ] [ col ] != 1 ) return false ; else if ( row != col && mat [ row ] [ col ] != 0 ) return false ; } } return true ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ] [ ]> param0 = new ArrayList<>(); param0.add(new int[][]{new int[]{}}); param0.add(new int[][]{new int[]{1}}); param0.add(new int[][]{new int[]{1,0,0,0},new int[]{0,1,0,0},new int[]{0,0,1,0},new int[]{0,0,0,1}}); param0.add(new int[][]{new int[]{1,0,0,0},new int[]{0,1,0,0},new int[]{0,0,1,0},new int[]{1,0,0,1}}); param0.add(new int[][]{new int[]{80,68,67,24,55,89,15,35,7,28,36,65,76,4,97,99,82,21,14,55,66,43,28,81,94,23,43,97,74},new int[]{94,39,98,29,57,15,49,96,28,97,8,4,39,58,71,76,88,85,9,89,93,64,44,64,41,47,26,70,75},new int[]{47,8,15,88,50,27,9,88,95,51,96,43,14,14,38,63,40,60,41,80,13,74,29,26,52,95,86,39,66},new int[]{40,65,70,92,28,99,1,80,18,13,45,88,67,16,75,91,37,2,80,33,64,4,59,6,11,11,25,39,7},new int[]{43,70,31,99,4,1,98,30,76,89,2,14,6,28,56,19,30,87,98,75,37,39,1,84,29,92,71,67,54},new int[]{18,97,8,12,59,68,25,40,24,82,22,43,73,59,17,92,67,90,14,95,8,41,3,7,69,59,15,63,88},new int[]{32,57,74,7,87,61,83,38,83,68,1,89,92,76,94,21,25,27,62,29,21,88,14,59,20,77,7,35,5},new int[]{22,72,82,3,58,73,55,65,23,83,65,96,63,16,92,63,60,76,91,58,7,65,3,61,13,12,6,88,83},new int[]{15,52,62,34,57,88,56,16,25,23,50,90,57,94,56,62,33,20,71,66,7,10,88,35,47,42,61,9,1},new int[]{85,33,29,35,54,26,37,63,35,16,22,97,68,22,14,70,84,89,93,85,54,15,15,77,15,80,81,60,64},new int[]{4,62,17,84,89,79,9,58,43,16,10,32,36,93,76,7,44,93,12,19,25,34,80,53,65,69,9,71,56},new int[]{65,37,85,44,43,68,55,69,55,52,47,38,41,37,32,24,35,59,46,41,48,51,87,64,75,71,94,17,60},new int[]{50,6,95,63,14,78,8,83,46,7,32,90,3,25,88,78,11,34,57,10,18,33,75,14,68,6,98,12,36},new int[]{11,73,12,20,89,5,78,56,3,36,98,63,11,88,4,9,87,20,62,87,23,3,54,51,99,10,30,34,33},new int[]{79,23,94,80,42,32,29,28,18,35,74,94,89,52,11,74,5,15,78,99,38,94,95,89,92,79,74,13,24},new int[]{74,87,21,34,25,60,49,92,29,88,22,65,27,24,89,32,90,42,67,24,71,47,79,12,73,42,2,80,13},new int[]{79,84,54,87,94,43,62,11,48,36,26,22,27,31,14,87,30,23,6,43,64,76,68,2,33,14,13,63,4},new int[]{77,96,66,22,59,32,40,81,24,58,39,63,53,3,68,37,29,11,50,38,74,64,70,5,75,46,47,15,75},new int[]{5,87,49,47,42,18,34,58,72,65,68,73,17,74,93,85,97,97,93,36,97,70,49,84,24,73,21,36,92},new int[]{97,58,52,86,90,71,1,92,71,85,32,71,27,68,71,96,57,62,81,98,25,89,13,84,59,91,83,92,43},new int[]{74,54,73,63,20,19,13,22,96,46,80,60,68,40,12,34,43,41,57,49,24,69,54,29,20,65,13,50,54},new int[]{93,26,9,10,61,46,49,40,3,93,22,24,99,19,77,92,10,27,28,5,8,4,56,9,52,76,89,28,82},new int[]{73,33,56,17,7,59,85,95,64,16,40,86,27,59,65,49,55,27,35,93,97,27,73,14,78,33,27,84,5},new int[]{37,93,55,95,95,70,37,78,49,62,65,26,85,16,70,36,39,59,33,24,62,53,80,30,91,28,44,92,12},new int[]{45,91,17,24,74,67,90,86,68,26,55,20,65,9,51,69,74,76,3,90,3,64,81,81,89,73,60,76,21},new int[]{4,53,19,1,88,95,30,83,85,76,74,29,59,52,92,46,74,93,67,96,46,88,45,87,56,28,49,57,96},new int[]{10,41,45,41,2,48,49,20,48,21,60,57,10,69,47,91,34,23,5,89,61,36,51,19,59,23,96,90,94},new int[]{16,12,62,79,4,78,25,56,40,44,66,42,75,95,91,17,78,79,41,79,17,7,99,81,47,36,67,74,68},new int[]{78,88,92,77,75,10,5,97,22,77,70,97,86,14,3,6,39,95,21,38,33,68,52,24,22,38,37,98,46}}); param0.add(new int[][]{new int[]{54,16,12,57,31,31,71,17,46},new int[]{74,81,65,60,4,64,19,31,18},new int[]{42,3,51,46,58,13,72,29,69},new int[]{6,81,28,72,32,8,11,14,16},new int[]{9,2,29,22,52,42,78,46,15},new int[]{70,89,42,58,72,9,21,23,34},new int[]{37,33,35,32,96,38,69,53,18},new int[]{35,19,88,73,2,67,92,61,29},new int[]{49,40,86,14,67,89,37,66,29}}); param0.add(new int[][]{new int[]{6,45,61,50,95,16,88,4,77,57,23,14,58,9,94,61,56,58,52,22,3,88,34,16,75,37,40,45,19,5,38,43,25,90,33,54,45,58,91,26,72,59,90,58},new int[]{57,23,46,56,38,75,35,81,92,15,69,75,73,74,2,25,82,15,3,66,55,50,78,42,27,20,59,82,84,99,77,60,29,87,2,93,4,73,58,75,24,91,34,60},new int[]{48,16,15,20,93,77,91,76,26,29,82,81,6,17,65,78,72,13,17,21,70,68,27,5,86,42,29,93,22,85,83,47,34,71,20,66,38,51,11,98,69,33,11,61},new int[]{52,98,3,21,45,88,95,71,96,74,5,34,29,25,22,4,45,34,27,34,25,6,20,64,95,6,38,70,47,12,16,31,36,69,52,3,42,99,39,51,4,83,43,89},new int[]{82,5,49,81,7,20,64,69,5,76,7,66,34,32,73,21,39,84,11,79,12,75,41,22,9,55,83,58,20,91,23,55,14,41,90,34,28,82,71,31,75,97,13,70},new int[]{14,38,99,57,37,89,94,35,32,3,8,80,7,36,13,14,62,18,9,65,10,62,18,23,79,18,19,27,85,5,24,89,4,18,79,55,50,53,93,98,47,79,11,44},new int[]{36,45,81,66,95,20,70,67,48,14,53,71,38,92,33,65,19,93,70,82,49,39,20,99,49,26,62,14,51,43,50,67,79,71,1,79,44,88,77,29,16,17,79,37},new int[]{47,63,92,95,43,92,58,38,70,7,33,6,22,24,57,14,16,99,86,58,7,60,18,86,66,12,99,35,62,84,16,64,7,64,37,26,89,95,46,22,82,41,63,81},new int[]{44,45,67,38,12,94,31,12,24,7,81,14,25,88,7,44,78,20,67,49,64,52,5,3,79,95,29,50,30,76,57,35,11,10,73,35,62,92,19,47,61,2,21,18},new int[]{26,32,78,90,56,43,74,23,88,4,86,76,75,51,45,76,49,47,27,34,53,44,52,31,79,34,51,75,38,20,58,29,11,42,82,67,83,48,32,6,89,88,36,2},new int[]{75,60,53,13,83,51,2,9,67,24,12,85,4,11,94,3,51,30,7,13,47,80,21,11,52,13,31,99,10,60,53,8,4,86,74,41,98,64,11,4,48,55,58,8},new int[]{2,30,97,44,20,75,85,39,34,37,66,61,85,96,26,13,78,59,37,25,20,50,21,90,39,22,51,9,49,2,83,89,98,11,32,91,57,83,80,23,48,62,14,20},new int[]{43,87,42,65,98,57,25,16,20,23,86,8,47,82,85,56,95,80,72,83,35,17,35,51,7,64,49,87,99,37,25,55,86,58,82,59,73,4,97,76,70,36,39,51},new int[]{38,79,75,87,98,4,60,71,43,12,30,59,89,91,67,85,59,74,94,10,36,88,59,15,90,20,62,67,7,65,48,85,72,42,24,33,85,37,70,8,91,33,60,36},new int[]{65,64,13,60,62,41,27,90,90,72,40,55,83,31,54,47,1,86,27,93,91,95,44,56,6,72,93,67,17,24,19,52,46,25,58,37,42,71,62,96,38,4,80,44},new int[]{25,70,58,20,57,12,57,29,95,36,54,63,48,92,43,87,72,58,39,85,42,53,1,7,1,56,52,4,47,50,12,4,57,9,54,72,6,50,67,1,20,88,70,59},new int[]{9,39,54,75,64,97,52,37,52,22,14,87,16,69,20,85,45,43,96,14,14,12,35,79,23,85,23,27,82,1,63,1,69,26,82,14,95,30,13,87,95,73,52,18},new int[]{6,50,3,2,89,32,77,57,75,12,49,25,53,14,23,77,32,40,48,25,66,28,42,86,68,80,88,40,85,24,41,64,77,8,8,72,51,86,72,58,36,95,74,34},new int[]{70,93,46,18,15,36,4,3,8,86,82,87,44,93,54,95,26,25,59,81,58,14,15,60,98,87,24,59,43,3,91,91,42,37,4,88,2,96,49,93,60,87,58,23},new int[]{60,63,45,25,49,83,69,50,69,72,72,60,68,66,46,20,32,31,47,72,54,64,18,96,24,99,73,31,97,28,81,36,35,87,64,97,56,11,15,58,5,99,20,91},new int[]{48,71,80,56,84,33,73,39,19,51,80,90,54,22,50,30,41,22,74,29,74,16,26,75,89,31,32,73,64,89,37,87,51,20,59,41,18,23,54,53,79,87,69,72},new int[]{37,2,19,48,66,62,73,81,90,78,3,66,10,49,32,44,67,24,28,63,79,25,89,59,63,55,22,92,22,9,37,36,48,88,47,92,83,44,38,60,87,67,85,10},new int[]{67,95,54,94,33,72,62,96,67,16,87,35,54,38,79,59,53,57,96,51,52,78,72,22,80,86,53,38,47,72,95,22,72,10,53,95,49,22,13,12,29,50,36,60},new int[]{91,79,47,95,10,98,88,93,69,89,80,90,55,17,76,40,46,42,41,56,62,40,19,87,95,46,37,61,33,96,85,83,60,37,73,55,70,56,27,42,50,32,86,97},new int[]{65,30,27,47,8,3,73,16,19,68,38,37,90,62,83,12,15,34,29,26,48,90,64,28,61,17,86,10,81,92,23,75,16,97,76,89,61,4,54,92,70,91,67,92},new int[]{68,8,75,73,41,37,79,63,2,96,29,18,80,66,63,88,95,13,31,83,51,56,39,69,79,9,1,84,86,66,74,27,10,35,40,96,41,42,18,95,54,74,11,71},new int[]{64,45,42,50,83,34,54,55,99,11,74,78,20,29,47,41,68,12,8,14,42,63,98,55,36,20,79,75,30,57,17,75,33,39,39,4,15,39,48,32,61,13,4,5},new int[]{34,40,40,57,3,45,81,4,34,43,63,51,55,65,91,29,59,9,23,90,79,80,82,24,91,31,45,76,32,91,81,59,69,92,98,54,48,48,9,54,51,52,46,72},new int[]{14,30,64,76,37,19,73,70,80,21,32,65,6,82,82,63,9,84,83,18,18,72,18,34,3,69,3,40,27,4,20,6,59,41,64,5,49,1,4,48,51,3,73,98},new int[]{78,67,32,90,78,32,16,15,20,39,75,80,20,67,4,6,6,45,48,97,13,39,50,4,62,92,78,12,88,89,27,69,17,59,27,79,36,66,14,81,32,68,46,77},new int[]{25,26,66,77,45,94,29,69,7,55,43,41,14,68,98,98,75,81,91,93,58,36,75,16,52,95,41,76,6,2,12,50,66,7,63,24,96,36,12,47,58,86,20,8},new int[]{43,30,21,45,62,76,21,12,5,98,24,39,66,8,10,47,52,62,69,33,43,63,94,47,89,35,2,97,68,27,91,67,79,76,63,44,62,26,71,41,65,11,63,68},new int[]{83,26,88,87,27,89,90,44,25,11,24,51,63,87,21,47,30,87,41,10,51,68,19,99,3,60,9,1,88,96,50,51,4,7,21,19,81,12,3,68,86,76,94,27},new int[]{70,20,21,16,66,54,91,72,58,19,87,21,83,86,36,55,90,93,21,99,40,83,70,10,74,29,47,2,90,40,54,7,42,58,81,86,96,50,78,91,13,8,19,75},new int[]{48,77,22,83,16,42,23,23,66,28,93,6,55,33,71,80,69,45,17,65,61,36,96,88,34,91,96,16,38,82,14,46,93,30,80,71,78,32,88,10,49,64,80,71},new int[]{43,22,43,14,39,21,40,9,28,58,67,37,48,21,15,23,65,37,95,9,78,72,24,15,61,34,60,71,89,67,54,12,65,93,7,33,32,66,15,77,35,49,7,37},new int[]{11,94,76,42,84,60,54,9,48,62,66,29,46,66,39,5,50,42,11,70,68,44,97,32,66,78,94,30,74,62,30,9,72,93,86,56,39,33,3,69,90,82,84,52},new int[]{58,42,85,13,96,49,7,2,15,63,99,30,99,61,4,70,61,2,41,89,65,73,26,81,80,99,19,60,97,47,82,52,99,46,20,64,72,76,77,87,83,71,61,27},new int[]{52,73,93,29,14,16,36,20,50,20,82,46,13,97,48,91,3,64,95,94,57,80,35,72,96,88,2,90,46,85,12,85,6,72,26,43,6,23,98,98,57,5,88,33},new int[]{16,41,49,59,67,92,11,44,53,79,8,47,38,89,16,59,8,57,45,87,27,63,52,23,70,22,27,95,39,42,53,70,77,14,37,66,40,42,83,19,15,51,42,31},new int[]{11,64,69,92,73,96,98,93,44,68,87,34,37,60,65,74,41,20,72,60,58,91,84,58,54,16,68,88,17,9,20,10,2,24,80,41,15,99,74,19,83,88,77,97},new int[]{1,23,97,64,27,1,39,25,98,41,57,7,11,26,60,53,1,88,78,45,83,1,7,43,35,34,68,40,20,64,82,66,61,46,54,50,30,55,51,83,9,47,89,94},new int[]{58,17,59,16,88,29,50,63,79,86,5,74,37,36,17,23,2,55,85,19,88,94,98,10,80,3,18,2,90,24,45,95,42,7,59,46,44,93,35,30,4,89,62,45},new int[]{30,12,55,36,47,2,26,57,75,42,38,56,75,95,26,95,37,73,28,31,29,46,25,96,15,77,85,19,76,71,83,23,1,93,59,94,64,45,37,9,92,92,66,5}}); param0.add(new int[][]{new int[]{65,34,26,9,37,67,53,2,72,64,94,58,2,94,35,57,91,79,54,72,39,11,27,46,26,53,1,43,93,8,32,94,4},new int[]{70,74,34,17,26,35,12,1,81,4,69,57,12,53,47,75,31,54,38,4,75,27,12,68,75,76,32,30,97,65,71,82,58},new int[]{55,76,56,98,18,2,69,56,84,19,8,83,11,32,19,33,18,70,85,12,21,53,84,42,79,57,48,74,4,32,56,93,25},new int[]{81,46,85,84,85,1,12,93,15,95,36,6,66,53,15,15,22,13,52,78,51,78,13,12,16,6,33,46,74,60,42,23,86},new int[]{24,32,97,90,96,79,70,38,1,40,31,81,50,18,5,83,71,28,59,22,85,88,9,42,42,80,1,53,69,19,28,6,7},new int[]{94,36,5,98,38,21,4,80,67,31,67,25,86,20,25,51,91,81,49,36,34,90,15,17,73,93,29,64,65,69,15,99,85},new int[]{51,3,38,69,97,30,29,16,18,38,53,56,27,45,82,52,93,83,38,48,58,63,75,35,57,3,64,35,91,2,3,11,17},new int[]{42,87,47,48,84,66,97,47,22,24,25,13,60,82,36,33,6,21,37,70,99,46,59,7,48,43,85,61,88,23,28,62,67},new int[]{39,1,60,53,83,73,88,11,94,21,35,42,70,76,11,21,37,94,77,44,16,18,11,48,23,31,88,99,47,51,5,84,39},new int[]{76,36,4,40,26,32,68,98,87,61,86,9,7,19,87,82,25,89,88,17,71,90,93,96,93,38,79,40,37,39,50,78,27},new int[]{93,50,25,86,64,79,31,5,2,79,17,28,43,55,75,86,80,44,40,79,22,86,76,39,29,94,55,21,58,16,11,25,3},new int[]{65,46,21,53,94,31,36,95,56,15,61,79,47,91,6,3,77,58,19,1,14,3,88,14,25,26,87,31,32,92,34,1,10},new int[]{32,23,80,11,71,66,61,14,5,4,20,46,14,22,46,33,79,10,23,40,27,14,53,96,36,18,88,72,21,89,54,41,15},new int[]{58,51,83,78,50,9,74,89,78,45,35,48,16,22,87,98,55,14,45,66,39,69,15,63,90,99,58,71,72,58,66,60,59},new int[]{75,60,51,45,94,80,68,18,55,52,91,83,75,66,82,59,25,32,60,99,55,18,44,8,47,70,23,50,47,70,7,82,75},new int[]{99,87,34,94,16,25,38,55,34,47,95,19,23,33,65,4,12,69,58,37,49,64,31,15,8,81,49,21,43,17,36,69,66},new int[]{36,37,27,32,39,87,14,14,20,91,54,77,73,98,84,49,31,88,35,60,64,92,11,25,83,61,81,9,17,75,41,26,9},new int[]{56,72,59,52,16,37,54,75,37,61,38,68,69,30,45,88,94,90,63,37,68,93,36,66,81,75,22,26,70,1,91,57,48},new int[]{12,1,43,29,13,3,73,28,90,13,17,93,52,42,98,43,50,25,73,54,77,70,68,53,34,14,36,19,74,2,3,62,91},new int[]{53,16,54,88,98,49,27,72,31,44,42,79,26,27,2,29,98,49,13,86,43,39,15,35,93,47,36,30,55,50,14,6,62},new int[]{78,34,23,81,13,49,39,23,3,56,41,98,47,22,13,60,99,73,1,12,63,72,96,76,28,40,41,59,78,36,67,94,80},new int[]{49,16,72,51,7,35,73,49,91,86,45,12,4,60,56,32,55,92,19,93,55,11,79,31,58,36,61,16,68,36,80,2,61},new int[]{5,36,19,30,33,96,99,83,98,89,30,33,31,36,31,65,94,40,31,13,42,60,66,2,74,95,41,77,59,60,23,29,50},new int[]{44,80,2,23,40,79,46,11,47,85,79,1,36,61,2,56,79,51,31,3,44,76,47,12,37,43,13,43,47,2,98,56,7},new int[]{16,78,74,73,14,67,14,10,48,6,18,81,76,3,95,20,59,93,2,69,49,45,12,25,31,17,37,17,9,21,88,21,10},new int[]{76,93,65,22,27,8,28,66,46,92,12,73,84,28,43,95,15,83,77,90,32,85,52,89,21,82,11,21,11,98,70,31,43},new int[]{44,70,41,47,92,72,99,44,62,51,70,76,10,37,50,27,39,42,81,59,82,41,33,57,57,4,14,34,95,59,33,16,2},new int[]{22,63,34,90,6,55,79,36,55,52,96,12,19,95,26,58,31,41,77,55,25,22,13,64,39,2,53,77,70,60,40,99,14},new int[]{81,48,68,96,21,87,19,85,97,55,12,43,26,17,74,82,37,66,79,27,39,8,33,69,69,51,64,64,65,55,69,40,64},new int[]{87,40,17,98,18,93,65,49,93,30,55,5,70,42,31,1,23,72,23,4,25,27,77,39,19,20,89,83,70,31,97,14,67},new int[]{13,48,77,97,13,89,48,57,27,18,84,78,58,84,73,45,97,6,12,27,63,83,59,51,75,15,28,89,14,24,34,91,77},new int[]{92,66,37,4,47,78,71,32,83,73,64,91,27,29,83,9,39,58,80,63,43,59,14,22,75,40,39,66,91,12,83,94,59},new int[]{76,33,76,72,72,20,38,51,14,15,85,73,91,6,11,38,69,33,33,80,82,48,38,10,66,80,57,74,23,85,93,17,63}}); param0.add(new int[][]{new int[]{20,59,92,38,68,74,80,12,75,17,90,28,32,68,51,92,9,87,92,42,1,58,4,54,95,81,87,47,29,71,32},new int[]{91,56,90,35,34,99,8,1,13,48,11,13,98,49,66,59,93,31,94,67,76,95,12,9,3,97,74,32,52,88,51},new int[]{78,15,37,60,60,51,19,57,62,95,22,82,60,17,70,11,38,99,11,81,53,98,69,80,85,22,66,18,6,85,35},new int[]{61,35,21,18,30,38,26,82,1,31,86,8,68,82,95,73,51,5,27,97,67,64,52,15,59,45,36,76,75,94,96},new int[]{84,55,25,87,88,21,76,60,54,69,74,12,36,77,84,1,34,16,19,69,34,75,97,87,13,52,38,9,75,94,14},new int[]{47,82,61,86,67,43,66,51,25,35,15,48,16,93,50,91,44,57,52,56,3,11,97,92,25,37,99,14,68,34,64},new int[]{31,12,98,9,45,80,4,61,55,46,38,31,40,42,27,53,49,59,20,19,62,16,9,52,95,75,87,70,96,90,74},new int[]{88,20,61,40,55,58,43,50,34,77,73,86,17,24,98,56,14,47,41,90,41,32,63,66,88,57,6,66,20,9,26},new int[]{16,54,1,53,79,34,12,30,7,23,9,46,40,45,3,44,83,99,63,56,38,76,82,11,18,59,88,74,42,21,44},new int[]{38,50,80,48,98,72,60,51,67,96,55,70,71,70,87,87,12,42,87,65,19,14,20,19,84,32,21,48,30,23,58},new int[]{7,23,15,17,86,87,76,92,19,13,15,21,65,52,12,37,74,19,13,33,73,60,39,50,37,32,62,58,10,20,31},new int[]{69,27,28,76,93,14,24,96,83,94,77,47,14,11,39,86,40,24,69,30,45,24,9,24,93,32,3,86,87,61,87},new int[]{47,83,78,32,86,32,92,82,10,76,45,83,6,77,91,63,78,24,86,61,90,51,44,88,11,81,90,33,17,23,97},new int[]{84,97,32,2,6,19,17,53,25,60,15,42,17,76,86,35,29,28,69,95,60,92,6,31,80,21,2,52,14,46,32},new int[]{1,71,62,39,44,88,75,39,9,53,48,76,63,27,69,71,22,89,15,25,1,75,39,75,31,86,52,29,38,64,76},new int[]{48,70,75,49,76,5,82,72,83,58,66,43,25,87,73,6,9,87,42,47,82,43,71,19,7,17,61,78,44,3,31},new int[]{78,89,29,56,19,7,68,28,81,68,91,88,41,98,8,3,12,11,85,78,1,21,19,69,32,72,62,9,26,20,14},new int[]{94,60,73,46,60,12,21,21,47,91,56,74,88,76,60,84,10,38,4,23,20,46,59,8,19,51,14,6,15,25,69},new int[]{4,48,57,98,25,86,76,78,66,21,16,71,18,65,95,33,10,7,50,21,81,52,30,92,15,40,7,20,90,1,9},new int[]{92,58,71,51,54,56,57,21,32,7,54,97,57,32,71,81,51,25,82,81,35,25,45,69,82,20,31,77,20,70,17},new int[]{55,96,60,73,88,63,2,90,14,37,9,94,55,44,55,96,84,54,20,90,6,54,34,7,16,58,58,88,72,44,68},new int[]{98,72,10,44,74,20,96,24,85,9,23,58,7,32,30,65,75,28,57,25,37,61,94,38,5,45,86,77,55,50,23},new int[]{9,43,13,86,41,42,4,64,59,31,90,68,99,93,10,88,89,83,84,95,52,25,99,95,75,1,27,99,92,61,95},new int[]{23,9,95,28,79,76,53,1,13,47,30,14,81,43,84,84,99,77,44,52,47,35,90,64,77,47,66,32,77,96,40},new int[]{53,27,68,47,54,21,53,24,38,1,85,65,33,50,32,60,37,6,54,15,78,35,98,88,73,32,84,10,31,79,55},new int[]{45,44,77,84,86,83,10,64,60,57,20,71,9,92,78,61,29,62,63,39,49,58,88,5,25,61,59,55,39,12,9},new int[]{12,35,58,74,10,97,46,66,22,77,6,87,64,20,55,65,68,10,15,51,24,96,93,36,5,20,59,3,22,76,18},new int[]{29,27,6,76,52,73,81,12,7,55,18,30,81,15,86,93,48,40,63,78,8,5,79,83,93,78,91,7,94,7,83},new int[]{10,29,80,26,28,72,4,94,69,37,89,26,40,78,22,1,99,4,73,79,51,89,83,79,30,41,17,71,10,32,99},new int[]{39,61,3,58,92,51,77,76,79,30,44,5,30,3,95,15,50,89,39,73,53,82,1,18,76,99,29,65,75,32,32},new int[]{38,40,23,94,62,91,94,42,32,52,10,23,51,7,77,52,86,13,65,12,25,26,84,32,19,36,94,91,48,50,11}}); param0.add(new int[][]{new int[]{93,83,42,36,3,96,99,4,83,84,92,19,69,39,25,37,46,22,48,91,51,83,1,5,31,15,80,59,40,93,95},new int[]{54,11,90,56,27,57,45,62,95,13,85,33,86,20,39,58,72,86,29,60,14,95,58,85,72,58,90,6,73,96,83},new int[]{33,22,85,19,97,11,52,56,85,45,6,97,69,99,37,43,16,45,91,6,44,85,1,20,38,8,8,43,76,88,25},new int[]{69,43,13,63,41,26,51,26,83,20,65,38,60,76,13,80,51,90,70,63,88,47,82,52,15,55,98,12,36,21,81},new int[]{2,91,37,21,77,38,47,83,46,50,21,80,13,54,53,31,44,94,85,47,20,54,23,60,86,86,56,35,86,88,18},new int[]{46,75,65,1,94,23,37,13,73,70,90,44,12,54,50,69,28,80,64,10,44,71,6,68,63,79,22,10,96,19,95},new int[]{13,71,30,9,50,85,17,41,16,58,27,14,25,59,51,15,48,61,50,15,39,7,79,49,43,21,28,32,60,5,8},new int[]{40,81,37,19,62,87,90,26,23,70,64,89,35,10,1,50,94,20,75,48,62,41,59,43,38,78,4,44,37,73,16},new int[]{97,37,78,7,32,92,29,80,85,68,52,98,15,27,54,46,37,33,40,20,72,68,50,49,50,22,52,96,94,54,29},new int[]{35,66,92,81,84,52,72,10,3,52,10,22,25,14,22,43,78,75,95,55,11,95,93,14,16,81,14,82,61,82,7},new int[]{92,56,47,97,57,39,82,67,14,63,49,24,27,33,12,98,16,70,55,13,12,29,59,8,15,78,60,94,36,50,79},new int[]{79,56,75,54,90,10,59,53,87,86,48,65,9,10,5,55,35,37,75,75,72,63,41,43,96,33,51,49,55,97,89},new int[]{51,24,59,88,43,51,67,10,84,22,15,62,77,24,75,34,97,71,3,46,38,59,82,53,52,69,2,57,21,89,88},new int[]{33,49,78,9,9,85,92,47,9,36,67,24,14,66,72,45,11,49,2,44,87,98,3,28,15,22,42,30,28,26,45},new int[]{30,97,41,94,2,35,30,83,75,35,77,12,40,15,9,39,64,47,63,92,54,33,23,4,3,42,32,55,16,46,20},new int[]{11,80,79,61,36,97,56,15,15,5,55,11,96,66,51,51,99,45,55,77,33,49,91,96,58,10,53,69,12,6,6},new int[]{23,73,85,83,94,51,28,20,39,36,50,60,74,68,38,30,65,71,78,69,78,87,26,49,20,44,10,72,97,1,17},new int[]{12,50,96,79,8,43,71,63,13,88,21,13,62,80,42,85,19,53,97,62,21,75,86,78,91,35,88,9,3,73,28},new int[]{28,62,83,54,34,11,79,29,20,74,75,68,46,22,4,59,89,29,24,56,8,49,12,87,89,95,90,21,48,39,29},new int[]{98,88,4,74,67,38,35,65,58,36,35,24,59,12,49,92,84,27,56,81,48,43,73,65,51,84,39,93,56,24,94},new int[]{94,92,81,45,74,80,98,72,40,20,41,34,23,59,59,28,83,13,23,74,12,89,90,82,2,12,49,50,51,2,52},new int[]{29,74,58,85,1,37,5,66,26,58,7,84,70,73,16,6,98,87,51,49,87,89,24,30,80,16,76,50,6,74,9},new int[]{14,96,38,81,29,8,19,75,17,83,63,5,57,46,3,52,46,47,94,96,18,22,77,14,9,60,94,50,7,37,30},new int[]{85,76,84,18,58,48,45,54,93,16,10,22,30,5,62,51,18,44,27,23,55,56,28,58,13,14,6,85,32,25,30},new int[]{70,19,93,74,98,7,55,67,38,49,77,85,37,65,80,83,67,15,99,71,51,81,25,77,65,37,62,80,8,78,48},new int[]{1,76,42,12,54,26,18,30,9,61,74,7,58,5,48,43,41,18,70,24,8,15,41,47,46,44,9,95,82,24,3},new int[]{17,28,29,45,1,80,41,27,18,50,1,43,84,92,19,18,23,2,68,7,18,27,32,9,65,85,21,33,89,74,72},new int[]{98,66,13,88,97,14,26,83,71,6,59,65,34,10,39,78,45,95,70,22,89,93,98,58,63,80,93,98,31,73,85},new int[]{56,76,20,78,84,26,43,32,39,14,64,37,99,54,44,6,98,26,9,29,78,19,41,51,33,37,33,93,55,93,42},new int[]{56,29,87,54,47,91,90,47,11,43,63,8,53,88,76,63,87,41,64,81,39,85,74,56,4,3,58,86,20,85,53},new int[]{64,65,80,69,83,7,3,64,27,52,18,45,3,51,86,16,59,73,4,48,47,20,20,34,74,40,16,37,30,86,93}}); List<Integer> param1 = new ArrayList<>(); param1.add(0); param1.add(1); param1.add(4); param1.add(4); param1.add(17); param1.add(4); param1.add(35); param1.add(30); param1.add(25); param1.add(29); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,468
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DYNAMIC_PROGRAMMING_SET_3_LONGEST_INCREASING_SUBSEQUENCE_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DYNAMIC_PROGRAMMING_SET_3_LONGEST_INCREASING_SUBSEQUENCE_1{ static int f_gold ( int arr [ ] , int n ) { int f_gold [ ] = new int [ n ] ; int i , j , max = 0 ; for ( i = 0 ; i < n ; i ++ ) f_gold [ i ] = 1 ; for ( i = 1 ; i < n ; i ++ ) for ( j = 0 ; j < i ; j ++ ) if ( arr [ i ] > arr [ j ] && f_gold [ i ] < f_gold [ j ] + 1 ) f_gold [ i ] = f_gold [ j ] + 1 ; for ( i = 0 ; i < n ; i ++ ) if ( max < f_gold [ i ] ) max = f_gold [ i ] ; return max ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,3,5,6,8,12,12,17,17,18,22,22,26,26,31,31,31,31,32,35,35,38,41,42,49,49,60,60,61,63,64,68,69,70,71,72,76,77,80,83,83,89,90,90,90,96}); param0.add(new int[]{-24,-16,-64,28,-30,-26,-14}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{11,42,44,52,15,35,48}); param0.add(new int[]{-54}); param0.add(new int[]{1,0,1,1,1,0,1,1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0}); param0.add(new int[]{2,5,6,10,13,15,18,18,19,27,30,32,34,40,47,50,53,54,55,56,56,56,59,60,63,64,71,80,83,84,86,95}); param0.add(new int[]{-80,60,-6,0,-50,82,-84,36,-96,-32,-14,16,60,-14,0,-22,28,12,8,-86,38,56,-32,-6,-80,-42,56,10,72,12,96,84}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{10,38,45,57,44,13,8,62,74,54,37,75,35,60,36,33,14,71,4,21,6,8,30,5,2,5,4,20,33,69,83,87,83,52,77,79,49,25,11,35,98,31,52,82,13,25,17,35,53}); List<Integer> param1 = new ArrayList<>(); param1.add(40); param1.add(4); param1.add(11); param1.add(6); param1.add(0); param1.add(22); param1.add(24); param1.add(16); param1.add(37); param1.add(28); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,469
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DYNAMIC_PROGRAMMING_SET_37_BOOLEAN_PARENTHESIZATION_PROBLEM.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DYNAMIC_PROGRAMMING_SET_37_BOOLEAN_PARENTHESIZATION_PROBLEM{ static int f_gold ( char symb [ ] , char oper [ ] , int n ) { int F [ ] [ ] = new int [ n ] [ n ] ; int T [ ] [ ] = new int [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { F [ i ] [ i ] = ( symb [ i ] == 'F' ) ? 1 : 0 ; T [ i ] [ i ] = ( symb [ i ] == 'T' ) ? 1 : 0 ; } for ( int gap = 1 ; gap < n ; ++ gap ) { for ( int i = 0 , j = gap ; j < n ; ++ i , ++ j ) { T [ i ] [ j ] = F [ i ] [ j ] = 0 ; for ( int g = 0 ; g < gap ; g ++ ) { int k = i + g ; int tik = T [ i ] [ k ] + F [ i ] [ k ] ; int tkj = T [ k + 1 ] [ j ] + F [ k + 1 ] [ j ] ; if ( oper [ k ] == '&' ) { T [ i ] [ j ] += T [ i ] [ k ] * T [ k + 1 ] [ j ] ; F [ i ] [ j ] += ( tik * tkj - T [ i ] [ k ] * T [ k + 1 ] [ j ] ) ; } if ( oper [ k ] == '|' ) { F [ i ] [ j ] += F [ i ] [ k ] * F [ k + 1 ] [ j ] ; T [ i ] [ j ] += ( tik * tkj - F [ i ] [ k ] * F [ k + 1 ] [ j ] ) ; } if ( oper [ k ] == '^' ) { T [ i ] [ j ] += F [ i ] [ k ] * T [ k + 1 ] [ j ] + T [ i ] [ k ] * F [ k + 1 ] [ j ] ; F [ i ] [ j ] += T [ i ] [ k ] * T [ k + 1 ] [ j ] + F [ i ] [ k ] * F [ k + 1 ] [ j ] ; } } } } return T [ 0 ] [ n - 1 ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<char [ ]> param0 = new ArrayList<>(); param0.add("TTFT".toCharArray()); param0.add("TFT".toCharArray()); param0.add("TFF".toCharArray()); param0.add("TTFT".toCharArray()); param0.add("TTFT".toCharArray()); param0.add("TTFT".toCharArray()); param0.add("TTFT".toCharArray()); param0.add("TTFT".toCharArray()); param0.add("TTFT".toCharArray()); param0.add("TTFT".toCharArray()); List<char [ ]> param1 = new ArrayList<>(); param1.add("|&^".toCharArray()); param1.add("^&".toCharArray()); param1.add("^|".toCharArray()); param1.add("|||".toCharArray()); param1.add("&&&".toCharArray()); param1.add("&&^".toCharArray()); param1.add("^&|".toCharArray()); param1.add("^^^".toCharArray()); param1.add("^||".toCharArray()); param1.add("|^|".toCharArray()); param1.add("&^|".toCharArray()); List<Integer> param2 = new ArrayList<>(); param2.add(4); param2.add(3); param2.add(3); param2.add(4); param2.add(4); param2.add(4); param2.add(4); param2.add(4); param2.add(4); param2.add(4); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,470
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PROGRAM_TO_FIND_THE_AREA_OF_PENTAGON.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_TO_FIND_THE_AREA_OF_PENTAGON{ static float f_gold ( float a ) { float area ; area = ( float ) ( Math . sqrt ( 5 * ( 5 + 2 * ( Math . sqrt ( 5 ) ) ) ) * a * a ) / 4 ; return area ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Float> param0 = new ArrayList<>(); param0.add(2009.019461888707F); param0.add(-1480.5131394215787F); param0.add(357.7870347569567F); param0.add(-8040.293697508038F); param0.add(3821.882657293133F); param0.add(-6840.635072240347F); param0.add(1623.036598830132F); param0.add(-9714.00706195298F); param0.add(3916.454769669618F); param0.add(-669.068424712943F); for(int i = 0; i < param0.size(); ++i) { if(Math.abs(1 - (0.0000001 + Math.abs(f_gold(param0.get(i))) )/ (Math.abs(f_filled(param0.get(i))) + 0.0000001)) < 0.001F) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,471
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_CONSECUTIVE_NUMBERS_PRESENT_ARRAY.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_CONSECUTIVE_NUMBERS_PRESENT_ARRAY{ static int f_gold ( int arr [ ] , int n ) { HashSet < Integer > S = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) S . add ( arr [ i ] ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( S . contains ( arr [ i ] ) ) { int j = arr [ i ] ; while ( S . contains ( j ) ) j ++ ; ans = Math . max ( ans , j - arr [ i ] ) ; } } return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,5,9,24,28,31,49,54,67,85,86,94,97,97}); param0.add(new int[]{-34,16,-80,-10,80,2,50,-74,-76,36,-84,-24,74,-54,-22,46,80,58,-8,70,24,-88,52,62,30,42,48,16,78,-82,64,-36,84,-72}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{49,61,68,4,90,89,71,74,45,61,35,41,59}); param0.add(new int[]{-42,-8,28,56,80,96}); param0.add(new int[]{1,0,1,0,0,0,0,1,1,0,1,1,0,1,0,1,1,1,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,1,1}); param0.add(new int[]{3,4,6,6,13,27,27,29,32,36,46,50,52,65,69,70,71,83,87,91}); param0.add(new int[]{64,-76,28,6,56,18,32,-50,-20,18,-26,-90,32,50,-18,98,84,40,50,88,-70,-6,-24,-44,-96,-58,48,-78,-14}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{50,48,61,87,7,78,93,44,16,88,98,15,73,93,43,46,42,34,1,35,79,35,84,60,18,79,17,4,78,1,20,64}); List<Integer> param1 = new ArrayList<>(); param1.add(11); param1.add(29); param1.add(13); param1.add(11); param1.add(4); param1.add(17); param1.add(10); param1.add(15); param1.add(15); param1.add(25); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,472
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/LARGEST_SUM_CONTIGUOUS_SUBARRAY_2.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LARGEST_SUM_CONTIGUOUS_SUBARRAY_2{ static int f_gold ( int a [ ] , int size ) { int max_so_far = a [ 0 ] ; int curr_max = a [ 0 ] ; for ( int i = 1 ; i < size ; i ++ ) { curr_max = Math . max ( a [ i ] , curr_max + a [ i ] ) ; max_so_far = Math . max ( max_so_far , curr_max ) ; } return max_so_far ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,3,4,7,8,8,10,12,16,19,19,20,20,21,21,22,26,27,29,34,36,38,38,39,41,43,44,47,47,49,57,57,60,62,63,65,75,77,77,78,81,82,82,83,83,84,85,98,99}); param0.add(new int[]{-40,14,2,-70,86,-90,-50,-54,-2,90,30}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{60,69,41,7,77,36,36,26,35,30,64,75,3,35,60,71,29,47,15,29,43,88,56,22,9,45,40,50,52}); param0.add(new int[]{-96,-88,-80,-72,-64,-64,-60,-60,-60,-58,-56,-54,-54,-50,-50,-26,-26,-24,-20,-8,-2,0,4,4,12,14,18,18,24,32,42,44,44,44,48,50,50,56,60,60,70,80,88,88,90,98}); param0.add(new int[]{0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,1,0,0,0,1,1,1,0}); param0.add(new int[]{2,4,4,5,6,7,11,12,14,18,23,24,27,28,33,36,37,38,39,40,41,41,48,48,52,61,64,66,66,77,79,82,85,88,91,94,99}); param0.add(new int[]{-56,0,16,12,20,36,32,-52,-68,-36,-96,-46,-34,56,2,78,6,30,-68,-48,2,44,-26,-36,-30,-20,-90,-66,4,94,8,4,-4,-32,-24}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{39,87,27,89,26,25,80,82,21,25,55,27,20,81,47,79,26,72,10,11,90,89}); List<Integer> param1 = new ArrayList<>(); param1.add(38); param1.add(10); param1.add(18); param1.add(25); param1.add(35); param1.add(22); param1.add(34); param1.add(20); param1.add(22); param1.add(21); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,473
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_SUM_TWO_NUMBERS_FORMED_DIGITS_ARRAY_2.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_SUM_TWO_NUMBERS_FORMED_DIGITS_ARRAY_2{ static int f_gold ( int a [ ] , int n ) { Arrays . sort ( a ) ; int num1 = 0 ; int num2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 2 == 0 ) num1 = num1 * 10 + a [ i ] ; else num2 = num2 * 10 + a [ i ] ; } return num2 + num1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,16,29,30,38,83}); param0.add(new int[]{58,74,-28,-60,-6,66,-76,46,0,-24,28,-16,-14,24,-94,-56,-80,40,-18,-68,-8,-94,-88,-12,-20,-8}); param0.add(new int[]{0,1}); param0.add(new int[]{7,12,78,8}); param0.add(new int[]{-78,-48,-48,-26,8,34}); param0.add(new int[]{1,1,1,1,0,1,1,1,0,1,0,1,0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,1,1,0}); param0.add(new int[]{2,3,5,7,25,30,31,38,42,45,52,53,56,59,60,71,74,76,80,90,91,98}); param0.add(new int[]{40,-62,-2,-58,60,38,48,-4,0,62,-52,-80,56,38,58,-72,32,-26,-14,70,58,-86,-32,56,-40,84,24,60,-46,-32,78,78,-66,20,-32,98,84,44,48,4,54,-66,6,-62,58}); param0.add(new int[]{0,0,0,0,0,0,1,1,1}); param0.add(new int[]{59,9,3,20,83,87,48,4,86,67,89,96,17,36,39,45,99,8,56,92,63,81,7,75,32,10,71,82,97,92,65,23,22,47,70,79,57,81,65,50}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(16); param1.add(1); param1.add(3); param1.add(4); param1.add(27); param1.add(13); param1.add(34); param1.add(8); param1.add(35); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,474
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MODULAR_EXPONENTIATION_POWER_IN_MODULAR_ARITHMETIC.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MODULAR_EXPONENTIATION_POWER_IN_MODULAR_ARITHMETIC{ static int f_gold ( int x , int y , int p ) { int res = 1 ; x = x % p ; while ( y > 0 ) { if ( ( y & 1 ) == 1 ) res = ( res * x ) % p ; y = y >> 1 ; x = ( x * x ) % p ; } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(45); param0.add(67); param0.add(26); param0.add(33); param0.add(35); param0.add(68); param0.add(14); param0.add(5); param0.add(23); param0.add(37); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(25); param1.add(91); param1.add(61); param1.add(8); param1.add(41); param1.add(76); param1.add(89); param1.add(42); param1.add(63); List<Integer> param2 = new ArrayList<>(); param2.add(68); param2.add(49); param2.add(44); param2.add(9); param2.add(13); param2.add(5); param2.add(20); param2.add(13); param2.add(45); param2.add(56); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,475
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/WRITE_A_C_PROGRAM_TO_FIND_THE_PARITY_OF_AN_UNSIGNED_INTEGER.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class WRITE_A_C_PROGRAM_TO_FIND_THE_PARITY_OF_AN_UNSIGNED_INTEGER{ static boolean f_gold ( int n ) { boolean parity = false ; while ( n != 0 ) { parity = ! parity ; n = n & ( n - 1 ) ; } return parity ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(63); param0.add(64); param0.add(85); param0.add(36); param0.add(20); param0.add(63); param0.add(42); param0.add(19); param0.add(62); param0.add(97); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,476
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_LARGE_NUMBER_DIVISIBLE_11_NOT.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_LARGE_NUMBER_DIVISIBLE_11_NOT{ static boolean f_gold ( String str ) { int n = str . length ( ) ; int oddDigSum = 0 , evenDigSum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 2 == 0 ) oddDigSum += ( str . charAt ( i ) - '0' ) ; else evenDigSum += ( str . charAt ( i ) - '0' ) ; } return ( ( oddDigSum - evenDigSum ) % 11 == 0 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("r"); param0.add("7386620"); param0.add("1010"); param0.add("rWFOLX VB"); param0.add("3845847974820"); param0.add("01001"); param0.add("yq"); param0.add("770356"); param0.add("0000110111001"); param0.add("tDMrBdHJJITDx"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,477
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_1{ static int f_gold ( int n ) { int p = 1 ; if ( n > 0 && ( n & ( n - 1 ) ) == 0 ) return n ; while ( p < n ) p <<= 1 ; return p ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(31); param0.add(89); param0.add(92); param0.add(66); param0.add(38); param0.add(34); param0.add(17); param0.add(24); param0.add(54); param0.add(20); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,478
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/K_TH_MISSING_ELEMENT_INCREASING_SEQUENCE_NOT_PRESENT_GIVEN_SEQUENCE.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class K_TH_MISSING_ELEMENT_INCREASING_SEQUENCE_NOT_PRESENT_GIVEN_SEQUENCE{ static int f_gold ( int a [ ] , int b [ ] , int k , int n1 , int n2 ) { LinkedHashSet < Integer > s = new LinkedHashSet < > ( ) ; for ( int i = 0 ; i < n2 ; i ++ ) s . add ( b [ i ] ) ; int missing = 0 ; for ( int i = 0 ; i < n1 ; i ++ ) { if ( ! s . contains ( a [ i ] ) ) missing ++ ; if ( missing == k ) return a [ i ] ; } return - 1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,9,9,13,38,41,50,59,64,64,72,78,79,80,84,92,94,98,99}); param0.add(new int[]{-54,-80,-62,98,-68,42,98,80,-8,-6,26,0,-60,-24,-74,-48,4,-54,20,32,42,68,-50,58,-50,96,-34,22,56,-60,-10,-18,80,20,-50}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{85,44,60,86,26,22,95,47,43,24,30,37,22,33,6,56}); param0.add(new int[]{-32,-18,2,54,72,92,94}); param0.add(new int[]{1,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,1,0,1,0,1,0,1,0,1,0,0,0,1,1,0,1,1,1,1,1,1,0,0,0,1,0,1,1,1,0,0}); param0.add(new int[]{3,9,13,14,16,19,20,21,23,26,27,27,28,29,31,36,37,38,41,42,45,46,52,56,63,65,70,70,72,72,76,77,78,78,79,82,83,86,87,87,90,93,93,94,96,96,97,98}); param0.add(new int[]{-82,-62}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}); param0.add(new int[]{26,5,60,53,35}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{5,9,11,21,24,27,30,35,38,39,40,45,48,48,51,58,61,91,92}); param1.add(new int[]{90,-86,-82,92,-42,-34,10,-28,-78,8,66,96,-16,-22,-68,-36,-72,84,-54,-44,-80,-30,64,10,-60,-90,22,54,-88,74,-56,22,-24,-52,82}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param1.add(new int[]{66,76,38,91,57,50,12,21,90,17,18,78,23,12,90,81}); param1.add(new int[]{-76,-68,-34,-24,8,12,32}); param1.add(new int[]{0,0,1,1,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,0}); param1.add(new int[]{2,5,6,7,9,11,11,13,17,18,20,20,26,27,35,35,36,37,41,42,45,46,48,49,50,50,54,54,56,60,62,63,65,67,68,68,70,72,74,74,78,79,80,80,86,89,97,99}); param1.add(new int[]{48,32}); param1.add(new int[]{0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{41,80,35,14,47}); List<Integer> param2 = new ArrayList<>(); param2.add(11); param2.add(24); param2.add(15); param2.add(12); param2.add(6); param2.add(29); param2.add(27); param2.add(1); param2.add(10); param2.add(3); List<Integer> param3 = new ArrayList<>(); param3.add(9); param3.add(24); param3.add(15); param3.add(14); param3.add(3); param3.add(29); param3.add(39); param3.add(1); param3.add(14); param3.add(2); List<Integer> param4 = new ArrayList<>(); param4.add(18); param4.add(21); param4.add(11); param4.add(10); param4.add(5); param4.add(37); param4.add(28); param4.add(1); param4.add(12); param4.add(3); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i),param4.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i),param4.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,479
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_THE_NUMBER_OCCURRING_ODD_NUMBER_OF_TIMES_2.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_THE_NUMBER_OCCURRING_ODD_NUMBER_OF_TIMES_2{ static int f_gold ( int ar [ ] , int ar_size ) { int i ; int res = 0 ; for ( i = 0 ; i < ar_size ; i ++ ) { res = res ^ ar [ i ] ; } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,1,7,10,12,19,20,22,23,25,27,32,33,39,43,44,45,46,47,47,48,49,50,51,55,58,68,69,73,76,77,79,81,84,92,95,99}); param0.add(new int[]{-12,-40,-68}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{86,56,98,58,7,40,84,45,69,77,36,50,72,99,95}); param0.add(new int[]{-90,-68,-66,-66,-58,-54,-52,-48,-40,-30,-26,-24,-20,-14,-10,-8,-6,-6,-6,18,30,34,36,42,50,56,64,68,70,74,92,92,98}); param0.add(new int[]{0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,0,1,0,0,1,0,1,1,1,0,1,0,1,1,1,1,0,0,1,0,0,0}); param0.add(new int[]{3,21,47,51,78,84,84,85,86,99}); param0.add(new int[]{-26,-72,44,62,-22,22,28,-28,32,-72,72,96,92,-52,-2,-22,-76,-88,-74,-8,-30,54,0,-62,14,-92,-58,72,40,46,96,86,-54,-92,46,92,20,-96,-92,-70,-94,78,-92,-54,-90}); param0.add(new int[]{0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{69,1,12,81,78,18,81,47,49,19,99,40,52,47,71,69,80,72,66,84,72,6,98,89,3,87,81,85,37,14,5,36,26,74}); List<Integer> param1 = new ArrayList<>(); param1.add(36); param1.add(2); param1.add(21); param1.add(9); param1.add(26); param1.add(27); param1.add(9); param1.add(33); param1.add(9); param1.add(22); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,480
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS{ static int f_gold ( int n ) { int [ ] [ ] arr = new int [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) arr [ i ] [ j ] = Math . abs ( i - j ) ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) sum += arr [ i ] [ j ] ; return sum ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(60); param0.add(44); param0.add(72); param0.add(90); param0.add(99); param0.add(45); param0.add(27); param0.add(11); param0.add(65); param0.add(52); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,481
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/WRITE_YOU_OWN_POWER_WITHOUT_USING_MULTIPLICATION_AND_DIVISION.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class WRITE_YOU_OWN_POWER_WITHOUT_USING_MULTIPLICATION_AND_DIVISION{ static int f_gold ( int a , int b ) { if ( b == 0 ) return 1 ; int answer = a ; int increment = a ; int i , j ; for ( i = 1 ; i < b ; i ++ ) { for ( j = 1 ; j < a ; j ++ ) { answer += increment ; } increment = answer ; } return answer ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(66); param0.add(82); param0.add(12); param0.add(55); param0.add(34); param0.add(22); param0.add(13); param0.add(57); param0.add(76); param0.add(76); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(66); param1.add(38); param1.add(33); param1.add(26); param1.add(23); param1.add(98); param1.add(84); param1.add(94); param1.add(95); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,482
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_WHETHER_AN_ARRAY_IS_SUBSET_OF_ANOTHER_ARRAY_SET_1_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_WHETHER_AN_ARRAY_IS_SUBSET_OF_ANOTHER_ARRAY_SET_1_1{ static boolean f_gold ( int arr1 [ ] , int arr2 [ ] , int m , int n ) { int i = 0 , j = 0 ; if ( m < n ) return false ; Arrays . sort ( arr1 ) ; Arrays . sort ( arr2 ) ; while ( i < n && j < m ) { if ( arr1 [ j ] < arr2 [ i ] ) j ++ ; else if ( arr1 [ j ] == arr2 [ i ] ) { j ++ ; i ++ ; } else if ( arr1 [ j ] > arr2 [ i ] ) return false ; } if ( i < n ) return false ; else return true ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{7,10,10,10,13,17,23,24,25,28,30,33,37,49,49,50,57,60,60,63,63,64,65,65,72,81,84,85,85,94,96}); param0.add(new int[]{12,30,-94,-92,-62,-18,-56,44,-50,-92,6,2,56,-90,0,0,18,86,-58,58,-54,62,-94,94,0,8,82,-68,-88,-18,8,-80,-42,18,62,-8,56,-76,-42,56,44,-2,-20,62,-14,74,-86,-76}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{94,26,32,20,46,55,9,51,57,80,45,38,68,12,90,10,80,65,12,52,51,86,64,57,93,19,30,92,85,82,24,26,36,56}); param0.add(new int[]{-98,-90,-86,-86,-84,-84,-82,-80,-78,-72,-70,-68,-66,-64,-52,-52,-50,-38,-28,-26,-24,-14,-8,16,26,26,28,34,36,40,42,44,44,46,50,60,68,78,80,86,90,92,98}); param0.add(new int[]{1,0,1,0,1,0,0,0,1,0,0,0,0,1,1,0,1,1}); param0.add(new int[]{6,8,11,13,14,26,26,41,48,70,82,83,84,88,96}); param0.add(new int[]{-88,80,62,76,48,92,18,-94,-62,98,-46,-50,70,32,68,-54,26,16,94,0,-84,2,-16,88,26,-38,18,64,90,80,76,2,14,-90,50,4,76,30}); param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{54,44,97,92,13,54,27,8,43,70,77,84,55,64,5,59,27,19,65,68,66,26,33,38,7}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{10,13,17,63}); param1.add(new int[]{12, -18, 44}); param1.add(new int[]{0,0,0}); param1.add(new int[]{80,58,32,2}); param1.add(new int[]{-99,-90,-90,-86}); param1.add(new int[]{0,0,1,1}); param1.add(new int[]{1,9,12,16}); param1.add(new int[]{-76,-54,4,78}); param1.add(new int[]{0,1,0,1}); param1.add(new int[]{93,5,9,13}); List<Integer> param2 = new ArrayList<>(); param2.add(29); param2.add(46); param2.add(34); param2.add(17); param2.add(23); param2.add(10); param2.add(10); param2.add(27); param2.add(10); param2.add(19); List<Integer> param3 = new ArrayList<>(); param3.add(4); param3.add(3); param3.add(3); param3.add(4); param3.add(4); param3.add(4); param3.add(4); param3.add(4); param3.add(4); param3.add(4); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,483
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SORT_EVEN_PLACED_ELEMENTS_INCREASING_ODD_PLACED_DECREASING_ORDER.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SPLIT_ARRAY_ADD_FIRST_PART_END{ public static void f_gold ( int arr [ ] , int n , int k ) { for ( int i = 0 ; i < k ; i ++ ) { int x = arr [ 0 ] ; for ( int j = 0 ; j < n - 1 ; ++ j ) arr [ j ] = arr [ j + 1 ] ; arr [ n - 1 ] = x ; } } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{75}); param0.add(new int[]{-58,-60,-38,48,-2,32,-48,-46,90,-54,-18,28,72,86,0,-2,-74,12,-58,90,-30,10,-88,2,-14,82,-82,-46,2,-74}); param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{45,51,26,36,10,62,62,56,61,67,86,97,31,93,32,1,14,25,24,30,1,44,7,98,56,68,53,59,30,90,79,22}); param0.add(new int[]{-88,-72,-64,-46,-40,-16,-8,0,22,34,44}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,1,0,0,1,1,1,1,0}); param0.add(new int[]{8,17,20,23,31,32,37,37,44,45,48,64,64,67,69,71,75,77,78,81,83,87,89,92,94}); param0.add(new int[]{-8,-88,-68,48,8,50,30,-88,74,-16,6,74,36,32,22,96,-2,70,40,-46,98,34,2,94}); param0.add(new int[]{0,0,0,0,1,1,1,1,1}); param0.add(new int[]{80,14,35,25,60,86,45,95,32,29,94,6,63,66,38}); List<Integer> param1 = new ArrayList<>(); param1.add(0); param1.add(27); param1.add(7); param1.add(23); param1.add(6); param1.add(23); param1.add(21); param1.add(23); param1.add(5); param1.add(9); List<Integer> param2 = new ArrayList<>(); param2.add(0); param2.add(17); param2.add(7); param2.add(24); param2.add(6); param2.add(30); param2.add(20); param2.add(13); param2.add(8); param2.add(7); List<int [ ]> filled_function_param0 = new ArrayList<>(); filled_function_param0.add(new int[]{75}); filled_function_param0.add(new int[]{-58,-60,-38,48,-2,32,-48,-46,90,-54,-18,28,72,86,0,-2,-74,12,-58,90,-30,10,-88,2,-14,82,-82,-46,2,-74}); filled_function_param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1}); filled_function_param0.add(new int[]{45,51,26,36,10,62,62,56,61,67,86,97,31,93,32,1,14,25,24,30,1,44,7,98,56,68,53,59,30,90,79,22}); filled_function_param0.add(new int[]{-88,-72,-64,-46,-40,-16,-8,0,22,34,44}); filled_function_param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,1,0,0,1,1,1,1,0}); filled_function_param0.add(new int[]{8,17,20,23,31,32,37,37,44,45,48,64,64,67,69,71,75,77,78,81,83,87,89,92,94}); filled_function_param0.add(new int[]{-8,-88,-68,48,8,50,30,-88,74,-16,6,74,36,32,22,96,-2,70,40,-46,98,34,2,94}); filled_function_param0.add(new int[]{0,0,0,0,1,1,1,1,1}); filled_function_param0.add(new int[]{80,14,35,25,60,86,45,95,32,29,94,6,63,66,38}); List<Integer> filled_function_param1 = new ArrayList<>(); filled_function_param1.add(0); filled_function_param1.add(27); filled_function_param1.add(7); filled_function_param1.add(23); filled_function_param1.add(6); filled_function_param1.add(23); filled_function_param1.add(21); filled_function_param1.add(23); filled_function_param1.add(5); filled_function_param1.add(9); List<Integer> filled_function_param2 = new ArrayList<>(); filled_function_param2.add(0); filled_function_param2.add(17); filled_function_param2.add(7); filled_function_param2.add(24); filled_function_param2.add(6); filled_function_param2.add(30); filled_function_param2.add(20); filled_function_param2.add(13); filled_function_param2.add(8); filled_function_param2.add(7); for(int i = 0; i < param0.size(); ++i) { f_filled(filled_function_param0.get(i),filled_function_param1.get(i),filled_function_param2.get(i)); f_gold(param0.get(i),param1.get(i),param2.get(i)); if(Arrays.equals(param0.get(i), filled_function_param0.get(i)) && param1.get(i) == filled_function_param1.get(i) && param2.get(i) == filled_function_param2.get(i)) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,484
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_IF_A_NUMBER_IS_POWER_OF_ANOTHER_NUMBER_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_IF_A_NUMBER_IS_POWER_OF_ANOTHER_NUMBER_1{ static boolean f_gold ( int x , int y ) { int res1 = ( int ) Math . log ( y ) / ( int ) Math . log ( x ) ; double res2 = Math . log ( y ) / Math . log ( x ) ; return ( res1 == res2 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(57); param0.add(3); param0.add(10); param0.add(10); param0.add(6); param0.add(2); param0.add(2); param0.add(20); param0.add(96); param0.add(25); List<Integer> param1 = new ArrayList<>(); param1.add(1); param1.add(9); param1.add(101); param1.add(10000); param1.add(46656); param1.add(2048); param1.add(40); param1.add(79); param1.add(98); param1.add(5); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,485
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/POLICEMEN_CATCH_THIEVES.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class POLICEMEN_CATCH_THIEVES{ static int f_gold ( char arr [ ] , int n , int k ) { int res = 0 ; ArrayList < Integer > thi = new ArrayList < Integer > ( ) ; ArrayList < Integer > pol = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == 'P' ) pol . add ( i ) ; else if ( arr [ i ] == 'T' ) thi . add ( i ) ; } int l = 0 , r = 0 ; while ( l < thi . size ( ) && r < pol . size ( ) ) { if ( Math . abs ( thi . get ( l ) - pol . get ( r ) ) <= k ) { res ++ ; l ++ ; r ++ ; } else if ( thi . get ( l ) < pol . get ( r ) ) l ++ ; else r ++ ; } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<char [ ]> param0 = new ArrayList<>(); param0.add(new char[]{'A','B','B','D','E','E','F','G','G','G','I','J','O','P','Q','Q','Q','Q','R','R','S','U','X','Y','Y','c','d','h','i','i','i','i','k','k','l','l','l','l','m','p','r','r','s','t','t','u','x','z'}); param0.add(new char[]{'7','6','0','1','0','1'}); param0.add(new char[]{'0','0','0','0','0','0','0','0','0','1','1','1','1','1','1','1','1','1'}); param0.add(new char[]{'y','k','S','i','s','r','i','z','y','f','E','U','y','G','f','f','s','v','v','D','v','V','S','D','K','S','f','V','g','I','J','p','j','k','R','n','m','O','L','X','y','U','y','k','w'}); param0.add(new char[]{'1','1','5','8','8'}); param0.add(new char[]{'0','1','0','0','1','1','1','0','0','0','1','0','1','0','1','0','0','0','0','0','1','0','0','0','0','1','1','1','0','0','0','0','0','0'}); param0.add(new char[]{'A','I','K','Q','Q','X','Z','f','g'}); param0.add(new char[]{'7','0','6','9','7','5','1','3','9','8','0','0','1','3','9','2','5','5','2','7','9','3','3','9','3','8','5','5','0','4','6','2','7','4','0','4','6','4','2','3'}); param0.add(new char[]{'0','0','0','1','1','1','1','1','1','1','1'}); param0.add(new char[]{'D','C','P','H','G','o','u','P','T','G','E','U','n','E','U'}); List<Integer> param1 = new ArrayList<>(); param1.add(33); param1.add(3); param1.add(9); param1.add(24); param1.add(2); param1.add(23); param1.add(5); param1.add(35); param1.add(8); param1.add(11); List<Integer> param2 = new ArrayList<>(); param2.add(45); param2.add(3); param2.add(10); param2.add(44); param2.add(2); param2.add(18); param2.add(8); param2.add(28); param2.add(10); param2.add(12); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,486
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DYNAMIC_PROGRAMMING_SET_36_CUT_A_ROPE_TO_MAXIMIZE_PRODUCT_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DYNAMIC_PROGRAMMING_SET_36_CUT_A_ROPE_TO_MAXIMIZE_PRODUCT_1{ static int f_gold ( int n ) { if ( n == 2 || n == 3 ) return ( n - 1 ) ; int res = 1 ; while ( n > 4 ) { n -= 3 ; res *= 3 ; } return ( n * res ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(62); param0.add(53); param0.add(8); param0.add(6); param0.add(35); param0.add(35); param0.add(46); param0.add(74); param0.add(69); param0.add(3); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,487
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING{ static char f_gold ( String str ) { int len = str . length ( ) ; int count = 0 ; char res = str . charAt ( 0 ) ; for ( int i = 0 ; i < len ; i ++ ) { int cur_count = 1 ; for ( int j = i + 1 ; j < len ; j ++ ) { if ( str . charAt ( i ) != str . charAt ( j ) ) break ; cur_count ++ ; } if ( cur_count > count ) { count = cur_count ; res = str . charAt ( i ) ; } } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("geeekk"); param0.add("3786868"); param0.add("110"); param0.add("aaaabbcbbb"); param0.add("11"); param0.add("011101"); param0.add("WoHNyJYLC"); param0.add("3141711779"); param0.add("10111101101"); param0.add("aabbabababcc"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,488
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_NEGATIVE_NUMBERS_IN_A_COLUMN_WISE_ROW_WISE_SORTED_MATRIX.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_NEGATIVE_NUMBERS_IN_A_COLUMN_WISE_ROW_WISE_SORTED_MATRIX{ static int f_gold ( int M [ ] [ ] , int n , int m ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { if ( M [ i ] [ j ] < 0 ) count += 1 ; else break ; } } return count ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ] [ ]> param0 = new ArrayList<>(); param0.add(new int[][]{new int[]{31,92,57,28,79,84,92,19,31,71,91,46,60,79,82,4,70,82,41,79,80,29,26,76,92,18,94,55,46,69,67,60,85,25,11},new int[]{58,69,14,55,6,69,81,60,38,52,81,80,1,47,42,82,2,70,68,71,50,98,84,1,45,24,49,33,56,4,60,42,14,45,13},new int[]{28,92,91,71,75,97,30,9,76,94,55,84,76,38,32,7,73,49,37,76,41,3,89,56,71,99,71,25,94,37,43,9,89,55,55},new int[]{77,31,94,14,2,88,64,71,57,18,81,51,66,82,16,46,15,28,48,54,49,34,80,12,26,64,41,46,32,87,18,12,38,28,88},new int[]{84,93,86,10,92,89,62,65,33,66,92,52,28,49,98,37,49,91,42,64,43,12,83,61,51,11,80,35,28,50,35,1,31,81,77},new int[]{22,30,43,76,37,59,48,82,40,2,66,58,7,13,38,73,14,28,55,52,28,10,98,93,97,27,1,50,80,83,11,82,80,7,38},new int[]{54,30,50,31,57,2,73,56,24,35,85,99,28,51,83,86,82,30,72,98,40,81,15,5,18,76,62,5,50,37,99,46,31,16,66},new int[]{52,62,92,37,29,66,66,98,1,56,60,85,43,98,46,34,21,71,28,84,92,93,58,79,3,37,76,14,63,33,46,8,2,56,31},new int[]{70,69,43,26,58,80,60,28,24,79,42,80,16,52,17,93,25,16,77,35,39,16,77,19,45,27,96,44,30,88,76,6,18,2,33},new int[]{1,6,28,49,25,25,14,31,5,60,78,45,20,88,9,80,72,46,75,90,26,11,25,77,22,39,83,65,95,64,78,86,23,48,20},new int[]{98,5,39,62,57,87,52,68,32,98,90,99,67,81,94,96,15,44,13,17,47,35,84,14,23,69,5,96,42,42,65,60,10,10,88},new int[]{4,91,15,32,39,40,39,26,25,26,35,22,5,46,72,27,44,23,49,67,9,17,64,74,68,84,94,76,22,22,30,29,26,63,51},new int[]{10,53,32,7,39,74,91,85,79,47,47,11,54,51,43,75,19,74,33,27,15,29,96,96,87,83,62,32,79,62,43,62,97,87,16},new int[]{11,15,6,98,56,59,40,13,99,53,48,46,99,16,59,58,21,57,89,63,67,50,71,98,10,49,78,39,5,64,9,7,60,86,83},new int[]{94,9,64,64,80,70,1,77,15,64,69,43,40,56,82,28,15,92,40,38,61,74,32,1,95,30,5,43,1,8,57,5,5,97,54},new int[]{79,58,95,22,97,60,97,87,35,14,58,59,86,89,57,33,1,71,16,48,77,69,6,99,74,96,79,98,65,86,32,45,61,49,36},new int[]{19,37,45,27,48,21,83,82,96,85,83,54,37,22,38,43,45,28,84,91,38,16,58,46,48,20,61,8,90,66,42,47,65,60,15},new int[]{48,19,73,34,64,86,86,4,50,81,67,14,28,49,83,56,97,24,38,84,39,82,1,14,7,32,90,7,7,47,85,55,96,87,83},new int[]{70,68,59,18,72,95,7,62,53,22,82,64,72,3,24,52,26,41,30,19,47,55,13,10,69,54,93,42,44,49,72,18,29,70,85},new int[]{96,40,94,49,87,60,26,23,86,18,72,90,32,11,48,47,94,96,98,59,11,19,27,49,62,29,23,22,1,88,54,41,39,76,44},new int[]{45,99,44,67,5,80,36,33,89,52,2,49,74,36,7,14,57,67,62,97,22,92,44,2,65,67,58,91,56,84,53,49,11,13,24},new int[]{69,81,60,52,34,72,33,56,28,17,3,62,7,78,40,19,95,42,49,77,90,42,22,1,60,92,65,28,11,83,19,59,52,45,26},new int[]{23,17,21,54,31,32,81,15,13,65,62,16,21,70,6,84,5,91,37,20,89,73,3,65,86,24,27,11,98,92,54,23,9,1,90},new int[]{53,67,14,42,52,55,52,86,99,43,74,48,71,55,85,87,73,41,55,52,83,67,78,14,15,27,83,28,65,35,45,33,59,13,34},new int[]{29,4,17,82,11,18,95,71,10,34,79,43,45,58,9,26,84,9,49,6,63,41,43,75,35,54,55,18,81,55,2,53,1,67,87},new int[]{98,3,18,56,33,97,20,90,38,80,83,80,18,94,11,43,60,85,30,2,89,85,32,35,62,32,93,71,62,93,24,33,86,21,32},new int[]{38,45,16,40,18,67,71,49,46,98,64,83,35,78,40,86,28,66,77,24,31,10,82,1,31,9,47,39,84,51,1,6,32,4,63},new int[]{85,48,64,11,29,77,59,1,99,17,17,38,49,78,82,50,87,75,18,75,73,98,17,27,51,4,98,96,6,74,5,47,52,47,75},new int[]{36,68,16,99,38,84,45,71,71,36,3,97,69,15,48,77,6,4,33,36,67,65,52,55,37,35,76,69,98,84,62,5,80,15,36},new int[]{67,84,38,44,5,66,58,57,67,75,61,66,60,2,66,50,6,83,91,86,67,99,1,32,71,91,52,29,51,73,23,32,4,75,25},new int[]{24,94,50,60,28,73,99,1,10,37,54,96,56,46,19,9,57,78,19,70,76,25,14,87,13,22,63,73,97,3,19,39,16,36,22},new int[]{92,41,48,68,30,72,1,76,98,58,57,61,32,11,58,29,80,86,22,94,50,66,78,22,91,56,91,82,61,67,12,18,46,99,69},new int[]{49,64,35,55,67,78,11,71,12,98,10,9,82,35,61,40,29,10,83,11,63,16,97,97,96,91,30,97,21,91,32,61,27,33,35},new int[]{29,58,88,23,96,94,1,55,79,30,87,83,5,70,25,62,14,67,29,22,84,2,25,75,11,57,89,65,80,82,36,28,45,44,4},new int[]{70,94,49,13,26,24,42,24,58,83,41,6,50,78,22,12,21,84,70,28,44,51,78,75,9,70,37,23,60,25,68,97,49,17,27}}); param0.add(new int[][]{new int[]{22,49,27,1,69,48,44,18,89,36,93,10,67,18,7,62,55,3,84,76,49,57},new int[]{59,6,37,2,33,16,20,60,69,98,92,2,70,12,99,57,32,92,64,92,68,62},new int[]{41,89,70,69,62,88,52,23,8,37,77,87,54,44,87,32,53,29,38,80,68,32},new int[]{63,77,82,97,7,56,2,68,44,52,40,8,71,50,26,62,18,61,12,20,1,76},new int[]{44,47,86,67,53,27,80,57,53,74,7,11,86,58,7,55,30,57,23,97,38,33},new int[]{48,84,9,77,60,53,41,15,99,30,90,36,89,64,78,63,51,51,22,17,72,50},new int[]{14,56,77,30,59,64,26,22,86,92,80,88,63,46,81,3,81,64,14,72,14,77},new int[]{36,48,97,59,34,64,11,24,41,30,37,66,33,98,60,27,76,90,48,10,90,41},new int[]{76,54,4,86,40,31,85,51,38,72,28,12,35,99,78,12,13,49,34,33,21,83},new int[]{37,15,61,52,17,81,90,44,16,13,2,92,88,84,18,99,10,71,82,33,75,44},new int[]{40,49,88,11,67,52,39,2,92,49,52,31,77,97,51,31,66,98,66,37,25,62},new int[]{99,9,6,66,15,61,15,58,33,62,80,65,59,1,79,54,78,51,97,19,83,59},new int[]{3,76,87,47,71,66,86,18,79,62,44,67,5,82,94,27,48,2,88,34,55,46},new int[]{38,66,48,93,40,7,6,14,82,56,83,2,8,58,21,26,90,10,85,3,8,78},new int[]{54,43,93,86,42,41,87,70,67,60,90,78,66,42,30,57,76,2,30,24,12,49},new int[]{12,5,75,55,17,62,87,21,91,88,10,20,49,46,79,51,33,94,59,48,97,70},new int[]{49,75,21,53,2,92,14,80,92,40,84,67,39,48,53,49,68,57,14,58,97,9},new int[]{45,23,2,43,89,62,28,46,74,38,70,84,67,22,62,86,72,24,39,5,64,43},new int[]{28,93,44,61,47,23,52,97,62,31,98,1,63,7,86,46,66,61,24,14,15,62},new int[]{60,58,17,60,19,91,78,22,56,84,99,91,42,55,30,83,84,42,86,73,76,53},new int[]{95,93,92,53,56,72,31,67,4,61,39,88,64,94,48,88,23,54,37,10,18,67},new int[]{97,70,9,43,34,94,43,71,13,81,56,73,85,54,35,89,45,18,8,54,70,36}}); param0.add(new int[][]{new int[]{54,62,19,8,61,82,54,69,91,14,56,78,22,81,38,47},new int[]{22,25,33,85,89,78,7,42,24,24,24,74,89,83,23,1},new int[]{79,9,51,67,71,49,87,45,81,2,4,50,16,71,91,44},new int[]{77,99,85,40,90,45,3,54,39,69,40,88,81,41,84,24},new int[]{84,24,42,18,51,45,16,97,97,64,56,35,9,33,37,97},new int[]{61,55,53,21,5,1,71,23,87,71,59,83,27,77,9,9},new int[]{60,42,94,10,69,95,98,38,54,64,17,71,83,38,60,38},new int[]{2,45,33,60,92,31,55,48,31,19,79,9,81,47,4,38},new int[]{68,16,10,37,43,45,10,93,47,99,74,88,79,85,2,27},new int[]{69,72,66,74,32,60,90,70,88,68,15,72,65,35,87,75},new int[]{49,36,73,88,81,8,78,65,98,35,5,5,46,53,39,92},new int[]{5,39,16,95,34,59,36,19,80,5,69,39,26,45,15,11},new int[]{14,95,52,74,90,61,75,19,71,69,37,45,8,71,49,26},new int[]{71,95,22,95,95,48,53,75,96,68,82,99,9,15,4,54},new int[]{26,94,94,81,47,4,22,74,41,98,98,11,89,77,7,65},new int[]{47,37,49,52,68,83,51,70,32,47,60,93,61,10,21,42}}); param0.add(new int[][]{new int[]{39,79,41,68,91,31,87,47,16,92,42,68,79,59,17,45,68,78,99,19,51},new int[]{43,46,81,76,18,20,62,54,42,52,8,66,3,79,60,12,50,87,88,70,11},new int[]{49,2,91,98,51,74,47,72,32,42,92,52,98,89,9,91,86,38,78,89,42},new int[]{45,76,87,45,3,88,56,16,16,59,78,40,9,7,55,69,58,39,64,2,32},new int[]{65,45,40,81,13,71,33,46,27,47,92,5,9,75,80,2,90,50,40,4,1},new int[]{99,5,44,17,65,99,27,27,5,1,87,95,78,27,4,40,57,79,82,46,33},new int[]{99,3,6,49,52,24,66,91,66,84,92,96,48,24,81,69,46,58,16,49,83},new int[]{2,42,95,3,17,63,45,82,69,10,86,44,64,55,2,44,93,16,98,3,41},new int[]{27,2,95,31,58,64,21,14,90,14,86,42,84,47,4,82,70,47,97,1,49},new int[]{59,74,19,7,3,89,77,72,52,57,86,31,70,55,89,25,43,52,24,50,30},new int[]{89,57,9,45,89,74,76,89,23,90,57,77,38,25,49,3,85,90,90,26,47},new int[]{55,39,1,53,31,10,76,47,77,33,6,22,29,95,29,14,32,28,27,11,93},new int[]{95,75,56,23,21,30,76,98,25,79,41,3,63,87,96,53,92,40,74,22,8},new int[]{91,35,88,59,74,92,5,6,56,42,97,80,14,45,12,61,63,79,73,52,81},new int[]{73,86,4,14,11,1,47,35,12,99,37,31,61,86,60,17,28,82,3,18,20},new int[]{46,85,58,67,3,32,53,13,86,7,78,12,29,48,58,37,77,43,75,14,42},new int[]{38,93,44,22,94,76,29,63,20,19,51,57,53,11,9,63,24,43,51,11,37},new int[]{19,71,53,61,91,91,20,99,7,81,88,37,29,9,23,10,22,38,55,89,29},new int[]{62,33,81,98,9,79,80,50,63,67,64,95,69,84,22,4,98,71,1,81,77},new int[]{97,1,28,52,20,16,45,31,69,9,98,60,55,97,5,3,95,77,65,54,32},new int[]{71,97,30,68,74,7,15,99,62,39,20,55,30,22,20,31,54,31,93,10,80}}); param0.add(new int[][]{new int[]{48,19,66,15,8,54,8,66,22,72,93,33,96,26,89,57,86,16,99,75,9,20,36,26},new int[]{67,60,72,35,68,26,18,53,54,82,23,15,89,43,82,1,33,46,61,87,93,27,33,21},new int[]{7,78,68,44,49,95,1,16,16,7,1,92,3,44,47,52,31,61,41,28,95,28,51,46},new int[]{98,90,93,45,10,2,88,20,1,67,2,75,27,31,68,59,11,50,4,40,5,61,34,24},new int[]{41,37,20,59,32,13,84,27,58,17,40,54,43,7,30,97,90,6,40,68,95,99,2,81},new int[]{83,50,27,89,94,39,35,9,45,45,9,20,25,12,36,18,74,75,69,66,37,82,16,25},new int[]{84,20,8,12,15,79,41,13,81,39,48,76,65,89,70,85,93,48,51,16,87,37,30,96},new int[]{29,45,15,54,15,54,4,36,9,81,22,74,25,17,61,80,78,70,39,46,14,16,69,43},new int[]{32,81,24,3,19,56,37,2,42,2,87,90,14,41,50,66,5,32,83,72,62,16,87,46},new int[]{17,7,38,46,97,72,9,17,32,80,47,15,20,21,61,28,11,12,34,86,11,50,98,66},new int[]{32,52,6,16,31,72,58,64,21,10,33,37,34,32,34,21,44,82,82,66,70,99,50,6},new int[]{90,84,81,74,86,24,34,66,16,89,58,92,98,12,71,74,6,9,35,41,32,78,1,42},new int[]{1,24,27,69,79,52,11,85,7,66,11,24,90,72,98,15,37,33,36,68,16,69,66,62},new int[]{25,97,59,93,94,2,46,61,60,24,19,21,7,91,93,19,1,84,70,46,19,36,44,31},new int[]{97,67,2,88,1,15,75,35,48,69,72,53,90,75,74,59,8,53,39,29,4,44,92,24},new int[]{87,84,38,81,81,71,32,87,72,23,34,6,88,33,56,25,31,28,89,50,14,55,1,7},new int[]{85,64,80,66,71,99,62,53,87,71,86,59,74,85,68,31,38,34,36,14,13,95,81,47},new int[]{25,70,61,78,68,26,23,57,84,61,14,22,40,83,68,29,75,21,54,92,47,29,47,64},new int[]{43,12,8,16,12,80,76,31,22,96,74,64,30,54,39,60,13,8,44,80,56,45,58,28},new int[]{54,12,30,68,79,24,78,79,64,33,40,44,74,50,31,94,44,42,57,4,82,66,27,77},new int[]{80,2,92,92,97,18,55,73,34,26,1,11,3,3,51,13,49,65,70,8,33,88,93,97},new int[]{34,96,94,8,28,58,22,8,60,57,86,16,84,63,21,84,59,83,75,46,95,54,52,16},new int[]{81,18,98,77,20,14,13,18,2,86,46,48,49,26,69,54,63,76,97,11,39,58,75,87},new int[]{36,48,94,97,96,39,34,90,17,48,72,39,85,40,63,85,41,55,23,76,39,21,52,27}}); param0.add(new int[][]{new int[]{45,42,10,70,41,89,22,51,39,46,25,16,53,79,40,94,32,42,36,72,38,23,87,9,24},new int[]{76,21,4,75,31,69,97,57,38,25,98,78,51,37,19,29,73,57,81,83,82,19,25,93,80},new int[]{72,9,91,68,96,53,68,30,52,70,80,60,61,53,25,30,10,36,92,15,19,75,83,54,57},new int[]{6,31,21,12,97,20,53,80,76,41,42,1,9,89,35,3,68,29,20,29,18,86,67,21,83},new int[]{45,46,53,3,55,32,40,51,40,54,89,93,81,5,93,28,7,19,84,62,21,53,55,16,25},new int[]{55,37,70,58,26,71,89,81,11,29,66,99,82,2,86,91,47,90,30,45,70,62,10,13,77},new int[]{48,68,68,43,69,27,80,39,88,28,70,36,19,79,86,11,53,74,99,77,37,88,97,66,7},new int[]{58,69,76,76,50,29,40,47,2,67,12,42,27,27,57,48,77,49,93,24,83,27,81,1,58},new int[]{78,82,51,58,67,53,97,94,77,33,98,18,66,87,96,50,77,8,62,21,71,87,83,56,54},new int[]{95,45,29,19,52,65,12,58,38,50,80,27,80,31,66,35,68,51,47,96,62,94,22,66,21},new int[]{23,29,38,27,67,30,52,15,90,85,25,67,51,91,92,71,81,17,79,50,23,80,29,64,74},new int[]{7,79,94,85,6,82,98,69,37,93,82,93,76,94,87,93,84,7,67,18,27,70,98,25,62},new int[]{64,31,65,86,15,8,13,23,35,54,57,62,45,50,20,81,58,34,69,35,94,13,44,78,48},new int[]{98,25,26,89,53,89,20,20,51,54,76,28,55,45,75,86,90,29,41,19,1,63,17,51,5},new int[]{26,68,55,36,33,15,92,63,9,53,97,63,9,63,95,8,28,74,58,57,35,66,56,17,40},new int[]{40,73,83,78,5,28,71,97,66,84,47,47,13,92,99,71,15,17,86,19,74,33,17,63,20},new int[]{59,14,65,17,39,59,61,95,62,32,33,39,88,49,87,11,17,32,19,11,61,95,75,50,5},new int[]{81,34,42,39,28,11,20,98,60,26,2,8,64,10,55,94,24,66,88,13,81,37,99,83,83},new int[]{92,18,41,52,83,78,53,87,26,47,14,97,91,45,77,37,39,22,1,46,52,42,8,99,17},new int[]{30,40,15,66,32,80,35,5,90,6,56,30,51,33,48,74,9,51,58,46,32,47,59,97,33},new int[]{60,14,19,5,98,49,4,94,66,59,44,28,35,60,12,80,80,6,42,99,7,35,72,76,60},new int[]{73,83,80,67,93,71,52,2,91,88,30,12,70,74,88,4,21,65,12,79,48,25,8,85,82},new int[]{20,75,62,20,10,71,60,52,34,17,58,88,64,3,37,52,35,20,9,20,80,36,15,94,88},new int[]{19,47,94,21,5,37,13,40,74,87,17,48,9,65,96,33,68,25,72,43,85,50,70,82,80},new int[]{21,88,58,48,84,38,37,33,92,56,16,71,9,50,45,66,61,61,93,37,97,36,38,3,2}}); param0.add(new int[][]{new int[]{67,61,32,22,31,43,25,63,3,92,10,14,64,23,61,58,67,98,19,25,98,71,41,23,17,63,20,17,59,89,92,20,28,94,38,41,20,63,67,88,68,90,50,64},new int[]{64,48,46,95,50,42,25,50,77,30,3,62,81,31,11,99,52,24,70,86,98,27,53,71,24,84,1,34,70,51,75,57,37,14,83,21,82,88,4,56,88,66,31,88},new int[]{48,68,58,58,7,23,44,49,84,87,89,22,42,4,57,60,36,54,69,3,61,82,14,41,37,69,76,30,78,74,93,79,82,44,6,66,37,80,98,20,32,13,99,73},new int[]{58,86,91,80,4,35,46,27,79,87,94,34,24,22,21,94,16,72,91,70,53,66,64,42,71,31,36,77,70,65,39,22,43,41,23,85,20,32,77,9,16,11,88,71},new int[]{6,33,85,2,73,8,3,3,48,45,21,63,77,46,71,47,54,93,40,56,95,77,13,51,43,58,18,26,96,63,62,69,60,72,47,74,44,77,17,9,7,69,5,90},new int[]{25,49,72,10,59,4,11,43,79,15,66,50,59,42,72,57,13,65,74,93,90,52,34,26,12,43,34,6,63,27,47,45,4,96,51,21,74,91,12,21,34,94,55,75},new int[]{72,45,43,54,9,93,57,13,59,90,47,16,78,82,98,94,7,98,40,70,57,83,42,6,36,60,96,11,38,36,79,5,24,84,35,70,61,3,54,64,58,65,54,80},new int[]{91,61,97,86,81,18,9,66,58,55,73,86,13,95,10,49,12,98,97,85,47,37,67,62,12,25,51,69,77,47,91,66,85,74,69,10,96,66,41,30,95,43,66,31},new int[]{57,50,96,40,96,8,25,10,88,47,54,54,55,72,77,60,97,87,5,30,24,1,96,95,81,89,42,65,69,34,88,37,4,48,10,74,44,55,84,76,72,17,97,38},new int[]{93,52,95,81,54,74,7,40,98,99,79,39,14,58,72,9,66,11,67,77,74,83,75,31,82,67,80,80,18,26,84,61,36,3,13,22,16,87,55,13,42,19,95,3},new int[]{83,10,52,84,97,72,53,18,85,10,1,53,96,7,57,14,27,77,15,86,12,46,59,23,30,58,63,68,19,94,4,57,25,33,17,97,88,80,10,24,13,55,71,6},new int[]{97,7,58,88,38,52,32,12,93,50,58,97,24,85,77,91,52,10,56,18,61,85,58,7,7,64,22,81,94,60,42,68,84,76,83,50,28,82,89,27,96,43,28,39},new int[]{86,3,88,2,33,97,8,15,40,94,84,9,62,6,39,47,9,10,29,6,52,78,87,4,64,20,85,7,89,8,50,83,4,49,72,44,24,49,21,72,64,84,39,51},new int[]{88,80,76,94,47,13,29,30,85,20,85,92,78,2,59,7,87,24,86,83,25,8,26,22,93,56,74,19,9,7,71,65,79,25,76,63,87,93,44,16,76,92,98,85},new int[]{67,42,81,11,30,32,64,67,30,8,22,70,35,47,5,35,89,82,31,98,42,50,87,99,18,24,35,81,40,11,83,52,16,69,53,97,73,16,37,2,32,60,86,89},new int[]{39,47,27,27,81,67,65,76,8,75,27,21,44,48,61,94,42,22,46,15,95,97,57,9,61,78,74,13,48,48,89,91,37,2,8,85,19,56,27,22,26,19,49,94},new int[]{87,67,37,46,62,40,85,22,73,99,51,36,99,47,43,13,37,91,58,71,90,93,73,15,92,84,1,59,3,84,36,66,8,23,16,88,79,43,52,10,15,69,24,23},new int[]{19,47,92,46,24,53,91,58,15,30,46,82,43,65,88,68,18,90,24,35,41,69,48,53,48,86,65,75,2,87,89,40,26,3,95,2,24,32,37,57,85,94,77,81},new int[]{24,26,2,36,32,10,44,77,59,11,15,98,12,47,70,44,18,7,6,16,67,23,3,51,51,82,86,6,18,53,49,25,22,42,99,83,90,85,66,22,22,26,15,24},new int[]{84,24,11,3,88,47,6,60,25,92,84,11,42,25,81,18,81,43,8,85,79,27,99,5,16,66,79,14,73,78,29,74,15,95,13,79,39,36,79,60,6,85,36,81},new int[]{6,20,9,7,85,83,50,31,90,91,7,38,20,26,15,14,53,49,7,9,15,17,94,18,88,63,22,34,26,66,54,30,9,19,53,11,13,5,32,51,35,48,82,63},new int[]{80,96,47,59,1,91,84,75,95,31,43,32,70,34,95,54,13,49,27,73,50,69,29,75,17,50,88,42,76,95,51,19,87,34,91,20,90,5,64,2,34,54,76,46},new int[]{85,70,55,7,39,24,41,60,89,74,2,18,50,75,96,84,1,97,18,1,42,23,17,59,98,44,49,83,50,50,77,37,12,56,32,67,72,6,32,65,7,76,52,54},new int[]{46,45,14,49,65,22,4,3,28,21,43,19,1,35,31,50,67,46,65,44,74,3,76,27,84,74,66,97,14,21,32,93,45,27,57,51,9,72,27,50,44,45,11,69},new int[]{25,24,88,33,90,89,56,49,69,69,2,85,95,78,79,51,46,26,20,99,3,99,2,27,82,59,24,57,68,94,17,26,10,19,86,24,50,44,28,5,69,23,68,9},new int[]{29,5,31,57,47,89,65,37,32,54,64,70,48,19,50,88,88,84,33,84,1,42,43,83,90,64,72,8,58,80,33,96,4,53,84,58,29,70,24,96,36,37,58,97},new int[]{73,47,38,22,77,37,38,22,3,57,14,27,59,24,68,68,87,94,5,32,97,26,52,90,46,65,69,14,33,66,63,70,57,80,82,89,77,15,79,91,75,67,4,53},new int[]{88,3,45,71,71,2,27,68,22,59,58,47,89,82,74,10,32,24,74,68,36,20,98,83,34,6,75,36,26,7,74,98,19,61,86,16,86,51,46,46,81,59,39,79},new int[]{84,11,50,52,59,41,98,62,3,23,91,15,83,4,37,36,77,97,66,19,37,92,79,32,18,50,53,1,71,28,95,7,12,11,80,78,81,11,98,92,28,5,23,49},new int[]{37,57,14,93,49,66,35,63,83,84,19,20,17,16,83,21,28,29,7,10,70,55,54,24,86,85,8,83,27,87,63,46,45,39,8,18,78,75,6,2,67,33,2,58},new int[]{9,52,26,95,57,4,49,80,60,90,39,83,14,49,22,99,7,72,62,11,76,99,33,93,90,53,20,47,23,89,5,22,16,89,40,89,54,22,74,51,11,21,79,80},new int[]{66,12,85,75,41,2,23,46,57,90,45,32,77,74,90,73,75,22,3,13,94,89,2,12,64,4,45,21,35,45,33,44,86,86,44,40,97,51,30,46,76,20,76,5},new int[]{35,15,99,54,22,51,23,42,37,47,90,34,11,50,32,78,42,54,28,28,36,5,51,45,44,47,83,48,5,38,98,73,97,72,81,45,40,94,51,1,35,63,69,48},new int[]{53,69,64,24,50,8,77,80,54,15,52,5,17,55,80,35,7,80,14,91,34,30,61,99,59,39,32,18,39,1,26,75,2,8,46,63,24,99,97,23,86,58,77,61},new int[]{79,15,11,8,31,31,21,37,12,64,24,38,23,39,91,48,23,67,55,62,56,10,62,3,96,60,54,42,63,18,5,74,32,19,49,7,47,13,9,66,50,89,49,17},new int[]{9,14,44,11,27,85,41,71,76,60,29,15,82,35,91,54,31,26,34,47,8,46,85,99,61,50,15,25,66,7,16,69,11,72,90,17,6,94,12,34,47,62,88,96},new int[]{7,41,81,66,10,11,72,78,94,4,11,45,73,25,88,38,25,50,2,14,98,86,3,84,7,84,29,7,7,97,15,23,70,10,19,14,25,96,64,64,33,8,15,97},new int[]{31,90,82,65,98,19,90,90,7,1,20,19,39,39,56,30,94,65,43,74,12,89,81,28,16,88,54,74,31,91,44,52,80,13,95,62,10,10,79,91,71,31,66,92},new int[]{87,2,17,28,71,7,17,37,37,72,2,25,25,35,64,95,66,69,90,63,34,16,80,77,41,78,25,9,99,3,62,17,2,79,16,82,83,67,97,49,76,32,25,32},new int[]{22,53,6,71,49,38,44,43,77,95,28,19,76,12,82,48,91,25,66,50,78,28,44,69,26,83,25,15,96,20,77,1,33,88,8,38,28,79,34,34,29,78,9,52},new int[]{44,10,43,22,19,24,34,3,14,37,37,30,87,48,75,99,84,99,18,65,52,93,64,90,73,91,11,23,40,72,7,61,98,11,8,42,32,86,40,21,19,90,95,52},new int[]{12,51,98,82,51,4,86,40,74,1,82,26,56,54,89,81,38,73,25,18,3,95,8,86,38,6,55,56,65,40,88,40,68,41,84,40,93,7,16,79,5,52,20,71},new int[]{56,34,12,72,32,49,62,57,25,69,16,51,76,23,40,41,15,39,77,63,63,22,95,86,73,26,28,44,35,92,42,52,7,23,71,88,92,99,44,4,81,78,51,69},new int[]{29,17,82,37,10,15,25,54,37,30,60,73,16,85,56,98,42,99,14,46,78,50,72,61,72,4,39,99,71,55,50,46,80,21,96,49,47,10,70,29,60,16,24,60}}); param0.add(new int[][]{new int[]{10,67,53,58,73,24,62,89,36,84,54,60,46,96,96,92,26,82,97,63},new int[]{48,41,1,86,53,43,18,90,36,96,15,29,95,85,70,25,86,25,26,76},new int[]{62,70,29,37,26,52,66,37,64,30,55,90,77,26,1,91,73,37,75,10},new int[]{37,25,56,27,77,68,12,12,31,9,54,8,6,38,8,59,80,17,35,10},new int[]{84,63,29,21,63,58,6,76,14,43,20,88,95,82,81,30,36,53,41,35},new int[]{12,20,52,81,63,57,16,97,91,89,19,62,95,56,54,13,6,61,67,86},new int[]{88,77,55,5,57,19,14,94,46,2,65,49,64,86,45,54,89,67,3,90},new int[]{46,18,40,16,53,95,61,90,34,18,86,6,99,4,42,20,33,87,51,81},new int[]{91,94,23,19,60,94,94,16,43,45,94,78,23,79,86,82,70,15,79,60},new int[]{43,54,93,45,56,71,75,98,99,22,35,76,48,98,67,29,12,97,37,77},new int[]{33,63,58,43,8,94,28,18,4,11,80,38,35,67,48,41,4,21,62,17},new int[]{48,23,50,36,84,41,78,91,78,38,72,52,41,21,14,53,32,43,1,65},new int[]{22,5,5,11,55,80,64,98,49,41,77,61,75,48,65,51,4,2,54,55},new int[]{36,33,97,47,39,18,23,11,93,47,58,76,33,76,18,21,22,53,87,72},new int[]{77,9,31,43,61,78,92,74,94,66,63,54,94,39,5,91,5,36,7,87},new int[]{10,50,16,13,94,93,26,48,80,23,56,93,85,46,16,37,73,86,50,41},new int[]{1,49,47,8,53,12,8,62,90,60,29,61,87,81,87,76,59,44,72,79},new int[]{9,63,35,78,26,57,4,37,95,93,13,52,40,76,28,9,94,80,76,96},new int[]{48,39,62,36,11,9,59,79,23,73,62,64,5,77,9,1,51,66,91,53},new int[]{38,84,93,19,79,34,77,87,14,83,86,10,36,65,98,5,78,15,66,87}}); param0.add(new int[][]{new int[]{77,56,21,16,3,4,66,99,72,94,34,33,76,11,85,89,9,74},new int[]{19,31,23,11,31,52,97,53,56,6,28,4,68,74,92,14,90,64},new int[]{61,79,82,4,63,17,35,22,53,84,18,49,57,77,67,52,63,50},new int[]{15,14,6,59,1,21,5,46,43,70,54,51,90,94,92,97,91,53},new int[]{91,42,70,95,16,16,29,89,52,60,1,60,39,54,48,71,94,69},new int[]{4,86,36,45,15,74,86,35,5,55,14,51,81,76,76,67,32,1},new int[]{79,1,94,83,6,91,26,32,55,77,17,90,37,99,68,40,44,87},new int[]{63,57,15,2,26,35,92,15,16,53,14,4,49,99,18,47,35,85},new int[]{72,52,11,94,54,45,98,39,94,4,68,72,6,18,94,33,61,22},new int[]{20,62,47,73,41,88,83,88,96,73,4,67,28,91,11,56,95,15},new int[]{32,29,44,46,61,48,51,64,59,47,49,17,30,75,30,10,58,76},new int[]{96,46,69,13,88,44,82,58,93,96,43,51,91,86,68,72,6,83},new int[]{84,40,99,55,58,57,32,5,30,83,30,27,50,42,56,11,18,88},new int[]{3,94,46,14,38,91,36,62,80,54,62,60,83,93,97,4,38,36},new int[]{70,84,86,57,43,23,7,59,5,24,12,37,49,10,82,83,45,71},new int[]{25,75,55,79,31,96,47,61,25,1,66,12,16,46,84,52,57,50},new int[]{86,98,54,8,35,6,85,99,58,48,49,76,29,36,82,77,72,68},new int[]{95,53,87,51,41,30,56,16,31,33,48,91,17,90,47,59,75,7}}); param0.add(new int[][]{new int[]{34,1,55,60,18,68,91,6,94,26,74,59,4,58,39,76,49,81,16,6,76,4,89,24,75,14,42,58,50,97,13,37,17,12,49,87,66,41,35,8,92,76,97,76,87,34,31,98},new int[]{90,60,31,75,59,62,78,99,32,64,98,14,13,54,62,66,71,90,8,14,79,19,22,89,55,57,14,64,90,48,26,49,5,1,92,2,25,59,49,62,56,24,79,60,70,18,93,11},new int[]{27,45,53,94,75,27,40,42,87,55,73,75,86,13,77,16,41,8,30,71,34,11,70,90,59,4,86,38,9,17,5,44,39,49,47,16,80,5,84,77,73,65,33,67,90,10,6,91},new int[]{86,24,6,58,22,53,14,6,38,5,94,58,77,96,52,88,57,76,19,80,52,61,41,25,6,42,34,25,77,58,12,1,45,42,67,9,8,53,79,53,54,34,69,21,68,49,86,9},new int[]{71,11,83,90,39,31,56,64,69,40,91,57,59,4,97,70,27,33,85,21,17,82,10,16,12,99,89,82,34,40,70,53,88,77,18,15,99,93,62,25,3,98,9,43,46,16,16,88},new int[]{43,71,10,81,76,35,37,17,59,7,86,34,53,27,4,49,61,89,73,14,38,7,63,73,8,78,29,28,62,72,25,54,89,86,99,15,59,29,57,67,67,18,72,85,51,76,69,43},new int[]{19,57,50,26,95,65,89,97,97,20,48,74,57,29,79,66,4,42,67,73,55,90,58,46,34,44,78,6,28,68,61,76,22,1,25,9,81,17,79,54,83,80,43,39,13,31,75,52},new int[]{46,21,43,57,20,54,26,30,88,15,65,17,37,49,52,84,81,57,72,89,46,79,89,42,20,8,76,45,34,18,90,24,36,70,80,18,22,58,93,92,95,72,95,46,36,65,5,16},new int[]{7,96,69,10,42,76,23,25,73,93,61,72,85,70,34,77,36,83,88,75,23,33,71,63,69,60,54,89,68,56,30,47,99,22,17,95,68,42,67,96,39,90,3,71,75,5,19,43},new int[]{23,91,35,60,60,78,49,80,78,42,86,42,3,2,7,45,57,84,49,35,91,16,39,51,34,1,99,57,36,18,34,44,62,84,41,15,78,78,46,33,39,2,75,79,7,90,99,34},new int[]{70,61,64,66,92,86,11,85,26,99,11,10,32,72,3,52,21,2,52,25,17,69,22,9,97,65,79,90,93,46,84,33,33,84,3,52,70,18,15,3,90,70,7,77,78,90,41,95},new int[]{20,62,11,12,16,66,64,45,10,33,79,52,34,17,57,47,24,37,57,89,74,63,38,59,50,90,27,60,63,72,89,24,76,42,82,30,69,30,22,49,83,29,26,70,57,48,54,40},new int[]{81,50,53,62,11,44,96,77,7,23,22,15,77,77,46,22,86,98,62,44,30,3,55,64,92,18,22,78,1,64,39,45,25,91,23,92,37,47,66,54,43,68,4,61,21,21,3,73},new int[]{94,88,19,88,94,42,38,60,83,36,92,52,72,89,53,52,25,28,49,77,42,75,80,46,15,80,40,51,58,89,4,19,54,66,39,40,12,13,5,92,86,37,85,72,6,60,55,36},new int[]{18,28,83,83,52,63,61,28,18,14,98,53,76,8,4,98,33,29,61,12,29,99,51,31,1,74,14,37,22,77,69,41,77,87,8,46,25,20,60,8,54,69,88,52,70,89,45,69},new int[]{98,51,93,91,42,33,87,62,1,31,5,12,37,87,29,40,59,11,1,46,78,82,90,6,23,98,90,79,36,87,83,25,61,89,11,63,3,11,96,98,23,81,62,83,79,4,43,54},new int[]{61,26,32,69,69,62,95,36,41,46,32,98,62,43,49,22,33,88,36,29,15,9,30,74,96,77,41,13,86,43,96,50,91,46,29,26,84,89,49,52,10,27,8,57,55,36,54,82},new int[]{89,6,53,46,51,50,49,69,7,38,53,96,84,23,13,62,40,35,12,41,38,72,72,40,83,57,2,58,18,42,20,51,71,11,71,93,53,16,35,17,8,99,57,39,99,14,22,7},new int[]{98,11,25,47,36,80,96,77,93,84,52,25,14,19,13,98,75,70,94,27,87,53,8,31,1,41,31,75,51,36,69,43,2,12,19,77,7,89,61,96,99,5,10,99,78,67,98,94},new int[]{61,48,23,56,86,87,32,87,39,93,86,41,48,32,8,80,31,54,77,48,8,28,31,73,48,84,32,4,45,7,19,34,91,36,13,9,50,83,9,50,90,79,78,15,37,80,52,99},new int[]{27,5,64,47,73,88,29,61,88,91,99,44,25,93,77,80,76,95,27,59,98,97,69,99,5,58,7,16,74,43,48,59,4,33,36,75,10,73,60,48,85,35,77,61,26,61,65,30},new int[]{39,84,58,47,4,37,53,41,54,75,98,50,98,36,16,95,85,32,63,45,70,40,92,81,30,76,41,21,86,71,13,56,48,13,36,5,39,5,21,44,87,31,26,28,34,65,75,8},new int[]{8,89,99,81,99,51,90,59,75,96,23,49,29,63,15,86,50,26,51,55,45,89,88,49,62,92,52,78,58,53,63,84,45,43,52,3,12,42,4,87,81,32,52,44,79,1,62,63},new int[]{77,11,44,2,2,81,31,15,15,58,6,90,84,99,95,64,67,21,92,22,97,35,13,77,37,46,9,92,10,26,90,94,25,57,4,36,61,97,1,18,86,32,8,67,81,70,48,90},new int[]{17,69,7,39,49,60,41,58,75,85,89,62,11,55,85,37,20,24,80,36,68,75,94,3,11,42,5,43,75,76,16,78,79,61,67,78,79,61,8,24,66,31,97,35,91,33,31,60},new int[]{25,42,49,77,52,3,53,62,34,91,21,85,24,73,60,10,55,97,7,73,41,39,86,40,58,76,9,12,7,91,32,43,48,95,55,71,39,41,26,61,30,98,89,39,14,40,6,76},new int[]{64,99,34,93,26,89,72,1,31,68,93,46,44,96,88,92,6,70,68,33,83,39,15,42,70,86,53,78,23,9,15,10,17,71,96,22,8,40,90,94,32,95,90,7,13,49,4,97},new int[]{53,17,23,66,81,12,48,28,48,71,54,35,93,21,87,34,50,17,17,1,14,27,15,35,23,32,21,56,52,43,45,38,74,52,28,40,51,99,72,47,82,78,9,16,44,94,38,90},new int[]{52,48,12,76,55,89,94,97,52,99,1,29,41,1,78,43,86,16,93,29,25,83,83,78,71,57,98,19,19,25,13,55,52,95,75,14,28,38,93,88,69,53,20,44,67,57,94,7},new int[]{34,46,56,14,19,41,73,18,96,99,45,82,1,93,51,80,5,20,14,29,96,16,92,18,17,12,87,77,65,70,46,90,32,53,56,69,50,50,92,52,84,42,58,11,90,80,55,66},new int[]{2,35,27,4,13,85,68,1,21,62,1,95,16,32,19,80,37,81,6,97,44,95,55,88,35,16,75,35,57,81,89,9,41,68,53,58,80,86,84,43,65,69,23,32,13,36,52,5},new int[]{11,74,57,15,92,66,10,83,98,58,32,95,13,66,39,33,23,18,86,90,85,5,96,2,40,17,19,7,39,32,70,90,39,2,69,57,20,47,81,20,52,81,17,91,72,17,20,98},new int[]{96,37,13,9,80,60,58,46,62,79,36,48,34,6,44,30,56,94,34,79,76,89,60,3,18,8,45,95,68,5,9,82,8,34,20,27,34,34,12,15,58,59,80,76,10,65,36,39},new int[]{20,10,39,70,21,21,80,89,99,42,40,67,73,18,16,74,33,92,22,28,13,19,81,38,52,70,41,39,13,87,53,61,48,43,31,14,22,19,39,95,61,49,6,36,61,15,81,53},new int[]{68,26,46,53,96,87,73,7,35,56,89,41,58,24,14,4,24,77,76,47,19,60,85,1,87,60,89,88,20,60,57,56,11,54,90,85,79,63,37,33,11,6,12,9,16,41,68,52},new int[]{44,20,66,30,16,72,15,3,31,32,69,93,77,43,50,63,72,42,98,28,49,9,34,49,65,89,80,31,67,12,75,27,60,65,36,96,86,70,2,39,63,46,95,40,10,99,27,22},new int[]{67,2,94,6,87,53,8,87,36,39,72,59,85,60,19,36,71,71,16,48,68,35,3,99,81,31,40,45,49,33,54,69,75,78,7,60,5,5,42,57,94,75,9,32,83,1,49,15},new int[]{23,31,16,78,68,20,21,55,59,71,90,72,43,2,79,11,93,64,19,21,84,89,93,1,20,5,39,77,81,82,19,44,59,71,7,63,79,94,37,63,89,52,52,30,61,22,33,3},new int[]{98,99,44,46,75,2,87,79,39,85,80,76,21,22,67,46,88,94,32,43,27,41,31,99,15,25,99,66,55,92,11,18,14,36,43,12,9,50,43,97,25,60,9,70,12,43,95,87},new int[]{51,61,10,97,97,32,40,18,14,90,39,1,57,62,52,51,35,94,48,63,72,16,85,24,1,66,61,7,17,50,82,31,72,83,95,15,57,99,65,51,18,73,76,94,35,73,36,84},new int[]{22,73,81,80,43,73,95,3,24,5,42,31,49,54,97,53,69,25,48,67,39,98,83,83,55,74,45,83,78,15,95,56,94,80,42,38,95,71,49,94,7,7,47,13,45,25,50,64},new int[]{88,80,68,97,95,56,44,59,2,30,62,54,47,2,56,68,22,87,81,71,73,80,64,87,34,29,71,98,22,64,78,29,90,15,25,66,39,92,91,75,79,11,35,57,95,74,13,27},new int[]{23,99,14,62,52,33,98,58,62,13,77,21,34,36,81,40,1,1,71,59,2,85,35,50,48,62,24,24,79,26,14,52,93,76,88,98,10,34,45,73,51,31,22,19,64,95,6,8},new int[]{20,88,73,46,27,35,76,10,38,80,58,26,3,72,29,45,46,12,91,23,9,15,33,15,24,14,40,73,14,4,89,78,40,11,59,76,77,80,33,3,61,1,54,65,89,53,54,38},new int[]{22,73,56,45,75,2,10,5,88,72,42,34,24,12,52,23,48,69,19,77,35,8,76,85,49,92,76,5,13,54,49,58,15,45,96,72,81,64,54,82,87,4,60,23,8,95,40,13},new int[]{95,49,45,39,82,36,91,66,26,2,33,80,4,55,32,81,61,7,79,83,56,67,67,5,49,20,3,61,23,16,10,64,62,36,79,74,49,67,64,14,84,29,68,52,62,39,54,50},new int[]{75,71,26,55,45,54,26,94,10,44,68,30,12,87,47,72,92,85,25,78,33,42,90,33,45,50,61,14,82,61,26,81,58,4,88,69,5,91,3,24,90,88,42,52,96,54,6,49},new int[]{56,17,62,40,7,94,96,82,92,15,68,71,56,47,5,7,63,28,76,93,25,71,47,20,77,48,95,3,69,77,77,50,60,66,91,75,1,11,13,39,30,7,89,19,80,22,75,68}}); List<Integer> param1 = new ArrayList<>(); param1.add(22); param1.add(12); param1.add(12); param1.add(18); param1.add(20); param1.add(24); param1.add(30); param1.add(15); param1.add(16); param1.add(35); List<Integer> param2 = new ArrayList<>(); param2.add(27); param2.add(18); param2.add(8); param2.add(12); param2.add(18); param2.add(15); param2.add(36); param2.add(14); param2.add(10); param2.add(31); for(int i =0; i < param0.size(); ++i ){ for(int j =0; j < param0.get(i).length; ++j ){ Arrays.sort(param0.get(i)[j]); for(int k =0; k < param0.get(i)[j].length; ++k){ param0.get(i)[j][k]-=50; } } } for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,489
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMIZE_VOLUME_CUBOID_GIVEN_SUM_SIDES_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMIZE_VOLUME_CUBOID_GIVEN_SUM_SIDES_1{ static int f_gold ( int s ) { int length = s / 3 ; s -= length ; int breadth = s / 2 ; int height = s - breadth ; return length * breadth * height ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(8); param0.add(96); param0.add(96); param0.add(96); param0.add(12); param0.add(95); param0.add(72); param0.add(81); param0.add(42); param0.add(13); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,490
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NUMBER_OF_BINARY_TREES_FOR_GIVEN_PREORDER_SEQUENCE_LENGTH.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_OF_BINARY_TREES_FOR_GIVEN_PREORDER_SEQUENCE_LENGTH{ static int f_gold ( int n ) { int BT [ ] = new int [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) BT [ i ] = 0 ; BT [ 0 ] = BT [ 1 ] = 1 ; for ( int i = 2 ; i <= n ; ++ i ) for ( int j = 0 ; j < i ; j ++ ) BT [ i ] += BT [ j ] * BT [ i - j - 1 ] ; return BT [ n ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(87); param0.add(69); param0.add(15); param0.add(11); param0.add(11); param0.add(15); param0.add(47); param0.add(65); param0.add(50); param0.add(58); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,491
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/GIVEN_P_AND_N_FIND_THE_LARGEST_X_SUCH_THAT_PX_DIVIDES_N_2.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class GIVEN_P_AND_N_FIND_THE_LARGEST_X_SUCH_THAT_PX_DIVIDES_N_2{ static int f_gold ( int n , int p ) { int ans = 0 ; while ( n > 0 ) { n /= p ; ans += n ; } return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(33); param0.add(81); param0.add(18); param0.add(77); param0.add(9); param0.add(31); param0.add(63); param0.add(66); param0.add(57); param0.add(14); List<Integer> param1 = new ArrayList<>(); param1.add(3); param1.add(71); param1.add(68); param1.add(66); param1.add(52); param1.add(69); param1.add(90); param1.add(48); param1.add(18); param1.add(64); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,492
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_WHETHER_ARITHMETIC_PROGRESSION_CAN_FORMED_GIVEN_ARRAY.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_WHETHER_ARITHMETIC_PROGRESSION_CAN_FORMED_GIVEN_ARRAY{ static boolean f_gold ( int arr [ ] , int n ) { if ( n == 1 ) return true ; Arrays . sort ( arr ) ; int d = arr [ 1 ] - arr [ 0 ] ; for ( int i = 2 ; i < n ; i ++ ) if ( arr [ i ] - arr [ i - 1 ] != d ) return false ; return true ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,4,64,16}); param0.add(new int[]{0, 12, 4, 8}); param0.add(new int[]{-2, 2, 0, 4, 6}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0}); param0.add(new int[]{66,56,86,76,46}); param0.add(new int[]{66,56,56,86,76,46}); param0.add(new int[]{7,9,11,21,44,45,61,67,78,97,98,99}); param0.add(new int[]{66,-28,-26,50,-18,54,84,-2,-70,-74,6,-34,44,-36,-4,36,14,24,64,74,86,-96,54,-68,-84,-62,-36,34,-36,70,-50,6,62,-50,-34,-38,-28,74,78,-2,-12,-4}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{18,93,79,20,44,36,69,37,33,82,19,51,32,22,1,54,89,20,58,35,70,70,61,63,61,57,3,95,99,45,15,17,15,5,86,46,11,64,92,14,39,67}); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(4); param1.add(5); param1.add(7); param1.add(5); param1.add(6); param1.add(11); param1.add(33); param1.add(33); param1.add(40); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,493
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_PAIRS_WHOSE_PRODUCTS_EXIST_IN_ARRAY.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_PAIRS_WHOSE_PRODUCTS_EXIST_IN_ARRAY{ static int f_gold ( int arr [ ] , int n ) { int result = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { int product = arr [ i ] * arr [ j ] ; for ( int k = 0 ; k < n ; k ++ ) { if ( arr [ k ] == product ) { result ++ ; break ; } } } } return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,7,26,40,46,89,99}); param0.add(new int[]{98,42,-24,-60,74,86,6,8,72,-58,38,-20,6,-6,8,48,-34,30,60,66,38,-54,8,-94,-8,0,-64,-94,-94,-72,-84,-36,88,-62,-88,46,-4,88}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{37,97,57,82,29,68,94,38,81,48,13,84,57,5,27,87,11,35,82,53,67,31,15,99,6,93,91,92,3,23,90,27,6,33,78,3,19,19,27}); param0.add(new int[]{-80,-74,-72,-72,-66,-66,-62,-50,-44,-44,-28,-24,-24,-22,-16,-10,-6,-4,-2,2,2,4,12,16,16,28,30,32,32,38,38,72,84,86,88,90,96}); param0.add(new int[]{0,1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,1,1}); param0.add(new int[]{25,67}); param0.add(new int[]{82,74,-82,22,-28,-78,-22,-86,-74,42,-6,54,-88,-92,-14,-50,68,46,-50,46,-18,66,-76,-30,36,12,66}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{50,23,56,9}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(24); param1.add(44); param1.add(36); param1.add(34); param1.add(18); param1.add(1); param1.add(14); param1.add(32); param1.add(3); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,494
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING_1{ static char f_gold ( String str ) { int n = str . length ( ) ; int count = 0 ; char res = str . charAt ( 0 ) ; int cur_count = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i < n - 1 && str . charAt ( i ) == str . charAt ( i + 1 ) ) cur_count ++ ; else { if ( cur_count > count ) { count = cur_count ; res = str . charAt ( i ) ; } cur_count = 1 ; } } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("geeekk"); param0.add("3786868"); param0.add("110"); param0.add("aaaabbcbbb"); param0.add("11"); param0.add("011101"); param0.add("WoHNyJYLC"); param0.add("3141711779"); param0.add("10111101101"); param0.add("aabbabababcc"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,495
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/C_PROGRAM_CONCATENATE_STRING_GIVEN_NUMBER_TIMES.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class C_PROGRAM_CONCATENATE_STRING_GIVEN_NUMBER_TIMES{ static String f_gold ( String s , int n ) { String s1 = s ; for ( int i = 1 ; i < n ; i ++ ) s += s1 ; return s ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("LPWsaI"); param0.add("9037515104"); param0.add("00100010010111"); param0.add("SbwipuE"); param0.add("574314109"); param0.add("1101"); param0.add("f"); param0.add("068"); param0.add("000011001"); param0.add("BWbUtIkC"); List<Integer> param1 = new ArrayList<>(); param1.add(41); param1.add(72); param1.add(95); param1.add(27); param1.add(5); param1.add(70); param1.add(91); param1.add(50); param1.add(38); param1.add(79); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)).equals(f_gold(param0.get(i),param1.get(i)))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,496
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PRODUCT_MAXIMUM_FIRST_ARRAY_MINIMUM_SECOND_1.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PRODUCT_MAXIMUM_FIRST_ARRAY_MINIMUM_SECOND_1{ public static int f_gold ( int arr1 [ ] , int arr2 [ ] , int n1 , int n2 ) { int max = arr1 [ 0 ] ; int min = arr2 [ 0 ] ; int i ; for ( i = 1 ; i < n1 && i < n2 ; ++ i ) { if ( arr1 [ i ] > max ) max = arr1 [ i ] ; if ( arr2 [ i ] < min ) min = arr2 [ i ] ; } while ( i < n1 ) { if ( arr1 [ i ] > max ) max = arr1 [ i ] ; i ++ ; } while ( i < n2 ) { if ( arr2 [ i ] < min ) min = arr2 [ i ] ; i ++ ; } return max * min ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,6,32,33,34,36,41,43,52,70,70,70,75,78,88,88,95,95}); param0.add(new int[]{78,-88,44,10,96,-46,-66,84,32,44,56,76,-72,-72,82,-12,-20,-76,8,-34,12,-22,-92,-74,76,46,86,-2,-76,-86,36,80}); param0.add(new int[]{0,0,1}); param0.add(new int[]{87,4,90,50,2,35,87}); param0.add(new int[]{-98,-86,-86,-82,-72,-72,-70,-68,-64,-58,-50,-48,-44,-38,-36,-32,-32,-30,-28,-16,-12,-12,-4,8,10,16,18,22,28,32,32,42,60,70,88,88,88,98,98}); param0.add(new int[]{0}); param0.add(new int[]{31,32,33,49,68,77,89,94}); param0.add(new int[]{64,-44,-6,12,-98,42,-48,-70,-76,30,-48,-72,32,-2,68,42,-60,86,-24,98,62,-60,36,-52,-50,-74,96,36,-30,66,-92,-74,8,74,-64,-24,-60,-70}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{35,11,39,23,49,12,96,98,46,76,29,1,88,71,27,49,12,24,95,61,38,33,59,97,56,7,97,7,71,59,46,68,45}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{2,4,11,25,26,26,32,39,50,53,65,66,69,74,81,83,89,99}); param1.add(new int[]{30,0,-50,-62,36,-26,-26,70,-72,-8,58,34,26,36,-14,52,18,-80,-64,92,-22,50,-10,56,2,42,90,-80,-94,-62,76,-56}); param1.add(new int[]{0,0,1}); param1.add(new int[]{33,90,2,95,54,94,96}); param1.add(new int[]{-98,-84,-72,-70,-60,-58,-54,-52,-44,-44,-24,-10,-6,2,10,12,12,14,18,22,30,34,42,48,50,54,54,56,68,68,70,76,76,78,86,88,88,90,96}); param1.add(new int[]{1}); param1.add(new int[]{7,26,28,35,36,37,81,98}); param1.add(new int[]{44,-70,16,60,84,-8,58,-64,-32,-58,38,-30,-38,-94,-64,-42,-42,-84,-94,2,-22,46,-72,-38,-28,0,-94,-92,-24,46,48,-18,-56,52,26,-60,-84,-68}); param1.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}); param1.add(new int[]{53,67,70,97,2,97,28,59,89,14,83,71,49,86,13,16,40,60,10,54,35,22,59,53,70,83,95,71,91,72,38,91,39}); List<Integer> param2 = new ArrayList<>(); param2.add(13); param2.add(26); param2.add(2); param2.add(5); param2.add(22); param2.add(0); param2.add(7); param2.add(21); param2.add(12); param2.add(31); List<Integer> param3 = new ArrayList<>(); param3.add(11); param3.add(31); param3.add(2); param3.add(4); param3.add(31); param3.add(0); param3.add(7); param3.add(23); param3.add(15); param3.add(27); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,497
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_NUMBER_OF_OCCURRENCES_OR_FREQUENCY_IN_A_SORTED_ARRAY.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_NUMBER_OF_OCCURRENCES_OR_FREQUENCY_IN_A_SORTED_ARRAY{ static int f_gold ( int arr [ ] , int n , int x ) { int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) if ( x == arr [ i ] ) res ++ ; return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{16,18,24,27,34,36,41,43,43,52,59,76,86,87,90,91,94,96,98,98}); param0.add(new int[]{64,66,-36}); param0.add(new int[]{0,0,0}); param0.add(new int[]{9,85,34,43,70,96,44,7,27,33,34,5,91,84,76,45,20,37,15,37,20,24,13,49,74,13,50,81,81,66,23,36,91,80,61,15,96,70,90,25,16,62,75,63,6,65,38,12}); param0.add(new int[]{-98,-98,-98,-34,-32,-26,-12,0,18,52,68,72}); param0.add(new int[]{1,1,0,0,1,1,0,0,1,0,0,1,0,0,1,1}); param0.add(new int[]{1,3,6,6,10,12,15,16,21,22,23,29,33,37,40,40,43,52,55,59,64,65,71,72,80,83,86,86,88,88}); param0.add(new int[]{-14,-30,-38,-38,-8,40,-34,2,-84,68,-42,38,-14,0,-64,12,-2,-38,-8,-44,-88,-34,-80,-36,82,70,96,-32,16,-52,-12,-46,-28,-86,30,-14,50,-44,22,30,-4,78,52}); param0.add(new int[]{1,1,1,1}); param0.add(new int[]{11,50,1,93,12,7,55,35,36,62,61,71,16}); List<Integer> param1 = new ArrayList<>(); param1.add(14); param1.add(1); param1.add(2); param1.add(43); param1.add(11); param1.add(11); param1.add(29); param1.add(39); param1.add(2); param1.add(11); List<Integer> param2 = new ArrayList<>(); param2.add(43); param2.add(64); param2.add(0); param2.add(5); param2.add(-98); param2.add(1); param2.add(40); param2.add(26); param2.add(3); param2.add(8); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,498
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIRST_ELEMENT_OCCURRING_K_TIMES_ARRAY.java
// Copyright (c) 2019-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIRST_ELEMENT_OCCURRING_K_TIMES_ARRAY{ static int f_gold ( int arr [ ] , int n , int k ) { HashMap < Integer , Integer > count_map = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = 0 ; if ( count_map . get ( arr [ i ] ) != null ) { a = count_map . get ( arr [ i ] ) ; } count_map . put ( arr [ i ] , a + 1 ) ; } for ( int i = 0 ; i < n ; i ++ ) { if ( count_map . get ( arr [ i ] ) == k ) { return arr [ i ] ; } } return - 1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,3,4,4,7,18,20,23,27,30,31,31,32,35,36,43,45,46,49,50,53,55,59,60,64,64,65,68,78,80,80,85,95}); param0.add(new int[]{-26,32,36,6,64,24,-28,96}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{38,40,43,70,20,40,95,96,81,82}); param0.add(new int[]{-68,-8,-8,16,24,54}); param0.add(new int[]{1,0,1,0,0,0,1,0,1,0,0,0,1}); param0.add(new int[]{13,18,19,28,31,34,49,49,53,57,58,62,75,76,77,78,80,84,84,85,87,91,98,99}); param0.add(new int[]{-4,24,-86,-84,30,-16,12,-92,-68,22}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1}); param0.add(new int[]{55,44,75,97,25,65,76,53,20,78,25,59,61,29,81,35,15,78,41,44,31,33,39,93,26,67}); List<Integer> param1 = new ArrayList<>(); param1.add(30); param1.add(6); param1.add(15); param1.add(9); param1.add(3); param1.add(6); param1.add(20); param1.add(6); param1.add(8); param1.add(23); List<Integer> param2 = new ArrayList<>(); param2.add(2); param2.add(3); param2.add(7); param2.add(1); param2.add(2); param2.add(4); param2.add(2); param2.add(5); param2.add(10); param2.add(20); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,499