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/WAYS_REMOVE_ONE_ELEMENT_BINARY_STRING_XOR_BECOMES_ZERO.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 WAYS_REMOVE_ONE_ELEMENT_BINARY_STRING_XOR_BECOMES_ZERO{ static int f_gold ( String s ) { int one_count = 0 , zero_count = 0 ; char [ ] str = s . toCharArray ( ) ; int n = str . length ; for ( int i = 0 ; i < n ; i ++ ) if ( str [ i ] == '1' ) one_count ++ ; else zero_count ++ ; if ( one_count % 2 == 0 ) return zero_count ; return one_count ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("KfcTJNP"); param0.add("05312505872"); param0.add("100111"); param0.add("tDEEhKxrQ"); param0.add("50824233019"); param0.add("10001110010"); param0.add("T SEZaNm MYQ"); param0.add("838415739"); param0.add("01110100"); param0.add("WYQiAey H"); 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,100
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/LONGEST_SUBSEQUENCE_SUCH_THAT_DIFFERENCE_BETWEEN_ADJACENTS_IS_ONE.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_SUBSEQUENCE_SUCH_THAT_DIFFERENCE_BETWEEN_ADJACENTS_IS_ONE{ static int f_gold ( int arr [ ] , int n ) { int dp [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) dp [ i ] = 1 ; for ( int i = 1 ; i < n ; i ++ ) { for ( int j = 0 ; j < i ; j ++ ) { if ( ( arr [ i ] == arr [ j ] + 1 ) || ( arr [ i ] == arr [ j ] - 1 ) ) dp [ i ] = Math . max ( dp [ i ] , dp [ j ] + 1 ) ; } } int result = 1 ; for ( int i = 0 ; i < n ; i ++ ) if ( result < dp [ i ] ) result = dp [ i ] ; return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,13,15,17,18,20,22,24,28,34,37,43,46,47,49,51,52,54,58,64,65,77,78,79,87,90,92,93,94,97}); param0.add(new int[]{-86,-56,76,86,42,-40,8,34,-48,-54,-80,6,42,48,76,-26,6}); param0.add(new int[]{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[]{5,22,15,26,29,47,22}); param0.add(new int[]{-90,-84,-76,-76,-74,-74,-66,-58,-58,-56,-56,-44,-38,-36,-34,-32,-16,-10,2,6,24,24,24,34,36,54,60,68,70,76,88}); param0.add(new int[]{0,1,1,1,0,0,1,0,1,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,1,1,1,0,0,0,1,0,0,1,1,1,0,0,1}); param0.add(new int[]{1,3,12,12,12,12,14,17,18,19,23,27,28,30,35,38,42,44,45,48,52,59,61,64,65,69,73,76,77,82,83,85,87,99}); param0.add(new int[]{-54,-20,24,-78,-58,64,34,70,-36,-24}); 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}); param0.add(new int[]{5,35,75,21,82,32,28,53,20,27,42,92,32,70,81,75,72,66,97,60,11,83,14,30,5,68,17,27,62,86,26,20,97,91,44,69}); List<Integer> param1 = new ArrayList<>(); param1.add(23); param1.add(15); param1.add(16); param1.add(5); param1.add(17); param1.add(26); param1.add(23); param1.add(8); param1.add(27); param1.add(20); 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,101
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_MINIMUM_ELEMENT_IN_A_SORTED_AND_ROTATED_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 FIND_MINIMUM_ELEMENT_IN_A_SORTED_AND_ROTATED_ARRAY{ static int f_gold ( int arr [ ] , int low , int high ) { if ( high < low ) return arr [ 0 ] ; if ( high == low ) return arr [ low ] ; int mid = low + ( high - low ) / 2 ; if ( mid < high && arr [ mid + 1 ] < arr [ mid ] ) return arr [ mid + 1 ] ; if ( mid > low && arr [ mid ] < arr [ mid - 1 ] ) return arr [ 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[]{16,22,50,64,68,79,84,88,89}); param0.add(new int[]{88,-38,46,24,-52,-12,-90,28,18,14,-72,58,-98,28,-84,44,-42,-32,-22,-22,-82,-30,90,18,62,62,92,6,60,28,-90,92,82,62,98,-68,48,-74,-8,50,62,24,30,-86,98,-96,-98}); 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,1,1,1}); param0.add(new int[]{26,66,94,28,38,31,92,66,81,8,36,64,80,32,48,71,72,54,61,60,89}); param0.add(new int[]{-46,-26,-22,-14,46,62}); param0.add(new int[]{0,1,1,1}); param0.add(new int[]{14,81,87}); param0.add(new int[]{4}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{3,41,40,53,82,9,90,43,90,59,37,21,92,98,36,99,35,67,24,29,40,31,46,12,29,8,93,67,44,83,71,29,22,32,33,11,44,97,84,44,8,10,31,50,22,8}); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(42); param1.add(28); param1.add(19); param1.add(4); param1.add(2); param1.add(1); param1.add(0); param1.add(15); param1.add(42); List<Integer> param2 = new ArrayList<>(); param2.add(6); param2.add(31); param2.add(21); param2.add(17); param2.add(4); param2.add(2); param2.add(1); param2.add(0); param2.add(17); param2.add(31); 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,102
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_NUMBER_OF_SQUARES_WHOSE_SUM_EQUALS_TO_GIVEN_NUMBER_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 MINIMUM_NUMBER_OF_SQUARES_WHOSE_SUM_EQUALS_TO_GIVEN_NUMBER_N_1{ static int f_gold ( int n ) { if ( n <= 3 ) return n ; int dp [ ] = new int [ n + 1 ] ; dp [ 0 ] = 0 ; dp [ 1 ] = 1 ; dp [ 2 ] = 2 ; dp [ 3 ] = 3 ; for ( int i = 4 ; i <= n ; i ++ ) { dp [ i ] = i ; for ( int x = 1 ; x <= Math . ceil ( Math . sqrt ( i ) ) ; x ++ ) { int temp = x * x ; if ( temp > i ) break ; else dp [ i ] = Math . min ( dp [ i ] , 1 + dp [ i - temp ] ) ; } } int res = dp [ n ] ; return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(16); param0.add(33); param0.add(47); param0.add(98); param0.add(36); param0.add(81); param0.add(55); param0.add(19); param0.add(4); param0.add(22); 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,103
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_COST_CONNECT_WEIGHTED_NODES_REPRESENTED_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 MINIMUM_COST_CONNECT_WEIGHTED_NODES_REPRESENTED_ARRAY{ static int f_gold ( int a [ ] , int n ) { int mn = Integer . MAX_VALUE ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { mn = Math . min ( a [ i ] , mn ) ; sum += a [ i ] ; } return mn * ( sum - mn ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,8,14,15,17,17,19,21,22,23,29,32,36,37,43,45,46,47,47,53,57,57,70,71,72,76,81,82,90,95,96,98,99}); param0.add(new int[]{94,-18,50,94,-74,-50,-44,-92,-58,14,-66,-78}); 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}); param0.add(new int[]{15,18,64,28}); param0.add(new int[]{-96,-88,-88,-84,-82,-78,-78,-60,-58,-56,-54,-52,-48,-44,-28,-26,-14,-12,6,10,10,14,14,50,52,54,60,62,62,64,66,70,72,72,78,80,84}); param0.add(new int[]{0,1,1,0,1,1,1,1}); param0.add(new int[]{3,10,14,14,15,16,18,20,21,30,31,33,35,39,46,48,59,59,61,77,78,79,81,83,85,92,97,97,99}); param0.add(new int[]{4,-32,68,-48,54,24,78,98,-70,44,-82,-92,-16,-92,-70,52,-58,-62,-58,32,14,-4,80,-78,-26,-24,-8}); 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,1,1,1}); param0.add(new int[]{82,74,53,91,81,88,42,62,38,43,29,60,43,44,19,28,20,1,5,94,18,77,52,38,55,1,10,29,34,91,64,80,81,39,4,47,30,62,58,66,73,52,62,9,36,49}); List<Integer> param1 = new ArrayList<>(); param1.add(32); param1.add(10); param1.add(24); param1.add(2); param1.add(31); param1.add(6); param1.add(23); param1.add(18); param1.add(35); param1.add(38); 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,104
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_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_A_TRIPLET_THAT_SUM_TO_A_GIVEN_VALUE_2{ static boolean f_gold ( int A [ ] , int arr_size , int sum ) { for ( int i = 0 ; i < arr_size - 2 ; i ++ ) { HashSet < Integer > s = new HashSet < Integer > ( ) ; int curr_sum = sum - A [ i ] ; for ( int j = i + 1 ; j < arr_size ; j ++ ) { if ( s . contains ( curr_sum - A [ j ] ) && curr_sum - A [ j ] != ( int ) s . toArray ( ) [ s . size ( ) - 1 ] ) { System . out . printf ( "Triplet is %d, %d, %d" , A [ i ] , A [ j ] , curr_sum - A [ j ] ) ; return true ; } s . add ( A [ j ] ) ; } } return false ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,6,8,8,9,11,13,13,15,17,21,24,38,38,42,43,46,46,47,54,55,56,57,58,60,60,60,62,63,63,65,66,67,67,69,81,84,84,85,86,95,99}); param0.add(new int[]{20,-86,-24,38,-32,-64,-72,72,68,94,18,-60,-4,-18,-18,-70,6,-86,46,-16,46,-28}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{13,96,31,39,23,39,50,10,21,64,41,54,44,97,24,91,79,86,38,49,77,71,8,98,85,36,37,65,42,48}); param0.add(new int[]{-86,-68,-58,-56,-54,-54,-48,-40,-36,-32,-26,-16,-14,-12,-12,-4,-4,-4,0,10,22,22,30,54,62,68,88,88}); param0.add(new int[]{0,1,1,1,1,0,0}); param0.add(new int[]{8,8,9,13,20,24,29,52,53,96}); param0.add(new int[]{18,-92,-10,26,58,-48,38,66,-98,-72,4,76,-52,20,60,-56,96,60,-10,-26,-64,-66,-22,-86,74,82,2,-14,76,82,40,70,-40,-2,-46,-38,22,98,58}); param0.add(new int[]{1,1,1,1}); param0.add(new int[]{72}); List<Integer> param1 = new ArrayList<>(); param1.add(27); param1.add(21); param1.add(17); param1.add(17); param1.add(21); param1.add(5); param1.add(9); param1.add(30); param1.add(2); param1.add(0); List<Integer> param2 = new ArrayList<>(); param2.add(24); param2.add(20); param2.add(13); param2.add(18); param2.add(25); param2.add(3); param2.add(8); param2.add(30); param2.add(2); 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,105
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_PRODUCT_INCREASING_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 MAXIMUM_PRODUCT_INCREASING_SUBSEQUENCE{ static int f_gold ( int [ ] arr , int n ) { int [ ] mpis = new int [ n ] ; int max = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) mpis [ i ] = arr [ i ] ; for ( int i = 1 ; i < n ; i ++ ) for ( int j = 0 ; j < i ; j ++ ) if ( arr [ i ] > arr [ j ] && mpis [ i ] < ( mpis [ j ] * arr [ i ] ) ) mpis [ i ] = mpis [ j ] * arr [ i ] ; for ( int k = 0 ; k < mpis . length ; k ++ ) { if ( mpis [ k ] > max ) { max = mpis [ k ] ; } } return max ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,1,4,7,7,9,12,20,45,53,58,63,65,65,86,98,98}); param0.add(new int[]{46,-58,70,60,74,42,6,-26,78,32,14,-56,-48,86,-2,94,-44,-62,-50,-8,-4,-36,-62,-98,-98,-78,56,92,88}); 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[]{13,71,93,68,43,75,44,15,1,91,7,9,65,85,46,87,37,74,19,30,87,27,82,92,12,36,6,27,76,80,30,83,67,83,65,28,81,59,63,11,70}); param0.add(new int[]{-96,-94,-92,-88,-84,-80,-74,-70,-62,-56,-48,-46,-40,-34,-32,-26,-22,-22,-12,-10,-8,-6,-2,0,2,4,6,18,18,30,34,34,38,38,40,48,54,56,60,84,88,88,90,94,96}); param0.add(new int[]{1,1,1,1,1,0,1,0,0,1,1,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1}); param0.add(new int[]{1,1,5,5,6,7,18,35,39,51,64,73,87,90,91,92}); param0.add(new int[]{-54,8,-92,-28,72,54,-74,36,-10,54,-30,-16,-72,-32,-92,38,-76,-76,-50,-92,48}); 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,1,1,1,1,1,1}); param0.add(new int[]{47,57,72,40,53,46,62,51,42,89,9,91,58,67,20,91,63,50,32,6,63,49,3,89,87,54,65,72,72,62,31,6,48,87,17,95,59,57}); List<Integer> param1 = new ArrayList<>(); param1.add(12); param1.add(27); param1.add(14); param1.add(20); param1.add(30); param1.add(22); param1.add(11); param1.add(19); param1.add(26); param1.add(30); 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,106
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_NUMBER_PERFECT_SQUARES_TWO_GIVEN_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 FIND_NUMBER_PERFECT_SQUARES_TWO_GIVEN_NUMBERS{ static int f_gold ( int a , int b ) { int cnt = 0 ; for ( int i = a ; i <= b ; i ++ ) for ( int j = 1 ; j * j <= i ; j ++ ) if ( j * j == i ) cnt ++ ; return cnt ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(48); param0.add(3); param0.add(20); param0.add(98); param0.add(96); param0.add(40); param0.add(9); param0.add(57); param0.add(28); param0.add(98); List<Integer> param1 = new ArrayList<>(); param1.add(42); param1.add(82); param1.add(72); param1.add(98); param1.add(90); param1.add(82); param1.add(15); param1.add(77); param1.add(80); param1.add(75); 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,107
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_SERIES_0_6_0_06_0_006_0_0006_N_TERMS.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_0_6_0_06_0_006_0_0006_N_TERMS{ static double f_gold ( int n ) { return ( 0.666 ) * ( 1 - 1 / Math . pow ( 10 , n ) ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(1); param0.add(2); param0.add(3); param0.add(4); param0.add(5); param0.add(74); param0.add(77); param0.add(67); param0.add(9); param0.add(12); 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.001) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,108
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMIZE_SUM_CONSECUTIVE_DIFFERENCES_CIRCULAR_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 MAXIMIZE_SUM_CONSECUTIVE_DIFFERENCES_CIRCULAR_ARRAY{ static int f_gold ( int arr [ ] , int n ) { int sum = 0 ; Arrays . sort ( arr ) ; for ( int i = 0 ; i < n / 2 ; i ++ ) { sum -= ( 2 * arr [ i ] ) ; sum += ( 2 * arr [ n - i - 1 ] ) ; } return sum ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{8,9,12,13,17,21,24,29,37,37,39,40,41,45,49,50,53,54,56,59,60,60,70,71,72,74,77,77,78,85,89,89,90,90,95,98,98}); param0.add(new int[]{0,48,-32,28,-84,14,30,-80,92,76,-52,-20,52,78,20,32,96,66,48,26,88,6,94,32,-40,44,-84,54,-84,-80,-80,-64,-92,-84,-16,-18}); param0.add(new int[]{0,0,0,1,1,1}); param0.add(new int[]{47,7,84,96,59,53,80}); param0.add(new int[]{-88,-80,-68,-62,-60,-60,-48,-46,-44,-38,-16,-16,0,0,2,8,20,36,40,40,44,54,60,68,70,82,82,84,92,94,96}); param0.add(new int[]{1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,1,0,0,0,1,0,0,1,0,0,0,1,0,1,1}); param0.add(new int[]{2,5,10,11,13,14,15,17,17,23,23,24,27,27,28,29,30,40,42,43,46,47,51,52,57,64,65,73,74,75,76,77,81,81,82,87,89,93,95,95,99}); param0.add(new int[]{-72,-84,84,2,-76,48,12,-72,-92,-72,38,26,-38,26,50,2,20,26,-48,30,24,-12,-84,-54,20,-16,-94,26,-22,86}); 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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{57,74,53,52,80,31,27,53,8,57,46,73,46,56,73,84,37,7,97}); List<Integer> param1 = new ArrayList<>(); param1.add(34); param1.add(24); param1.add(3); param1.add(5); param1.add(29); param1.add(32); param1.add(35); param1.add(21); param1.add(37); param1.add(13); 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,109
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FINDING_POWER_PRIME_NUMBER_P_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 FINDING_POWER_PRIME_NUMBER_P_N{ static int f_gold ( int n , int p ) { int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int count = 0 , temp = i ; while ( temp % p == 0 ) { count ++ ; temp = temp / p ; } ans += count ; } return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(49); param0.add(80); param0.add(10); param0.add(81); param0.add(11); param0.add(45); param0.add(86); param0.add(27); param0.add(80); param0.add(97); List<Integer> param1 = new ArrayList<>(); param1.add(30); param1.add(25); param1.add(9); param1.add(57); param1.add(4); param1.add(34); param1.add(90); param1.add(78); param1.add(60); param1.add(31); 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,110
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DYNAMIC_PROGRAMMING_SET_8_MATRIX_CHAIN_MULTIPLICATION.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{ static int f_gold ( int p [ ] , int i , int j ) { if ( i == j ) return 0 ; int min = Integer . MAX_VALUE ; for ( int k = i ; k < j ; k ++ ) { int count = f_gold ( p , i , k ) + f_gold ( p , k + 1 , j ) + p [ i - 1 ] * p [ k ] * p [ j ] ; if ( count < min ) min = count ; } return min ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{6,12,16,30,31,31,33,34,45,48,57,63,81,83}); param0.add(new int[]{30,-78,42,-6,42,56,-38,28,-96,-96,84,-18,0,20,-56,-40,-58,-74,64,62,-22,78,10,-22,16,-48,2,14,82,-92,-64,-18,42,24,22,-50,12,-76,38,-30,-86,-58,-6,-4,10,28}); param0.add(new int[]{0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{54,46}); param0.add(new int[]{-80,-76,-68,-66,-54,-12,-10,-6,6,8,20,20,22,60,66,78,78,82,98}); param0.add(new int[]{0,0,1,0,0,1,0,1,1,1,0,0,1,1,0,1,1,1,0,1,0}); param0.add(new int[]{14,21,29,31,37,50,51,54,57,62,64,72,85,98}); param0.add(new int[]{-86,98,90,-20,90,68,70,-24,-10,-80,70,-42,14,56,-26,-42,2,-62,24,10,-46,-66,-82,-98,-84,-2,-52,-50,0,-18,90,-32,98,86}); param0.add(new int[]{0,0,1,1,1,1}); param0.add(new int[]{52,15,61,73,45,5,15,54,69,90,5,56,13,54,27,72,58,21,35,2,59,55,64,92,54,63,50,95,38,53,38,53,73,27,86,86,99,42,85,80,43,32,80,57,78}); List<Integer> param1 = new ArrayList<>(); param1.add(10); param1.add(30); param1.add(7); param1.add(1); param1.add(13); param1.add(20); param1.add(7); param1.add(23); param1.add(5); param1.add(26); List<Integer> param2 = new ArrayList<>(); param2.add(9); param2.add(27); param2.add(7); param2.add(1); param2.add(10); param2.add(17); param2.add(11); param2.add(26); param2.add(4); param2.add(42); 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,111
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NON_REPEATING_ELEMENT.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{ static int f_gold ( int arr [ ] , int n ) { for ( int i = 0 ; i < n ; i ++ ) { int j ; for ( j = 0 ; j < n ; j ++ ) if ( i != j && arr [ i ] == arr [ j ] ) break ; if ( j == n ) 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[]{1,2,3,4,6,6,7,9,10,13,16,23,30,32,36,42,42,43,44,47,48,48,49,52,52,53,55,56,58,59,60,60,63,67,68,68,74,75,76,80,81,81,83,83,86,87,91,92,97}); param0.add(new int[]{-96,-46,-86,56,-72,50,18,8,50}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{19,10,49,40,34,21,63,51}); param0.add(new int[]{-96,-96,-90,-88,-88,-84,-80,-76,-68,-64,-64,-52,-52,-52,-52,-50,-50,-48,-48,-40,-32,-26,-24,-22,-20,-14,-12,0,6,8,10,20,24,28,34,36,54,60,60,60,68,74,74,74,84,88,94}); param0.add(new int[]{1,0,0,1,0,1,1,1,1,0,0,1,0,0,1,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,0}); param0.add(new int[]{1,2,3,10,15,21,28,36,41,44,45,47,72,77,77,79,85}); param0.add(new int[]{42,-84,42,36,-10,24,-62,60}); 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,1,1,1,1,1,1,1}); param0.add(new int[]{2,21,42,92,65,62,75,43,81,17,92,86,37,63,27,97,24,61,85,49,84,7,14,19,60,55,68,79,8,12,75,12,92,79,42}); List<Integer> param1 = new ArrayList<>(); param1.add(47); param1.add(8); param1.add(14); param1.add(5); param1.add(27); param1.add(19); param1.add(15); param1.add(7); param1.add(35); param1.add(27); 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,112
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD_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 PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD_1{ static boolean f_gold ( int n ) { if ( n <= 1 ) return false ; if ( n <= 3 ) return true ; if ( n % 2 == 0 || n % 3 == 0 ) return false ; for ( int i = 5 ; i * i <= n ; i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return false ; return true ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(15); param0.add(90); param0.add(38); param0.add(65); param0.add(91); param0.add(16); param0.add(48); param0.add(74); param0.add(14); 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,113
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_PRODUCT_OF_4_ADJACENT_ELEMENTS_IN_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 MAXIMUM_PRODUCT_OF_4_ADJACENT_ELEMENTS_IN_MATRIX{ static int f_gold ( int arr [ ] [ ] , int n ) { int max = 0 , result ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( ( j - 3 ) >= 0 ) { result = arr [ i ] [ j ] * arr [ i ] [ j - 1 ] * arr [ i ] [ j - 2 ] * arr [ i ] [ j - 3 ] ; if ( max < result ) max = result ; } if ( ( i - 3 ) >= 0 ) { result = arr [ i ] [ j ] * arr [ i - 1 ] [ j ] * arr [ i - 2 ] [ j ] * arr [ i - 3 ] [ j ] ; if ( max < result ) max = result ; } if ( ( i - 3 ) >= 0 && ( j - 3 ) >= 0 ) { result = arr [ i ] [ j ] * arr [ i - 1 ] [ j - 1 ] * arr [ i - 2 ] [ j - 2 ] * arr [ i - 3 ] [ j - 3 ] ; if ( max < result ) max = result ; } } } return max ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ] [ ]> param0 = new ArrayList<>(); param0.add(new int[][]{new int[]{1,2,5,6,7,11,12,14,15,16,19,19,24,25,32,34,36,36,38,38,39,43,43,45,47,49,51,51,51,52,53,56,59,59,67,69,70,74,75,75,77,79,81,90,94,96,96,96},new int[]{1,2,4,6,9,9,9,16,18,21,23,26,26,30,36,37,37,38,39,42,45,49,51,52,52,53,56,59,61,61,64,64,69,72,77,79,82,82,87,88,89,91,91,91,94,95,95,98},new int[]{2,5,5,6,10,10,14,16,16,20,22,24,25,28,28,29,30,31,36,38,42,44,44,45,45,49,51,53,56,57,61,63,66,67,67,70,76,80,87,87,91,93,95,96,96,96,97,99},new int[]{4,9,10,11,12,13,13,18,20,23,24,26,27,28,33,35,35,37,42,42,44,45,49,52,55,56,59,60,60,63,64,64,72,72,74,77,78,81,85,85,87,89,93,93,95,98,98,99},new int[]{7,7,7,9,11,11,14,18,19,21,26,32,32,34,35,37,37,39,40,41,42,53,56,59,62,62,65,68,69,70,72,73,73,75,75,77,77,78,85,86,87,88,88,88,93,94,95,98},new int[]{4,4,5,12,16,19,20,23,25,27,28,37,38,39,40,41,45,46,47,48,49,49,55,58,61,61,62,67,67,69,69,71,72,73,75,76,76,77,77,79,81,85,86,90,90,97,97,99},new int[]{1,9,9,11,19,19,21,23,25,26,26,27,28,31,37,38,41,41,43,43,49,54,55,56,58,58,61,62,63,64,64,68,70,75,79,81,83,84,85,85,86,87,92,92,92,94,94,97},new int[]{2,6,8,10,11,11,12,13,14,15,15,19,23,25,27,29,33,33,41,43,45,47,49,49,51,52,55,59,60,62,64,64,65,65,72,74,76,79,83,83,84,90,91,92,93,93,94,96},new int[]{5,9,11,12,13,15,16,21,24,28,32,33,36,37,40,45,46,48,57,60,63,63,63,63,64,66,68,68,73,75,75,77,77,79,80,81,83,84,84,85,85,85,89,91,91,92,94,99},new int[]{2,2,4,6,6,11,14,15,15,18,25,25,27,28,30,31,32,36,37,40,40,41,42,46,52,59,60,60,61,62,63,65,68,68,69,71,73,74,75,78,79,82,93,93,93,94,97,99},new int[]{1,1,4,5,5,6,8,8,9,10,11,12,15,21,22,28,32,33,35,35,36,38,41,44,49,53,54,57,58,59,62,62,63,67,68,69,70,75,77,77,82,83,83,86,90,91,92,97},new int[]{1,1,3,4,5,9,9,13,15,24,27,28,33,37,37,39,40,41,41,48,50,50,51,52,54,63,63,64,65,68,70,71,73,74,74,74,79,79,80,83,89,90,90,93,94,98,99,99},new int[]{2,3,5,9,11,11,20,22,23,25,26,26,26,29,39,39,40,40,48,48,49,49,50,51,51,53,54,58,65,66,67,71,71,72,75,76,79,85,87,87,90,91,95,97,98,98,98,99},new int[]{4,4,9,9,10,13,15,22,23,23,24,26,26,27,28,29,31,33,34,38,40,45,45,47,48,50,50,58,59,60,64,65,66,70,80,80,81,83,84,84,88,89,90,90,95,98,99,99},new int[]{2,4,5,7,9,11,11,12,13,15,17,19,23,26,26,28,28,29,34,35,43,47,48,49,51,51,51,56,57,58,60,61,63,64,66,68,68,71,72,74,78,80,81,84,86,90,91,97},new int[]{1,2,3,4,6,7,7,12,13,17,19,22,23,33,33,38,40,44,44,47,47,51,52,54,56,56,57,58,64,65,67,68,74,74,76,79,80,83,85,88,90,92,92,93,93,94,97,99},new int[]{1,4,5,10,13,13,20,22,23,28,30,31,32,33,36,36,44,46,49,49,51,51,51,55,56,60,69,72,73,74,74,75,75,77,78,78,81,82,82,84,87,87,88,91,91,95,97,99},new int[]{2,3,4,10,13,13,14,16,18,23,31,35,39,41,42,42,43,43,48,49,49,53,56,57,57,58,64,65,68,68,68,74,75,77,78,78,82,83,84,87,88,89,89,91,92,93,99,99},new int[]{2,4,5,8,10,12,13,16,17,18,23,24,28,29,29,31,32,34,38,39,39,43,45,50,51,51,54,55,58,59,59,61,62,63,63,65,65,72,74,82,82,84,92,92,93,94,95,97},new int[]{6,7,9,10,10,10,11,14,16,19,22,24,33,38,41,47,50,50,51,52,52,54,55,57,57,57,59,62,66,66,66,67,68,72,72,73,80,81,81,83,87,88,89,94,96,97,97,98},new int[]{2,4,5,6,9,13,14,14,14,16,20,21,23,23,24,24,27,29,31,33,36,37,43,48,49,50,51,56,57,59,62,62,65,70,71,72,74,74,75,77,80,81,84,87,89,93,96,99},new int[]{1,2,3,6,8,17,27,28,30,31,32,32,33,33,37,40,41,42,42,45,49,51,52,54,57,60,62,62,64,64,65,67,67,70,73,77,77,80,83,83,83,83,85,85,92,95,97,97},new int[]{1,3,11,11,12,15,20,22,22,22,23,23,23,24,26,28,33,33,34,34,36,39,41,42,42,43,50,50,54,56,59,60,64,70,74,75,76,82,82,89,89,94,96,96,96,98,98,98},new int[]{2,2,3,4,7,11,14,18,18,18,21,23,28,29,32,33,33,33,34,39,39,40,41,42,48,49,50,52,56,57,57,58,59,66,66,70,72,74,76,77,77,79,86,86,89,92,94,99},new int[]{1,9,10,12,13,14,17,18,20,21,23,23,25,26,28,28,31,33,33,36,37,41,41,41,41,42,43,44,47,51,54,57,59,59,59,63,64,67,69,69,75,78,84,85,93,98,98,99},new int[]{1,3,5,8,9,9,10,18,18,18,19,21,23,24,24,25,26,27,29,34,34,35,37,37,39,39,41,48,56,57,59,61,64,65,68,69,75,75,75,76,78,83,85,86,90,94,97,98},new int[]{7,8,11,13,14,15,16,16,17,20,28,31,39,41,42,46,51,52,53,53,54,57,57,66,66,67,72,72,73,74,74,78,82,82,83,84,85,87,89,91,93,95,95,97,98,98,98,99},new int[]{1,2,4,5,6,8,8,12,12,12,20,20,25,29,30,31,38,38,39,39,42,43,43,44,45,47,47,51,56,56,57,58,62,65,65,65,66,69,69,73,78,82,83,85,87,90,95,96},new int[]{2,2,3,3,6,7,8,14,15,16,16,17,20,23,25,29,29,31,32,33,37,37,39,40,40,47,48,48,50,51,52,55,55,56,59,62,69,70,71,72,72,81,82,84,89,92,96,99},new int[]{2,8,9,10,16,17,23,30,32,37,38,41,41,46,49,49,55,57,59,59,63,63,64,66,68,68,69,70,72,74,76,77,80,81,83,84,84,85,86,90,90,91,91,92,96,96,97,97},new int[]{1,7,13,13,17,17,18,23,24,31,33,34,34,35,36,40,40,40,40,44,45,51,53,55,55,58,58,64,64,69,72,75,75,80,80,81,82,82,83,84,86,87,87,88,89,95,96,99},new int[]{1,4,7,9,10,11,13,15,15,19,21,23,23,24,25,27,32,32,33,37,38,41,43,43,45,45,47,51,52,53,54,58,59,61,63,63,65,73,76,77,80,80,85,87,90,92,94,96},new int[]{3,4,7,7,12,13,20,20,20,21,22,22,27,27,28,31,32,35,37,39,39,40,41,45,45,45,48,48,49,49,51,54,57,64,67,70,80,83,89,89,90,90,90,92,92,98,98,99},new int[]{1,1,7,10,12,16,16,21,27,31,33,34,36,44,45,46,46,46,47,49,49,53,54,57,57,58,58,62,62,63,67,69,77,79,82,82,84,85,85,85,85,86,92,93,94,94,96,99},new int[]{1,1,4,14,14,17,19,20,21,29,30,30,32,33,34,36,36,44,46,47,48,53,57,59,59,62,63,64,65,65,66,69,69,70,72,73,74,74,80,81,83,84,84,84,85,85,87,94},new int[]{9,13,16,18,19,19,21,23,24,24,25,30,32,33,35,36,37,42,46,47,48,48,52,54,55,62,62,66,67,69,70,70,71,71,73,74,75,77,78,79,80,82,83,86,88,89,94,99},new int[]{1,2,2,4,13,14,15,15,18,18,18,19,21,22,22,22,24,28,31,36,45,46,47,49,51,52,56,56,58,66,67,68,69,71,73,75,77,78,79,79,82,87,87,93,93,97,97,98},new int[]{2,3,4,4,8,11,14,14,16,19,25,29,32,36,39,45,46,46,46,47,50,51,52,55,56,57,61,63,63,64,66,67,70,72,75,76,80,82,83,84,84,87,89,90,92,94,96,97},new int[]{3,6,10,11,14,15,19,20,21,23,28,29,30,30,32,34,34,38,39,41,41,44,45,47,50,50,50,54,57,57,58,58,63,65,66,68,68,69,73,75,76,79,83,86,89,94,95,96},new int[]{4,10,13,18,18,21,21,22,22,22,24,24,25,25,26,29,29,39,50,51,51,53,55,56,56,56,57,60,61,62,67,67,69,69,73,76,76,76,77,79,79,80,82,84,89,90,95,97},new int[]{1,6,8,10,10,25,35,38,39,40,40,40,41,41,43,47,51,56,56,56,57,60,60,62,63,64,65,68,69,72,73,75,76,76,76,78,79,79,79,80,82,82,84,90,91,95,96,99},new int[]{2,3,7,10,11,11,17,17,19,21,21,23,24,26,28,29,31,33,44,44,44,45,48,48,50,50,52,54,56,58,61,65,66,67,69,70,72,72,74,81,84,85,86,87,92,93,98,99},new int[]{1,3,3,3,6,9,13,14,14,22,25,26,28,28,33,36,38,38,41,44,45,46,46,51,55,56,57,57,59,62,64,65,65,68,77,78,79,79,84,85,87,90,94,95,95,95,97,99},new int[]{7,7,8,9,14,18,24,24,25,27,28,28,30,31,31,31,33,36,36,37,37,38,40,43,45,46,46,47,50,51,51,52,52,53,53,60,62,65,65,67,73,76,79,88,91,94,95,95},new int[]{4,5,7,16,17,18,18,18,21,24,25,27,28,31,33,35,36,36,38,40,42,42,42,45,46,46,47,49,50,52,53,65,68,68,69,69,71,71,71,72,75,76,76,80,80,87,90,95},new int[]{9,11,12,14,15,20,22,23,29,29,29,33,35,35,37,37,41,42,44,45,45,47,50,51,51,51,55,57,62,64,66,66,67,76,80,82,82,83,83,83,83,83,85,86,90,90,92,93},new int[]{1,3,3,7,8,8,11,16,19,20,25,29,32,33,39,39,42,43,43,44,47,48,49,50,51,53,54,54,58,60,60,60,62,64,65,67,71,74,75,77,83,84,85,87,87,90,91,97},new int[]{2,5,5,12,13,16,17,19,20,22,26,28,28,30,30,31,36,37,41,44,44,44,46,50,51,51,51,54,54,57,58,58,59,60,62,66,66,68,68,71,75,76,84,85,89,90,91,95}}); param0.add(new int[][]{new int[]{36,16,60,44,14,-68,-28,-98,14,-6,24,56,54,70,70},new int[]{-14,28,-16,-26,-54,60,2,52,28,-42,36,6,14,2,-30},new int[]{-26,56,-60,-6,24,-36,76,-52,20,-54,-22,38,90,-2,-70},new int[]{62,-70,-50,18,62,-34,-74,66,30,64,6,94,-72,58,-82},new int[]{30,28,6,-38,-40,-98,-14,-80,-84,-20,-8,12,-90,-26,-48},new int[]{-2,64,-38,-82,-82,-18,-14,-20,28,16,-94,-78,-80,-4,32},new int[]{-82,-74,68,78,-56,24,-58,36,-10,28,98,42,26,-98,92},new int[]{40,-82,56,98,68,-8,48,-78,-72,-40,78,22,-76,68,10},new int[]{88,88,80,52,-66,-16,-24,-84,56,-10,70,-2,42,64,62},new int[]{-76,-52,70,-10,24,-46,62,-98,28,-78,58,-10,-76,40,-98},new int[]{-82,-58,-12,-98,-54,-62,-32,52,48,64,28,72,-84,48,-14},new int[]{-72,66,-84,34,-96,66,-90,48,86,-34,-4,-70,-88,-76,46},new int[]{40,70,22,-40,64,-32,-68,-6,-78,-56,-96,-98,-26,-38,-90},new int[]{98,32,20,2,-56,12,72,-40,24,78,98,76,98,-8,70},new int[]{-30,-34,-34,46,18,-48,-96,-12,-60,-90,-50,-64,12,60,-94}}); param0.add(new int[][]{new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}}); param0.add(new int[][]{new int[]{43,44,74,24,47,58,43,11,78,61},new int[]{93,7,12,81,39,13,50,62,27,87},new int[]{27,9,63,68,8,83,44,22,83,2},new int[]{70,73,44,15,37,38,42,21,20,75},new int[]{72,43,56,93,92,73,34,9,28,38},new int[]{4,83,97,56,44,89,92,51,82,68},new int[]{55,51,72,78,65,66,10,13,71,85},new int[]{97,15,49,86,56,56,92,84,98,73},new int[]{89,44,19,45,74,7,76,60,42,34},new int[]{65,47,3,34,46,97,98,78,19,57}}); param0.add(new int[][]{new int[]{-88,-82,-70,-46,-44,-18,12,38,66,90,96},new int[]{-98,-90,-84,-62,-42,-30,-16,4,14,18,26},new int[]{-94,-48,-32,-24,-22,-18,42,44,64,70,74},new int[]{-94,-60,-58,-56,-40,-34,2,18,32,76,96},new int[]{-94,-74,-62,-56,-50,-46,-2,34,34,44,68},new int[]{-74,-56,-50,-16,-14,0,14,30,30,66,82},new int[]{-80,-78,-60,-56,-46,-32,4,8,14,42,54},new int[]{-68,-66,-58,-50,-50,-40,-16,-2,4,10,80},new int[]{-70,-68,-24,-8,-4,34,36,60,82,84,92},new int[]{-90,-62,-60,-54,-6,-6,10,10,14,52,66},new int[]{-88,-72,-70,-18,-6,28,38,50,56,72,90}}); param0.add(new int[][]{new int[]{0,0,1,1,1,0,1,1,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,1,1,1,0,0,0,1,1,1},new int[]{1,1,0,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,1,1,1,1,1,1,1,0,1,0,1,1,0,0},new int[]{1,1,1,0,0,1,0,1,1,1,0,1,0,0,1,0,0,1,1,1,1,0,0,0,1,0,1,1,0,0,0,1},new int[]{0,0,0,0,0,1,1,1,0,1,0,1,1,0,1,0,0,0,1,0,1,0,1,1,0,1,1,1,1,1,1,0},new int[]{1,1,1,1,0,1,1,0,0,1,1,1,0,1,0,0,1,1,1,1,1,0,1,0,1,1,1,0,0,1,1,0},new int[]{0,0,0,0,0,1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,1,1,0,0,0},new int[]{0,1,1,1,1,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,1,1,0},new int[]{0,0,0,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,0,0,0,1,1,1,1,1,1,1,0,0,1,1},new int[]{1,0,0,1,1,1,0,0,0,1,0,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,1,1,1},new int[]{1,0,1,0,1,1,1,0,1,1,1,1,0,0,1,0,0,0,1,0,1,0,0,1,1,1,1,1,0,1,0,1},new int[]{0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,1,0,0,1,1,1,0,1,1,0,0,1,1,0,0},new int[]{1,0,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,1,1,0,0,0,0,1},new int[]{0,0,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1},new int[]{0,1,0,0,1,1,1,0,1,0,0,1,0,1,1,1,1,1,1,1,0,1,0,0,1,1,1,0,0,0,1,0},new int[]{1,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,0,1,1,0,1,1,0,1,1,0,0,0,1,1},new int[]{0,1,0,0,1,0,0,0,0,1,0,0,1,1,1,0,1,0,0,0,0,1,1,0,1,0,0,1,0,1,0,0},new int[]{0,0,0,1,1,1,0,0,0,1,0,0,0,1,1,0,1,0,1,1,0,1,1,1,1,1,1,0,1,1,0,1},new int[]{0,1,1,0,1,0,0,1,1,0,1,0,1,0,0,1,1,0,1,1,1,1,0,1,1,1,0,0,0,1,0,1},new int[]{1,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,1},new int[]{0,1,0,1,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,1,0,0,1,1,1,0,1},new int[]{1,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0},new int[]{1,0,0,0,1,1,1,1,1,1,1,1,1,0,1,0,0,1,1,0,1,0,0,1,1,1,0,0,1,1,1,1},new int[]{0,0,1,1,0,1,1,0,0,0,0,1,1,1,0,1,1,0,1,1,1,1,0,1,1,1,1,1,0,0,1,1},new int[]{0,0,0,1,1,0,0,0,1,0,1,1,0,1,1,0,1,0,0,1,0,0,1,0,0,0,0,1,1,0,1,0},new int[]{1,1,1,0,0,1,1,0,0,1,0,0,0,0,1,1,0,1,0,0,1,1,0,1,1,0,1,1,1,0,1,1},new int[]{1,0,0,0,0,1,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0},new int[]{0,1,1,1,1,1,0,1,1,0,0,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1},new int[]{1,0,0,1,1,1,0,1,0,0,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,0,1,1,0,1,0,0},new int[]{0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,1,0},new int[]{0,0,1,1,1,1,0,1,1,0,1,1,1,1,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,1,0,0},new int[]{0,0,1,1,1,0,1,1,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,0,1,1,1,1,1},new int[]{0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,1,1,1,1,0,0,0}}); param0.add(new int[][]{new int[]{8,14,19,21,33,35,37,40,44,49,52,68,68,72,77,80,86,88,88,99},new int[]{10,12,18,18,25,27,30,32,32,42,46,47,48,53,67,69,70,84,85,89},new int[]{12,15,18,24,26,33,41,45,55,71,73,79,82,87,88,88,89,91,92,98},new int[]{1,1,11,16,24,24,27,42,49,50,69,69,72,73,75,80,80,82,95,96},new int[]{1,6,12,13,14,22,28,30,39,51,53,66,68,68,69,77,86,90,96,99},new int[]{2,6,24,26,28,32,32,37,38,54,56,61,64,64,68,71,71,76,79,86},new int[]{22,31,32,34,39,47,54,57,59,61,62,72,72,74,79,79,80,85,91,93},new int[]{3,7,12,13,15,16,21,26,26,36,56,60,62,63,64,66,67,71,76,83},new int[]{3,22,29,30,34,35,36,39,41,42,43,51,57,58,72,72,80,84,88,92},new int[]{9,14,17,29,34,37,38,39,40,46,46,52,62,68,77,78,79,92,93,95},new int[]{1,17,17,18,19,23,26,27,36,37,48,53,56,62,62,68,69,78,78,84},new int[]{20,20,22,33,33,33,43,48,60,63,64,70,77,80,80,85,87,88,91,94},new int[]{7,10,10,13,14,14,23,42,64,65,65,72,73,74,75,76,77,78,79,91},new int[]{1,4,9,12,13,13,23,23,27,33,34,34,37,40,43,63,67,70,87,96},new int[]{1,2,8,11,12,14,14,23,24,33,44,45,47,55,78,79,83,98,98,99},new int[]{3,9,18,21,24,28,34,35,45,46,59,60,60,63,64,84,95,96,97,97},new int[]{4,11,17,19,20,20,20,30,31,41,45,47,64,68,76,81,83,89,93,93},new int[]{2,8,10,21,38,40,43,44,47,52,55,71,75,80,85,85,89,92,94,99},new int[]{3,7,13,14,27,28,29,30,44,47,50,53,55,64,64,75,79,86,98,99},new int[]{10,10,10,16,17,33,44,52,53,57,59,64,65,74,75,76,80,87,90,90}}); param0.add(new int[][]{new int[]{-78,34,-74,16,-10,-10,-14,28},new int[]{-22,-84,48,-20,2,86,88,-60},new int[]{32,16,98,30,-10,48,82,56},new int[]{48,-32,-76,-54,36,56,6,82},new int[]{6,-20,64,56,6,-28,30,-72},new int[]{-32,-48,10,26,40,-8,-26,-54},new int[]{-68,-36,-86,-12,-6,62,-90,26},new int[]{-76,80,44,-82,92,-12,-56,-8}}); param0.add(new int[][]{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},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},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},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},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},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},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,1,1,1,1},new int[]{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},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},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},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},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},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},new int[]{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},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},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},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},new int[]{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},new int[]{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},new int[]{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},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},new int[]{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},new int[]{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},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},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},new int[]{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},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},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[][]{new int[]{76,57,99,99,95,61,64,17,58,47},new int[]{52,18,37,70,17,3,33,84,80,7},new int[]{2,34,4,49,17,71,12,76,74,44},new int[]{89,49,69,17,38,56,61,75,86,84},new int[]{32,56,87,23,66,67,97,5,23,51},new int[]{25,24,30,51,30,72,46,57,29,85},new int[]{80,62,87,29,37,90,88,40,55,26},new int[]{27,75,51,91,22,65,38,91,1,15},new int[]{11,56,38,93,54,94,23,90,37,51},new int[]{61,82,79,22,66,55,67,26,93,93}}); List<Integer> param1 = new ArrayList<>(); param1.add(45); param1.add(8); param1.add(18); param1.add(8); param1.add(9); param1.add(18); param1.add(15); param1.add(7); param1.add(17); 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,114
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/HOW_TO_AVOID_OVERFLOW_IN_MODULAR_MULTIPLICATION.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_TO_AVOID_OVERFLOW_IN_MODULAR_MULTIPLICATION{ static long f_gold ( long a , long b , long mod ) { long res = 0 ; a = a % mod ; while ( b > 0 ) { if ( b % 2 == 1 ) { res = ( res + a ) % mod ; } a = ( a * 2 ) % mod ; b /= 2 ; } return res % mod ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Long> param0 = new ArrayList<>(); param0.add(99L); param0.add(11L); param0.add(51L); param0.add(49L); param0.add(9L); param0.add(90L); param0.add(19L); param0.add(17L); param0.add(54L); param0.add(5L); List<Long> param1 = new ArrayList<>(); param1.add(75L); param1.add(4L); param1.add(37L); param1.add(51L); param1.add(34L); param1.add(85L); param1.add(96L); param1.add(96L); param1.add(3L); param1.add(69L); List<Long> param2 = new ArrayList<>(); param2.add(40L); param2.add(41L); param2.add(23L); param2.add(88L); param2.add(30L); param2.add(55L); param2.add(41L); param2.add(37L); param2.add(51L); param2.add(60L); 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,115
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_COST_TO_FILL_GIVEN_WEIGHT_IN_A_BAG.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_COST_TO_FILL_GIVEN_WEIGHT_IN_A_BAG{ public static int f_gold ( int cost [ ] , int n , int W ) { Vector < Integer > val = new Vector < Integer > ( ) ; Vector < Integer > wt = new Vector < Integer > ( ) ; int size = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( cost [ i ] != - 1 ) { val . add ( cost [ i ] ) ; wt . add ( i + 1 ) ; size ++ ; } } n = size ; int min_cost [ ] [ ] = new int [ n + 1 ] [ W + 1 ] ; for ( int i = 0 ; i <= W ; i ++ ) min_cost [ 0 ] [ i ] = Integer . MAX_VALUE ; for ( int i = 1 ; i <= n ; i ++ ) min_cost [ i ] [ 0 ] = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= W ; j ++ ) { if ( wt . get ( i - 1 ) > j ) min_cost [ i ] [ j ] = min_cost [ i - 1 ] [ j ] ; else min_cost [ i ] [ j ] = Math . min ( min_cost [ i - 1 ] [ j ] , min_cost [ i ] [ j - wt . get ( i - 1 ) ] + val . get ( i - 1 ) ) ; } } return ( min_cost [ n ] [ W ] == Integer . MAX_VALUE ) ? - 1 : min_cost [ n ] [ W ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{6,38,74}); param0.add(new int[]{-40,52,-54,-26,66,-28,22,-10,-28,-12,38,-92,28,76,-34,30,-16,-68,-20,56,-34,-68}); 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}); param0.add(new int[]{77,50,40,94,43,9,36,29,39,69,7,45,91,97,94,89,76,86,96,1,12,94,92,39,4,22,49,31,34,84,61,11,39,8,59,9,27,66,33,37,25,18,36,78,8,45,91}); param0.add(new int[]{-94,-92,-84,-82,-74,-62,-56,-46,-46,-42,-32,-30,-28,-24,-20,-18,-12,-10,-6,0,4,12,18,38,42,48,66,78,84,90,92}); param0.add(new int[]{1,1,0,1,1,1,0,1,1,0,1,0}); param0.add(new int[]{1,6,10,10,14,15,16,19,22,25,28,31,36,37,37,39,41,43,45,48,49,50,54,54,57,60,66,70,71,71,72,72,75,75,76,79,81,83,83,83,85,87,87,88,89,90,94}); param0.add(new int[]{-30,-82,-14,-6,98,-22,54,-54,94,32,54,-6,60,30,62,-6,24}); param0.add(new int[]{0,0,1,1,1}); param0.add(new int[]{35,52,40,62,28,59,52,81,69,20,9,11,62,40,5,50,52,62,93,31,90,10,47,93,32,56,39,86}); List<Integer> param1 = new ArrayList<>(); param1.add(1); param1.add(21); param1.add(19); param1.add(34); param1.add(15); param1.add(7); param1.add(45); param1.add(10); param1.add(2); param1.add(16); List<Integer> param2 = new ArrayList<>(); param2.add(2); param2.add(20); param2.add(28); param2.add(40); param2.add(29); param2.add(9); param2.add(32); param2.add(12); param2.add(2); 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,116
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PROGRAM_CENSOR_WORD_ASTERISKS_SENTENCE.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_CENSOR_WORD_ASTERISKS_SENTENCE{ static String f_gold ( String text , String word ) { String [ ] word_list = text . split ( "\\s+" ) ; String result = "" ; String stars = "" ; for ( int i = 0 ; i < word . length ( ) ; i ++ ) stars += '*' ; int index = 0 ; for ( String i : word_list ) { if ( i . compareTo ( word ) == 0 ) word_list [ index ] = stars ; index ++ ; } for ( String i : word_list ) result += i + ' ' ; return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("IggvAXtmJ"); param0.add("76711241128"); param0.add("010"); param0.add("HIKOn"); param0.add("3680369217"); param0.add("1111"); param0.add("zIi"); param0.add("06"); param0.add("111"); param0.add("NJNnrVU"); List<String> param1 = new ArrayList<>(); param1.add("kzHdEJuCaO"); param1.add("5"); param1.add("0101001"); param1.add("XlnBwpx"); param1.add("017523"); param1.add("1011"); param1.add("ONNXygON"); param1.add("54171617"); param1.add("0010001011001"); param1.add("AGwmS"); 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,117
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_EXPRESSION_DUPLICATE_PARENTHESIS_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 FIND_EXPRESSION_DUPLICATE_PARENTHESIS_NOT{ static boolean f_gold ( String s ) { Stack < Character > Stack = new Stack < > ( ) ; char [ ] str = s . toCharArray ( ) ; for ( char ch : str ) { if ( ch == ')' ) { char top = Stack . peek ( ) ; Stack . pop ( ) ; int elementsInside = 0 ; while ( top != '(' ) { elementsInside ++ ; top = Stack . peek ( ) ; Stack . pop ( ) ; } if ( elementsInside < 1 ) { return true ; } } else { Stack . push ( ch ) ; } } return false ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("((a+b)+((c+d)))"); param0.add("(((a+(b)))+(c+d))"); param0.add("(((a+(b))+c+d))"); param0.add("((a+b)+(c+d))"); param0.add("(8582007)"); param0.add("((a+(b))+(c+d))"); param0.add("(PylsShEdKAE)"); param0.add("886980680541"); param0.add("001"); param0.add("jsVmFeOq"); 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,118
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PROGRAM_FIND_SLOPE_LINE.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_FIND_SLOPE_LINE{ static float f_gold ( float x1 , float y1 , float x2 , float y2 ) { return ( y2 - y1 ) / ( x2 - x1 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Float> param0 = new ArrayList<>(); param0.add(236.27324548309292F); param0.add(-9201.144918204123F); param0.add(3480.4716834445326F); param0.add(-6915.538971485092F); param0.add(8887.97173657486F); param0.add(-3785.5177159369946F); param0.add(3037.6696554256832F); param0.add(-7925.458496016523F); param0.add(1404.2919985268031F); param0.add(-4748.744241168378F); List<Float> param1 = new ArrayList<>(); param1.add(5792.493225762838F); param1.add(-2716.3347716140406F); param1.add(3577.9608612055613F); param1.add(-4113.601103381095F); param1.add(1678.4080012662428F); param1.add(-3084.67461899163F); param1.add(4432.445827549F); param1.add(-3350.27411882042F); param1.add(8971.636233373416F); param1.add(-675.557388148954F); List<Float> param2 = new ArrayList<>(); param2.add(7177.837879115863F); param2.add(-5161.142121227645F); param2.add(8611.515262945342F); param2.add(-748.3462104020822F); param2.add(8709.574949883017F); param2.add(-7415.76208254121F); param2.add(8387.304165588026F); param2.add(-5619.767086756504F); param2.add(3039.112051378511F); param2.add(-5998.241086029875F); List<Float> param3 = new ArrayList<>(); param3.add(1289.5700425822731F); param3.add(-3205.784279961129F); param3.add(6744.864707668983F); param3.add(-9245.271700539257F); param3.add(8548.492675510739F); param3.add(-887.5389305564152F); param3.add(611.3373507518394F); param3.add(-1185.7423219907591F); param3.add(1947.6756252708972F); param3.add(-4236.658178504375F); for(int i = 0; i < param0.size(); ++i) { if(Math.abs(1 - (0.0000001 + Math.abs(f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) )/ (Math.abs(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) + 0.0000001)) < 0.001F) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,119
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/ZECKENDORFS_THEOREM_NON_NEIGHBOURING_FIBONACCI_REPRESENTATION.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 ZECKENDORFS_THEOREM_NON_NEIGHBOURING_FIBONACCI_REPRESENTATION{ public static int f_gold ( int n ) { if ( n == 0 || n == 1 ) return n ; int f1 = 0 , f2 = 1 , f3 = 1 ; while ( f3 <= n ) { f1 = f2 ; f2 = f3 ; f3 = f1 + f2 ; } return f2 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(54); param0.add(71); param0.add(64); param0.add(71); param0.add(96); param0.add(43); param0.add(70); param0.add(94); param0.add(95); param0.add(69); 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,120
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_OF_ALL_ELEMENTS_UP_TO_NTH_ROW_IN_A_PASCALS_TRIANGLE.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_OF_ALL_ELEMENTS_UP_TO_NTH_ROW_IN_A_PASCALS_TRIANGLE{ static long f_gold ( int n ) { long sum = 0 ; for ( int row = 0 ; row < n ; row ++ ) { sum = sum + ( 1 << row ) ; } return sum ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(21); param0.add(4); param0.add(31); param0.add(79); param0.add(38); param0.add(75); param0.add(36); param0.add(32); param0.add(23); param0.add(65); 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,121
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NUMBER_N_DIGITS_NON_DECREASING_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 NUMBER_N_DIGITS_NON_DECREASING_INTEGERS{ static int f_gold ( int n ) { int [ ] [ ] a = new int [ n + 1 ] [ 10 ] ; for ( int i = 0 ; i <= 9 ; i ++ ) a [ 0 ] [ i ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) a [ i ] [ 9 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) for ( int j = 8 ; j >= 0 ; j -- ) a [ i ] [ j ] = a [ i - 1 ] [ j ] + a [ i ] [ j + 1 ] ; return a [ n ] [ 0 ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(2); param0.add(19); param0.add(79); param0.add(62); param0.add(93); param0.add(39); param0.add(7); param0.add(31); param0.add(3); param0.add(21); 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,122
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/ADD_1_TO_A_GIVEN_NUMBER.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 ADD_1_TO_A_GIVEN_NUMBER{ static int f_gold ( int x ) { int m = 1 ; while ( ( int ) ( x & m ) >= 1 ) { x = x ^ m ; m <<= 1 ; } x = x ^ m ; return x ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(96); param0.add(66); param0.add(67); param0.add(13); param0.add(75); param0.add(78); param0.add(1); param0.add(83); param0.add(27); param0.add(65); 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,123
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SEARCH_INSERT_AND_DELETE_IN_AN_UNSORTED_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 SEARCH_INSERT_AND_DELETE_IN_AN_UNSORTED_ARRAY{ static int f_gold ( int arr [ ] , int n , int key ) { for ( int i = 0 ; i < n ; i ++ ) if ( arr [ i ] == key ) return i ; return - 1 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,8,11,23,55,57,73,74,77,79,93}); param0.add(new int[]{-88,12,-62,-66,-24,18,12,22,94,30,-50,-42,-94,18,76,-6,-48,-68,48,36,-78,52,-82,76,2,-44,-10,88}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}); param0.add(new int[]{33,9,93,70,81,70,56,66,72,81,74,32,71,72,3,81,70,22,82,2,75,18,90,29,48}); param0.add(new int[]{-98,-70,-62,-60,-60,-54,-48,-48,-46,-44,-34,-26,-18,-6,4,18,28,32,34,40,50,54,56,62,64,64,98}); param0.add(new int[]{1,1,1,1,0,0,0,0,1,0,0,1,0,0,1,1,0,1,1,0,0,1}); param0.add(new int[]{4,6,7,10,10,12,13,18,23,29,29,34,46,54,60,61,63,67,69,70,72,76,79,79,81,82,88,90,99}); param0.add(new int[]{94,34,-60,-74,86,80,68,-48,78,-62,-98,-44,-44,92,-94,-86,-36,12,84,-90,52,42,-42,-66,88,76,66}); param0.add(new int[]{0,0,0,1}); param0.add(new int[]{76,59,38,83,38,93,27,11,17,80,26,28,35,53,88,10,9,75}); List<Integer> param1 = new ArrayList<>(); param1.add(8); param1.add(27); param1.add(11); param1.add(24); param1.add(18); param1.add(17); param1.add(15); param1.add(21); param1.add(2); param1.add(12); List<Integer> param2 = new ArrayList<>(); param2.add(11); param2.add(12); param2.add(0); param2.add(72); param2.add(23); param2.add(16); param2.add(28); param2.add(16); param2.add(3); 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()); } } 11 12 0 72
1,124
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAKE_LARGEST_PALINDROME_CHANGING_K_DIGITS.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 MAKE_LARGEST_PALINDROME_CHANGING_K_DIGITS{ static String f_gold ( String str , int k ) { char palin [ ] = str . toCharArray ( ) ; String ans = "" ; int l = 0 ; int r = str . length ( ) - 1 ; while ( l < r ) { if ( str . charAt ( l ) != str . charAt ( r ) ) { palin [ l ] = palin [ r ] = ( char ) Math . max ( str . charAt ( l ) , str . charAt ( r ) ) ; k -- ; } l ++ ; r -- ; } if ( k < 0 ) { return "Not possible" ; } l = 0 ; r = str . length ( ) - 1 ; while ( l <= r ) { if ( l == r ) { if ( k > 0 ) { palin [ l ] = '9' ; } } if ( palin [ l ] < '9' ) { if ( k >= 2 && palin [ l ] == str . charAt ( l ) && palin [ r ] == str . charAt ( r ) ) { k -= 2 ; palin [ l ] = palin [ r ] = '9' ; } else if ( k >= 1 && ( palin [ l ] != str . charAt ( l ) || palin [ r ] != str . charAt ( r ) ) ) { k -- ; palin [ l ] = palin [ r ] = '9' ; } } l ++ ; r -- ; } for ( int i = 0 ; i < palin . length ; i ++ ) ans += palin [ i ] ; return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("wUJmbRlwogtFv"); param0.add("43435"); param0.add("43435"); param0.add("12345"); param0.add("5032"); param0.add("0100000001101"); param0.add("sBrbNQiRwQd"); param0.add("7549384614"); param0.add("10000001"); param0.add("VqrTsaoD"); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(3); param1.add(1); param1.add(1); param1.add(3); param1.add(5); param1.add(4); param1.add(3); param1.add(4); param1.add(4); 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,125
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_THE_MISSING_NUMBER_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_MISSING_NUMBER_2{ static int f_gold ( int a [ ] , int n ) { int x1 = a [ 0 ] ; int x2 = 1 ; for ( int i = 1 ; i < n ; i ++ ) x1 = x1 ^ a [ i ] ; for ( int i = 2 ; i <= n + 1 ; i ++ ) x2 = x2 ^ i ; return ( x1 ^ x2 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,5,7,8,10,14,27,32,51,52,57,58,65,68,68,72,73,73,83,92,98}); param0.add(new int[]{-60,-48,38,-78,88,86,-4,-94,16,-64,32,88,58,-78,-16,48,38,30,66,-60,20,40,-28,-64,-48,-86,-80,-8,-58,52,80,-32,46,-4,-70,76,-4,78,-64,38,-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,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[]{69,59,22,33,69,28,11,34,72,88,16,30,69,89,43,4,65,85,27}); param0.add(new int[]{-98,-98,-92,-88,-88,-82,-74,-70,-68,-60,-60,-48,-38,-34,-34,-24,14,38,50,58,62,64,64,68,76,78,78,86,88,90,92,98,98}); param0.add(new int[]{0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,1,0,0,0,0,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,0}); param0.add(new int[]{1,9,12,12,24,25,33,33,36,39,46,48,48,52,52,53,57,69,71,72,75,76,78,80,82,86,89,91,94,95,96,97,98,99}); param0.add(new int[]{62,-66,60,-92,46,6,-52,48,72,-64,34,20,50,70,-34,20,-70,14,-44,66,-70}); 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}); param0.add(new int[]{33,10,6,71,18,22,15,57,56,63,35,93,31,43,98,99,62,39,44,86,78,95,6,76,71}); List<Integer> param1 = new ArrayList<>(); param1.add(12); param1.add(28); param1.add(38); param1.add(13); param1.add(23); param1.add(41); param1.add(30); param1.add(17); param1.add(30); 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,126
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/REMOVE_BRACKETS_ALGEBRAIC_STRING_CONTAINING_OPERATORS.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_BRACKETS_ALGEBRAIC_STRING_CONTAINING_OPERATORS{ static String f_gold ( String str ) { int len = str . length ( ) ; char res [ ] = new char [ len ] ; int index = 0 , i = 0 ; Stack < Integer > s = new Stack < Integer > ( ) ; s . push ( 0 ) ; while ( i < len ) { if ( str . charAt ( i ) == '+' ) { if ( s . peek ( ) == 1 ) res [ index ++ ] = '-' ; if ( s . peek ( ) == 0 ) res [ index ++ ] = '+' ; } else if ( str . charAt ( i ) == '-' ) { if ( s . peek ( ) == 1 ) res [ index ++ ] = '+' ; else if ( s . peek ( ) == 0 ) res [ index ++ ] = '-' ; } else if ( str . charAt ( i ) == '(' && i > 0 ) { if ( str . charAt ( i - 1 ) == '-' ) { int x = ( s . peek ( ) == 1 ) ? 0 : 1 ; s . push ( x ) ; } else if ( str . charAt ( i - 1 ) == '+' ) s . push ( s . peek ( ) ) ; } else if ( str . charAt ( i ) == ')' ) s . pop ( ) ; else res [ index ++ ] = str . charAt ( i ) ; i ++ ; } return new String ( res ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("ggbsMvMZcMOVd"); param0.add("384292670"); param0.add("10000100"); param0.add("fdHME"); param0.add("09198832"); param0.add("0011111011"); param0.add("SnXwRS"); param0.add("071"); param0.add("01101"); param0.add("xwmqxgBa"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)).equals(f_gold(param0.get(i)))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,127
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FINDING_POWER_PRIME_NUMBER_P_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 FINDING_POWER_PRIME_NUMBER_P_N_1{ static int f_gold ( int n , int p ) { int ans = 0 ; int temp = p ; while ( temp <= n ) { ans += n / temp ; temp = temp * p ; } return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(76); param0.add(77); param0.add(9); param0.add(59); param0.add(8); param0.add(97); param0.add(78); param0.add(41); param0.add(72); param0.add(71); List<Integer> param1 = new ArrayList<>(); param1.add(43); param1.add(91); param1.add(42); param1.add(67); param1.add(52); param1.add(8); param1.add(24); param1.add(88); param1.add(61); 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,128
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DICE_THROW_PROBLEM_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 DICE_THROW_PROBLEM_1{ public static long f_gold ( int f , int d , int s ) { long mem [ ] [ ] = new long [ d + 1 ] [ s + 1 ] ; mem [ 0 ] [ 0 ] = 1 ; for ( int i = 1 ; i <= d ; i ++ ) { for ( int j = i ; j <= s ; j ++ ) { mem [ i ] [ j ] = mem [ i ] [ j - 1 ] + mem [ i - 1 ] [ j - 1 ] ; if ( j - f - 1 >= 0 ) mem [ i ] [ j ] -= mem [ i - 1 ] [ j - f - 1 ] ; } } return mem [ d ] [ s ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(57); param0.add(58); param0.add(38); param0.add(5); param0.add(91); param0.add(76); param0.add(38); param0.add(97); param0.add(97); param0.add(99); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(45); param1.add(89); param1.add(39); param1.add(90); param1.add(56); param1.add(43); param1.add(26); param1.add(90); param1.add(2); List<Integer> param2 = new ArrayList<>(); param2.add(33); param2.add(4); param2.add(9); param2.add(30); param2.add(47); param2.add(46); param2.add(84); param2.add(52); param2.add(90); param2.add(26); 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,129
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_REPEATING_ELEMENT_SORTED_ARRAY_SIZE_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 FIND_REPEATING_ELEMENT_SORTED_ARRAY_SIZE_N{ static int f_gold ( int arr [ ] , int low , int high ) { if ( low > high ) return - 1 ; int mid = ( low + high ) / 2 ; if ( arr [ mid ] != mid + 1 ) { if ( mid > 0 && arr [ mid ] == arr [ mid - 1 ] ) return 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[]{15,21,32,42,42,44,57,68,75,80,83,84}); param0.add(new int[]{-60,-90,-88,-80,-86,18,54,56,84,42,-60,-90,52,-44,-62,-56,-16,28,22,-24,-36,-56,80,68,-16}); 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}); param0.add(new int[]{87,43,74}); param0.add(new int[]{-82,-66,-66,-62,-56,-52,-44,-42,-28,-22,-12,-6,-4,-2,18,26,26,28,42,42,56,58,78,90,92,94,96,96}); param0.add(new int[]{0,1,1,1,1,1,0,1,1,1,1,0,0,1,0,0,1,0,1,1,1}); param0.add(new int[]{6,9,14,17,22,31,32,33,36,39,42,43,46,46,46,47,49,53,60,61,67,68,72,75,77,77,84,84,85,89,94,94,95}); param0.add(new int[]{-88,82,-10,-10,68,-86,70,92,-54,-10,-56}); param0.add(new int[]{0,0,0,0,0,0,1,1,1,1,1}); param0.add(new int[]{35,66,47,42,95,10,84,80,23,35,21,71,39,9,38,40,22,65}); List<Integer> param1 = new ArrayList<>(); param1.add(6); param1.add(23); param1.add(33); param1.add(2); param1.add(20); param1.add(19); param1.add(23); param1.add(7); param1.add(8); param1.add(14); List<Integer> param2 = new ArrayList<>(); param2.add(11); param2.add(12); param2.add(32); param2.add(2); param2.add(21); param2.add(19); param2.add(19); param2.add(10); param2.add(8); param2.add(16); 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,130
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHANGE_ARRAY_PERMUTATION_NUMBERS_1_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; class CHANGE_ARRAY_PERMUTATION_NUMBERS_1_N{ static void f_gold ( int [ ] a , int n ) { HashMap < Integer , Integer > count = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( count . containsKey ( a [ i ] ) ) { count . put ( a [ i ] , count . get ( a [ i ] ) + 1 ) ; } else { count . put ( a [ i ] , 1 ) ; } } int next_missing = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( count . containsKey ( a [ i ] ) && count . get ( a [ i ] ) != 1 || a [ i ] > n || a [ i ] < 1 ) { count . put ( a [ i ] , count . get ( a [ i ] ) - 1 ) ; while ( count . containsKey ( next_missing ) ) next_missing ++ ; a [ i ] = next_missing ; count . put ( next_missing , 1 ) ; } } } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{19}); param0.add(new int[]{-47,72}); 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}); param0.add(new int[]{93,3,20,59,36,19,90,67,19,20,96,71,52,33,40,39}); param0.add(new int[]{-98,-93,-91,-89,-63,-58,-52,-52,-46,-40,-25,-16,-10,-1,-1,4,12,12,13,13,16,20,29,29,31,40,44,47,48,51,52,52,59,60,61,64,66,78,85,97}); param0.add(new int[]{0,1,1,1,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,1,1,0,0,0}); param0.add(new int[]{4,6,8,17,19,21,22,24,27,27,28,30,30,30,32,33,35,37,38,44,46,46,48,49,51,53,54,59,60,61,63,64,64,69,76,85,86,87,92,93,93,95,97,97,97,98,99,99}); param0.add(new int[]{-75,-46,-42,-33,4,74,-76,14,-68,75,-14,51,94,27,55,30,-83,4}); param0.add(new int[]{0,0,0,0,0,1,1,1,1}); param0.add(new int[]{24,13,60,7,57,36,45,20,65,8,16,14,76,87,15,92,98,66,32,87,63,86,51,25,58}); List<Integer> param1 = new ArrayList<>(); param1.add(0); param1.add(1); param1.add(18); param1.add(9); param1.add(22); param1.add(12); param1.add(26); param1.add(9); param1.add(5); param1.add(24); List<int [ ]> filled_function_param0 = new ArrayList<>(); filled_function_param0.add(new int[]{19}); filled_function_param0.add(new int[]{-47,72}); filled_function_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}); filled_function_param0.add(new int[]{93,3,20,59,36,19,90,67,19,20,96,71,52,33,40,39}); filled_function_param0.add(new int[]{-98,-93,-91,-89,-63,-58,-52,-52,-46,-40,-25,-16,-10,-1,-1,4,12,12,13,13,16,20,29,29,31,40,44,47,48,51,52,52,59,60,61,64,66,78,85,97}); filled_function_param0.add(new int[]{0,1,1,1,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,1,1,0,0,0}); filled_function_param0.add(new int[]{4,6,8,17,19,21,22,24,27,27,28,30,30,30,32,33,35,37,38,44,46,46,48,49,51,53,54,59,60,61,63,64,64,69,76,85,86,87,92,93,93,95,97,97,97,98,99,99}); filled_function_param0.add(new int[]{-75,-46,-42,-33,4,74,-76,14,-68,75,-14,51,94,27,55,30,-83,4}); filled_function_param0.add(new int[]{0,0,0,0,0,1,1,1,1}); filled_function_param0.add(new int[]{24,13,60,7,57,36,45,20,65,8,16,14,76,87,15,92,98,66,32,87,63,86,51,25,58}); List<Integer> filled_function_param1 = new ArrayList<>(); filled_function_param1.add(0); filled_function_param1.add(1); filled_function_param1.add(18); filled_function_param1.add(9); filled_function_param1.add(22); filled_function_param1.add(12); filled_function_param1.add(26); filled_function_param1.add(9); filled_function_param1.add(5); filled_function_param1.add(24); for(int i = 0; i < param0.size(); ++i) { f_filled(filled_function_param0.get(i),filled_function_param1.get(i)); f_gold(param0.get(i),param1.get(i)); if(Arrays.equals(param0.get(i), filled_function_param0.get(i)) && param1.get(i) == filled_function_param1.get(i)) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,131
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DIAGONALLY_DOMINANT_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 DIAGONALLY_DOMINANT_MATRIX{ static boolean f_gold ( int m [ ] [ ] , int n ) { for ( int i = 0 ; i < n ; i ++ ) { int sum = 0 ; for ( int j = 0 ; j < n ; j ++ ) sum += Math . abs ( m [ i ] [ j ] ) ; sum -= Math . abs ( m [ i ] [ i ] ) ; if ( Math . abs ( m [ i ] [ i ] ) < sum ) 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[] {3, -2, 1,}, new int[] {1 -3, 2}, new int[] {-1, 2, 4}}); param0.add(new int[][]{ new int[] {2, -2, 1,}, new int[] {1 -3, 2}, new int[] {-1, 2, 4}}); param0.add(new int[][]{new int[]{78,46,33,58,79,94,94,31,69},new int[]{83,48,11,74,33,61,88,15,29},new int[]{27,20,36,14,37,88,49,36,58},new int[]{93,15,39,5,97,45,1,47,34},new int[]{8,88,54,87,60,77,37,46,18},new int[]{10,68,71,86,76,24,47,37,72},new int[]{84,43,82,25,87,18,51,46,75},new int[]{59,39,78,86,38,55,79,5,5},new int[]{50,42,19,34,53,80,21,45,96}}); param0.add(new int[][]{new int[]{88,35,82,14,86,94,12,49,76,94,3,96,27,92,82,25,15,27,15},new int[]{30,75,59,45,53,78,45,92,72,61,11,78,51,86,89,74,39,24,6},new int[]{33,22,60,20,11,35,35,65,90,78,49,66,46,5,39,79,85,93,51},new int[]{21,38,36,14,33,23,72,84,38,47,64,47,1,42,68,78,86,76,25},new int[]{57,52,7,7,56,39,70,83,58,23,10,72,36,71,3,72,77,95,13},new int[]{90,48,66,3,63,15,2,61,59,17,11,5,70,67,23,96,63,4,29},new int[]{17,95,35,48,85,87,48,95,53,65,75,1,7,77,84,70,30,70,98},new int[]{99,84,38,30,97,54,88,95,16,16,27,22,15,46,1,28,33,15,95},new int[]{57,70,68,58,20,4,10,7,91,57,6,55,31,64,36,91,13,75,73},new int[]{72,61,10,66,24,99,34,50,75,1,5,27,7,1,32,17,18,68,49},new int[]{13,69,22,26,68,87,5,9,77,62,73,68,90,78,2,95,50,51,90},new int[]{2,41,64,44,52,37,66,92,56,23,71,39,86,60,56,36,1,98,4},new int[]{41,99,53,31,33,5,43,11,32,1,43,6,92,81,11,41,27,61,76},new int[]{13,95,35,25,94,36,21,55,36,28,27,12,74,26,93,45,6,89,8},new int[]{75,17,38,77,41,15,83,83,74,28,25,79,35,80,37,27,5,59,88},new int[]{66,99,57,61,97,96,60,64,32,16,44,87,90,69,61,71,34,74,86},new int[]{21,19,52,42,39,45,89,13,43,83,71,95,66,45,4,1,60,50,87},new int[]{47,17,86,35,8,56,60,55,7,65,25,24,97,75,96,93,65,47,8},new int[]{45,29,31,57,99,7,31,60,56,32,94,61,61,76,99,64,10,26,69}}); param0.add(new int[][]{new int[]{97,37,30,97,2,42,68,90,94},new int[]{35,10,31,79,85,6,65,74,2},new int[]{9,81,80,66,80,99,59,92,13},new int[]{6,25,63,59,90,46,15,66,86},new int[]{42,92,17,23,15,38,56,34,94},new int[]{65,80,89,87,97,34,73,16,50},new int[]{69,42,62,12,69,87,72,99,80},new int[]{84,28,30,75,50,17,10,88,95},new int[]{11,47,8,31,37,33,9,46,3}}); param0.add(new int[][]{new int[]{28,52,61,24,10,42,37,15,28,37,65,13,59},new int[]{68,56,30,64,67,20,99,27,12,41,80,96,51},new int[]{97,80,29,91,95,51,59,88,31,9,70,30,90},new int[]{40,7,72,59,11,3,4,97,20,5,34,14,13},new int[]{61,49,45,53,24,94,63,75,9,63,56,77,77},new int[]{96,71,75,42,1,64,92,72,15,69,22,20,68},new int[]{45,89,80,40,46,91,63,93,12,52,7,88,55},new int[]{5,47,97,38,43,70,8,86,50,78,9,13,50},new int[]{96,78,35,25,61,31,49,43,45,84,7,74,6},new int[]{89,50,70,45,54,17,86,87,29,64,71,99,20},new int[]{26,93,29,7,34,5,77,6,96,33,43,59,33},new int[]{83,61,18,14,21,39,34,31,81,7,85,71,1},new int[]{86,22,87,92,63,62,46,57,94,45,74,76,80}}); param0.add(new int[][]{new int[]{68,37,94,90,14,37,89,91,14,66,66,33,2},new int[]{98,53,89,55,45,37,27,90,52,86,47,58,7},new int[]{13,48,28,45,56,92,88,35,55,97,37,9,3},new int[]{2,58,22,85,24,78,54,97,17,58,58,21,77},new int[]{63,63,44,40,75,66,92,67,79,46,24,72,70},new int[]{96,51,99,77,92,4,31,65,30,72,40,14,44},new int[]{92,34,39,4,88,27,42,11,87,32,50,53,4},new int[]{19,71,33,78,77,70,83,55,9,62,99,62,48},new int[]{90,68,48,92,27,55,44,71,52,57,9,98,8},new int[]{56,10,65,72,45,39,46,17,82,98,99,67,76},new int[]{62,68,36,9,35,67,89,52,90,91,28,58,83},new int[]{24,59,37,38,25,98,15,16,55,4,26,39,57},new int[]{47,90,48,92,49,37,38,62,61,74,97,8,38}}); param0.add(new int[][]{new int[]{85,56,45,50,20,63,55,34,92,32,76,73,43,79,13,2,61,84,14,42,15,93,85,10,56,53,58,85,99,81,62,57,63,4,78,96},new int[]{82,34,32,78,34,70,40,35,15,51,20,92,37,38,21,88,10,54,9,86,42,16,24,4,44,23,42,86,66,92,19,20,28,24,91,2},new int[]{7,1,11,51,60,31,30,77,24,18,58,77,17,46,94,19,12,90,82,12,50,66,20,6,1,90,7,96,55,97,74,15,95,24,29,82},new int[]{71,34,78,84,93,37,42,64,95,19,23,71,6,99,93,55,77,39,25,98,83,4,88,33,66,2,14,50,11,34,38,92,39,22,42,97},new int[]{95,57,78,38,9,88,29,69,42,60,39,91,72,93,60,53,76,8,21,56,48,47,9,78,1,55,31,80,91,11,66,60,31,50,60,88},new int[]{62,39,3,58,68,30,67,68,58,77,53,14,10,78,81,22,63,61,46,37,21,89,3,19,32,79,24,73,74,48,96,58,40,7,46,91},new int[]{15,85,74,87,5,59,70,22,28,54,19,14,48,7,79,32,22,46,85,83,13,22,10,44,24,59,62,72,72,55,49,50,19,82,58,97},new int[]{48,93,96,72,96,12,86,20,45,26,81,98,31,82,59,3,18,84,21,57,99,42,62,30,61,36,55,4,15,71,96,97,57,63,77,64},new int[]{17,53,40,70,50,68,15,72,34,30,87,73,24,8,57,70,25,77,34,25,18,73,97,70,14,6,82,90,36,36,75,18,15,94,89,16},new int[]{76,14,47,54,58,77,30,46,16,1,41,93,27,77,62,81,28,20,55,51,69,88,73,97,34,27,97,38,29,35,20,19,5,25,93,26},new int[]{51,66,61,15,45,6,58,1,73,43,16,14,74,19,51,8,48,12,70,35,70,6,99,11,38,91,26,28,72,89,83,80,50,58,26,44},new int[]{15,76,24,77,59,57,17,77,81,1,11,20,31,99,39,63,6,99,28,51,53,44,65,80,12,28,79,72,68,95,30,35,6,85,30,80},new int[]{63,8,91,33,43,76,43,45,87,54,65,7,36,25,85,37,12,32,49,38,56,80,65,26,57,14,56,70,41,51,84,67,12,97,49,1},new int[]{19,66,58,87,72,98,4,8,27,26,97,43,40,50,67,73,74,29,85,42,18,81,21,67,62,27,96,93,47,93,26,9,91,12,16,47},new int[]{56,66,51,27,73,66,62,71,8,38,6,59,19,79,56,28,94,91,10,45,95,65,50,32,61,16,6,66,62,66,67,19,4,43,18,82},new int[]{46,46,85,21,30,64,41,17,5,5,73,75,48,78,38,6,58,14,72,94,59,65,89,13,27,25,56,68,59,95,49,18,81,75,76,3},new int[]{79,57,6,69,31,8,10,3,12,92,76,94,19,21,81,14,75,29,7,49,65,7,14,16,99,16,85,13,82,29,85,73,95,61,37,17},new int[]{31,59,88,47,6,32,31,18,9,3,71,26,13,34,43,93,33,69,36,79,74,68,47,61,45,96,88,84,48,41,38,68,75,11,16,65},new int[]{97,71,67,71,1,97,71,4,82,37,14,79,25,82,4,66,43,26,84,15,6,37,43,42,13,16,42,38,66,65,5,30,95,43,32,67},new int[]{67,42,5,99,86,96,59,23,8,68,70,91,19,44,93,38,44,6,3,96,80,33,66,58,26,99,28,43,75,88,16,89,23,59,35,89},new int[]{41,97,22,74,1,46,22,32,87,30,87,43,12,83,71,27,26,18,92,75,66,81,61,46,29,32,15,60,82,28,27,41,47,33,44,50},new int[]{10,24,34,91,20,25,55,90,43,53,85,50,55,13,49,97,10,92,97,11,78,84,20,72,79,97,83,48,76,17,33,20,46,31,51,83},new int[]{19,62,44,77,38,49,65,11,27,58,64,65,15,82,89,1,19,56,64,34,64,10,76,60,39,66,32,51,26,57,84,60,55,6,7,66},new int[]{81,26,95,98,82,78,5,87,1,84,2,65,10,50,51,69,41,58,77,68,24,91,56,36,2,96,56,81,12,12,85,72,22,74,84,62},new int[]{64,28,89,28,4,45,90,13,83,98,80,4,61,84,26,94,6,77,56,81,27,35,97,82,58,84,63,33,95,83,97,81,33,69,40,47},new int[]{45,27,7,58,14,4,82,34,80,91,38,20,46,19,1,23,62,73,28,84,80,77,33,3,79,16,30,25,78,1,33,37,29,37,61,8},new int[]{1,63,88,65,46,43,10,82,85,10,62,86,51,45,73,73,45,85,58,95,66,24,97,75,65,55,51,72,73,21,47,22,29,40,3,49},new int[]{25,82,11,94,89,75,98,88,48,32,3,45,89,20,20,51,81,20,82,14,98,80,32,72,42,80,39,38,64,4,99,92,63,61,78,5},new int[]{66,45,50,88,3,23,11,38,56,35,65,6,70,40,90,35,13,25,86,81,78,67,68,99,47,55,92,43,2,45,48,62,38,47,4,60},new int[]{49,76,34,44,94,85,56,92,42,50,69,33,98,96,91,67,42,44,68,57,36,41,56,3,56,56,65,39,40,39,27,67,94,65,74,3},new int[]{3,37,98,20,11,83,91,24,70,65,83,74,32,62,55,36,66,37,14,46,77,56,50,61,17,27,54,29,13,49,25,88,23,26,48,36},new int[]{6,80,74,39,57,91,66,10,72,9,77,72,27,46,63,42,85,41,34,93,30,44,80,1,45,47,93,30,22,15,84,38,23,31,57,81},new int[]{35,66,53,31,26,31,72,80,12,53,56,83,62,44,58,77,65,13,61,68,51,62,48,95,63,72,91,72,51,24,86,40,29,73,17,1},new int[]{96,84,1,25,41,91,23,18,95,28,85,12,88,49,97,81,97,16,27,53,92,36,7,34,65,4,26,20,51,77,99,10,8,18,17,69},new int[]{30,95,39,61,24,81,98,35,79,61,75,98,72,15,36,55,37,87,62,64,39,90,98,75,12,72,8,41,69,74,3,43,37,86,57,25},new int[]{4,58,37,8,94,9,79,1,13,68,16,44,65,14,91,26,32,2,16,92,49,90,75,23,94,60,95,66,20,93,74,18,59,31,4,27}}); param0.add(new int[][]{new int[]{95,71,19,39,66,78,46,92,38,67,29,91,57,48,52,48,61,67,48,94,82,8,74,86,88,67,14,47,24,91,62,58,34,31,48,91,45,29,29,63,48,12,78,27},new int[]{47,66,37,45,57,18,13,73,29,56,74,20,29,6,26,61,86,43,47,26,81,1,95,73,26,64,62,6,62,66,42,27,65,30,82,98,85,65,47,32,34,47,14,5},new int[]{36,96,9,35,25,75,46,13,61,30,98,32,30,82,56,67,71,55,98,8,43,48,58,32,78,69,7,74,20,62,21,92,29,70,38,42,3,37,17,33,10,37,33,28},new int[]{87,42,58,48,51,10,8,16,96,62,49,89,15,16,81,27,47,26,72,41,11,91,9,54,11,7,28,94,62,55,36,73,99,63,51,77,48,68,10,26,67,53,43,17},new int[]{27,22,36,72,33,90,95,53,11,93,29,38,58,15,54,62,57,79,71,58,49,53,29,33,46,54,80,98,85,7,29,9,49,71,78,94,88,51,98,8,55,65,98,84},new int[]{95,79,15,51,34,69,86,12,45,31,54,93,22,72,64,60,28,21,75,75,87,77,43,27,23,97,90,36,97,38,16,74,43,41,44,52,17,52,43,23,1,93,25,6},new int[]{74,54,78,23,19,56,53,31,38,19,1,77,50,98,58,81,32,49,98,97,92,44,29,88,48,80,77,26,7,44,14,52,32,75,32,75,84,57,52,34,61,62,86,87},new int[]{93,76,31,29,31,12,35,57,41,27,15,94,71,36,24,82,24,96,76,28,75,3,3,29,32,54,38,95,56,65,21,41,20,60,75,59,74,55,3,14,45,95,99,60},new int[]{49,9,54,70,93,52,63,52,22,55,3,2,59,28,37,69,9,62,32,81,75,35,47,18,36,19,25,46,60,95,23,78,27,35,77,55,36,88,97,71,9,21,32,66},new int[]{44,89,65,75,80,87,15,27,16,46,97,72,48,65,19,90,37,58,55,53,47,3,88,86,62,1,39,73,33,23,34,49,49,99,49,10,96,66,71,88,67,76,39,42},new int[]{91,1,46,36,96,91,44,31,97,58,96,4,53,89,93,57,73,78,50,5,52,17,32,6,69,93,92,61,10,23,53,61,19,4,46,32,84,46,62,92,54,87,67,24},new int[]{66,18,96,48,46,48,62,94,27,62,78,65,52,1,50,40,72,17,1,78,77,30,77,67,22,35,56,14,45,86,33,12,24,69,57,9,2,59,95,29,93,55,94,22},new int[]{85,49,12,71,89,8,97,16,40,45,64,63,51,10,76,86,71,45,85,56,86,73,84,13,64,88,30,52,54,57,18,25,53,20,11,40,98,23,90,87,42,47,56,33},new int[]{89,98,26,69,29,94,60,91,37,25,74,44,34,12,93,39,19,19,29,66,90,98,94,76,20,57,97,9,2,28,34,21,83,78,81,56,5,85,22,59,40,84,92,63},new int[]{32,45,83,92,87,33,82,35,46,36,62,83,90,26,7,87,5,87,32,79,91,81,84,57,80,62,28,95,80,78,74,66,97,41,86,66,64,7,41,45,44,30,38,39},new int[]{19,47,38,17,74,79,69,99,4,35,1,81,85,58,22,5,60,36,9,84,57,78,84,90,4,51,39,84,52,75,71,55,31,50,8,87,15,65,10,41,88,79,48,21},new int[]{86,24,74,23,80,69,33,36,25,58,90,66,98,31,44,63,45,83,82,50,67,71,87,1,71,86,67,83,94,9,99,35,13,26,45,51,92,25,56,39,3,75,94,53},new int[]{33,62,98,67,69,95,4,72,59,17,22,38,88,31,49,52,89,38,96,49,90,27,23,84,27,81,14,3,27,62,14,92,44,25,61,75,52,12,97,84,34,23,19,1},new int[]{74,65,5,57,22,43,2,73,7,21,71,59,9,40,73,49,12,73,10,74,17,4,64,16,49,27,6,9,58,32,38,30,78,45,29,92,22,31,81,17,54,79,47,32},new int[]{28,11,39,17,76,39,73,25,26,68,62,19,13,29,54,73,42,62,71,71,21,9,45,27,48,85,69,5,72,15,77,97,44,47,32,36,49,53,23,34,18,12,87,2},new int[]{27,50,31,48,86,69,17,43,71,18,66,31,63,28,67,9,97,28,92,18,15,75,89,5,41,91,76,74,73,66,73,51,16,65,85,57,37,39,65,49,47,40,14,40},new int[]{48,32,88,39,33,30,26,43,55,44,78,76,3,7,85,58,91,10,10,81,42,34,82,26,60,2,73,45,5,26,79,25,26,92,87,85,22,19,10,42,31,31,99,75},new int[]{81,97,86,90,36,66,32,67,63,23,50,65,69,44,58,57,37,65,18,5,82,99,96,26,33,42,88,27,54,83,82,79,91,75,24,3,39,71,12,33,22,35,14,26},new int[]{83,85,54,41,45,31,69,99,17,60,96,4,10,94,9,61,90,22,21,23,61,12,95,17,55,21,54,47,41,97,15,96,59,99,15,29,11,29,86,90,82,89,85,88},new int[]{56,92,53,3,13,38,70,11,23,73,56,17,9,83,99,96,92,28,79,19,97,87,92,4,47,47,31,99,5,33,48,32,79,59,98,64,47,9,35,47,88,82,17,1},new int[]{55,11,33,70,56,64,93,58,20,18,78,45,43,20,57,82,27,18,17,60,89,5,6,97,15,39,80,39,88,21,13,29,98,5,67,21,9,67,44,62,94,67,62,62},new int[]{60,49,39,41,50,98,17,53,55,78,75,56,1,65,64,52,15,2,12,45,57,42,2,87,62,34,17,41,78,75,84,71,65,15,38,98,73,65,9,42,66,86,89,51},new int[]{78,99,80,19,31,66,32,75,8,69,98,32,47,70,8,34,4,36,44,25,26,33,9,47,72,17,15,42,54,13,50,44,3,53,56,54,57,12,93,59,65,96,37,20},new int[]{72,37,31,95,25,50,49,8,94,94,91,35,13,21,73,24,48,33,1,72,3,14,14,49,33,4,38,25,47,13,39,25,73,43,38,35,93,55,50,78,34,25,42,92},new int[]{51,94,37,66,85,34,83,38,31,26,76,94,26,63,48,95,79,10,36,40,26,9,53,81,70,86,80,86,53,39,61,52,68,68,73,78,42,90,67,96,75,51,3,13},new int[]{13,61,24,20,74,87,97,55,35,78,80,30,83,33,41,66,49,8,84,3,85,65,85,72,2,87,41,53,75,16,9,96,39,64,36,23,47,49,55,94,10,63,95,26},new int[]{48,30,2,29,54,32,38,21,27,88,34,23,78,39,69,73,45,63,8,7,30,12,20,64,29,55,12,84,22,23,48,45,26,28,55,73,69,2,28,77,79,53,14,46},new int[]{78,67,74,70,20,35,48,43,20,56,3,68,11,62,61,95,58,29,38,84,88,87,22,86,41,84,63,38,50,7,24,46,25,78,29,67,93,80,85,22,85,86,9,87},new int[]{49,73,96,36,5,90,4,24,41,14,91,12,82,44,9,66,38,96,77,57,47,55,88,2,83,18,66,90,57,64,88,27,53,59,29,72,95,98,14,68,43,29,57,33},new int[]{21,41,1,27,2,64,51,54,74,74,30,1,95,99,29,13,73,43,41,75,88,89,58,77,14,41,67,54,6,46,77,1,29,78,76,26,58,87,3,60,14,98,23,62},new int[]{10,4,39,74,88,34,88,25,52,15,12,1,9,59,14,31,88,53,63,10,43,18,67,59,76,99,23,86,75,46,49,23,12,29,89,88,59,53,68,63,29,3,95,89},new int[]{37,63,23,49,86,93,77,3,22,36,10,9,56,55,19,72,33,20,94,35,31,83,50,46,78,10,67,34,51,92,83,39,90,68,12,26,71,67,90,2,12,59,32,51},new int[]{11,32,64,45,79,54,6,26,8,8,38,8,17,83,3,41,73,53,97,96,96,70,62,53,59,93,81,83,95,83,23,47,35,14,65,97,49,36,1,84,22,35,3,12},new int[]{37,58,77,12,2,84,65,58,60,41,35,88,90,11,52,52,62,63,15,70,40,9,70,17,23,58,95,80,51,57,86,16,45,61,12,73,6,4,81,74,35,47,85,19},new int[]{27,11,70,59,41,43,28,63,67,45,24,77,64,79,73,39,99,45,61,82,43,67,92,80,42,41,47,43,23,32,74,57,38,77,15,28,13,35,2,61,65,41,96,94},new int[]{86,4,53,88,14,17,14,41,62,52,27,85,40,35,90,95,59,97,49,63,11,80,6,98,41,32,21,93,75,57,5,91,28,95,75,77,70,27,94,53,48,83,78,58},new int[]{9,55,45,28,28,46,25,26,62,68,67,34,21,81,34,44,76,89,21,18,36,70,84,53,20,96,95,84,94,3,84,8,85,48,23,1,2,74,37,94,51,44,24,32},new int[]{56,50,64,30,38,78,55,3,25,45,62,7,81,27,23,32,2,75,34,52,61,34,7,10,89,2,30,81,29,82,60,99,17,56,86,51,25,84,16,25,15,79,57,15},new int[]{56,82,37,65,33,3,49,22,54,21,27,4,99,1,4,55,24,29,22,23,85,78,8,58,80,99,88,59,90,7,25,45,90,26,30,66,53,73,39,11,79,12,99,50}}); param0.add(new int[][]{new int[]{16,49,32,82,45,85,80,71,5,44,41,97,95,85,67,74,75,22,17,89,92,50,84,94,31,13,74,51,33,20,48,78,72,72,92,74,14,62,51,78,70,98,81,21,92,38,15},new int[]{36,9,99,59,82,54,17,82,4,84,13,75,43,97,92,8,20,82,71,61,44,97,51,58,75,30,99,84,10,94,18,25,96,34,44,39,95,92,90,68,43,20,72,2,27,34,55},new int[]{36,85,72,87,72,69,65,85,44,43,74,66,21,61,13,28,30,82,2,58,83,21,90,46,89,83,25,57,20,6,18,49,82,20,34,10,33,55,19,66,47,49,67,30,83,85,59},new int[]{78,31,21,17,53,51,24,40,98,47,20,16,58,49,42,12,41,58,60,24,13,34,61,27,85,67,14,41,57,30,45,74,1,92,83,94,84,52,20,23,95,96,90,78,6,33,8},new int[]{63,4,13,35,93,89,34,56,11,38,93,45,86,58,34,75,92,72,24,74,79,63,39,21,36,48,84,13,2,27,7,90,94,19,40,21,58,26,74,36,44,64,27,8,90,1,23},new int[]{73,31,7,9,71,92,98,53,16,74,24,74,46,29,89,30,51,83,31,30,34,92,19,75,28,6,17,91,36,1,16,68,47,23,96,67,62,85,88,15,75,67,83,43,8,98,98},new int[]{44,26,67,32,64,43,74,74,62,11,78,95,9,48,6,54,62,54,99,98,56,82,87,30,3,61,15,3,15,67,29,31,71,71,55,75,92,43,25,81,55,50,38,60,85,52,84},new int[]{74,70,76,81,45,97,19,5,42,93,30,65,76,79,5,38,11,84,29,14,90,98,74,91,89,10,39,60,96,98,23,97,96,22,86,87,83,23,22,62,94,19,22,1,34,26,4},new int[]{48,45,12,92,37,3,28,93,84,2,56,65,46,44,18,73,37,54,25,83,62,25,52,63,15,46,56,26,64,20,67,25,21,34,88,25,65,29,32,1,35,56,16,32,79,5,10},new int[]{86,72,79,20,89,12,90,68,63,26,60,74,61,15,5,32,96,22,22,12,64,75,88,80,16,65,51,87,92,32,53,3,13,92,92,58,45,24,51,13,24,5,81,50,76,49,18},new int[]{33,58,31,34,94,96,74,31,99,79,27,59,27,1,76,68,23,98,52,57,87,51,83,84,63,84,93,77,28,24,22,86,40,75,8,96,88,12,49,21,67,39,62,82,58,62,70},new int[]{36,45,79,15,62,38,64,88,71,9,75,80,71,25,78,65,20,28,49,34,73,20,95,85,22,77,44,47,25,22,61,52,20,96,80,20,86,45,37,15,76,9,44,15,44,86,12},new int[]{27,19,25,74,99,64,12,50,72,11,83,23,88,15,63,20,89,78,10,61,93,47,49,49,76,33,87,78,23,53,37,22,93,2,20,5,91,3,82,77,86,77,12,32,58,71,70},new int[]{40,6,63,25,91,69,83,73,50,40,1,46,73,39,10,49,14,46,40,89,19,17,82,46,73,65,70,38,17,73,11,53,18,7,35,44,71,39,11,10,98,88,76,9,86,96,8},new int[]{48,21,80,97,89,6,59,68,23,73,75,35,12,99,71,57,29,85,67,61,61,88,30,27,93,30,55,23,37,26,36,92,63,37,51,68,93,78,63,37,97,31,78,25,73,25,46},new int[]{89,30,20,23,1,15,21,30,11,90,52,30,9,69,47,34,33,98,65,51,79,31,56,76,71,45,33,96,51,5,38,5,56,81,71,89,25,67,52,36,92,23,8,31,63,21,99},new int[]{50,29,60,67,44,89,2,98,15,39,40,47,76,52,88,6,70,48,58,90,3,96,46,18,56,92,33,17,32,76,85,2,26,39,63,17,34,19,62,32,50,86,45,54,82,88,1},new int[]{66,40,24,52,2,61,27,66,87,33,34,62,32,3,55,27,76,8,20,52,17,33,55,75,73,98,71,16,91,79,64,88,40,58,83,23,95,94,7,59,59,3,30,10,98,13,39},new int[]{77,64,25,41,98,40,62,40,34,79,3,52,46,86,98,69,41,86,60,29,8,98,4,25,50,23,25,98,70,98,21,94,56,3,79,21,83,83,49,46,98,78,68,31,46,75,44},new int[]{45,75,49,4,80,57,56,38,6,82,89,24,52,39,73,37,98,34,40,40,37,92,50,11,78,59,26,60,8,28,84,60,89,10,63,61,75,26,23,63,19,18,50,19,15,16,20},new int[]{19,75,71,19,88,31,52,48,8,50,61,88,8,13,74,19,50,23,57,97,30,94,29,61,35,9,72,25,64,37,38,8,90,75,40,23,96,45,1,49,9,40,28,97,96,8,37},new int[]{82,71,18,76,68,77,75,80,44,78,16,52,53,86,18,40,61,25,35,71,84,27,93,10,75,20,33,77,80,11,69,67,59,66,53,38,10,6,85,95,34,49,32,29,65,33,17},new int[]{98,49,16,7,13,84,4,63,69,80,73,76,78,15,5,42,18,72,8,89,68,26,75,70,33,22,93,69,1,86,35,56,95,67,3,71,1,42,58,88,94,96,96,85,64,80,4},new int[]{17,77,99,40,34,56,11,89,40,94,13,24,34,8,82,7,62,46,86,71,13,2,2,29,91,82,58,2,59,53,68,61,49,46,72,59,48,9,18,50,86,75,27,32,66,66,94},new int[]{22,86,24,91,75,13,91,15,49,17,39,73,87,4,57,15,43,31,6,90,59,65,86,30,58,86,97,56,69,36,46,74,1,12,67,10,1,19,82,95,55,49,55,86,68,41,55},new int[]{74,74,79,69,43,81,82,57,48,50,69,8,56,91,89,26,23,41,87,93,97,59,18,71,96,71,8,58,85,17,51,33,30,66,60,46,22,32,25,8,97,63,29,81,40,45,2},new int[]{49,31,68,90,9,95,10,51,70,44,26,75,79,84,78,21,91,30,71,15,80,59,84,84,86,70,20,69,53,75,2,30,8,40,8,17,99,30,1,69,64,80,36,79,49,81,77},new int[]{24,4,77,62,9,26,47,16,37,70,11,2,94,83,23,47,62,76,39,6,36,62,60,79,36,77,72,89,88,31,40,60,13,93,96,37,61,18,90,18,34,54,31,79,37,84,92},new int[]{68,72,58,82,96,53,87,62,79,7,31,96,40,78,83,50,80,9,65,25,8,39,32,8,13,67,66,28,4,23,34,55,71,94,58,73,19,9,23,75,13,93,31,72,19,5,91},new int[]{39,14,22,22,5,62,52,80,39,26,80,56,12,80,49,12,96,5,92,51,4,93,83,25,99,24,56,19,23,95,83,96,77,46,18,61,71,45,88,46,17,15,73,34,99,8,50},new int[]{11,88,42,94,85,43,35,59,12,73,12,28,93,46,40,99,29,70,16,46,92,65,29,52,40,6,27,37,22,7,1,77,48,51,14,79,12,49,41,68,85,2,85,62,57,14,44},new int[]{66,75,37,78,47,61,84,99,27,49,60,70,71,45,1,13,38,17,38,1,1,83,30,77,7,20,44,73,13,39,20,89,5,52,25,12,90,56,86,1,72,49,67,22,85,85,31},new int[]{1,27,2,93,1,42,8,35,35,7,23,23,46,19,79,72,97,99,13,50,31,71,84,38,57,8,14,94,51,9,13,76,66,38,21,29,84,50,64,9,15,53,97,53,71,3,87},new int[]{22,39,77,9,34,12,34,45,97,50,99,28,39,3,47,12,43,77,67,18,90,10,4,12,53,51,16,17,95,26,2,29,94,47,11,34,71,29,97,49,91,16,81,75,14,13,35},new int[]{90,52,25,59,76,68,42,48,91,45,72,72,29,3,21,31,13,95,81,48,96,24,2,3,26,2,33,34,90,98,38,78,95,20,10,84,33,45,60,66,61,51,12,80,9,11,21},new int[]{76,68,26,63,19,17,44,61,1,72,58,94,41,24,43,81,94,9,66,90,32,91,41,11,65,18,8,27,82,9,2,81,75,46,70,5,12,44,42,99,88,30,52,81,47,36,70},new int[]{32,98,44,16,71,96,17,32,14,26,73,13,89,12,45,16,94,52,21,24,43,5,33,31,9,35,8,75,17,80,20,91,78,22,54,71,75,81,77,81,75,68,80,31,85,97,13},new int[]{29,79,10,33,15,77,35,54,21,30,46,42,71,49,24,80,69,6,2,3,53,10,24,33,84,22,61,96,94,67,4,51,4,39,31,57,73,30,93,89,39,99,25,58,36,11,90},new int[]{46,89,21,2,74,39,99,33,31,4,67,69,81,13,65,45,39,87,89,53,31,13,1,98,29,61,95,72,2,12,56,97,94,41,27,89,38,97,52,80,32,88,2,66,20,57,62},new int[]{91,86,48,83,7,67,50,34,87,69,67,88,91,34,43,21,12,32,47,86,98,87,55,65,68,17,26,95,33,64,92,10,46,73,90,51,34,14,41,90,95,38,48,43,28,41,56},new int[]{81,76,91,65,60,97,13,69,52,43,92,88,84,40,42,37,84,23,67,69,79,69,98,58,46,87,47,17,9,68,94,78,30,95,61,65,58,27,66,45,40,61,41,74,88,84,42},new int[]{62,80,38,60,49,18,99,94,5,11,4,61,75,12,49,28,90,34,56,65,6,33,47,24,34,72,16,80,16,98,84,14,59,62,90,66,19,61,66,26,89,49,19,49,81,30,76},new int[]{57,85,36,40,28,97,46,73,82,88,32,87,58,76,98,26,70,69,87,50,79,32,58,64,77,28,97,72,80,39,96,80,45,13,20,58,19,75,91,80,9,77,19,94,55,39,17},new int[]{62,94,93,60,42,2,50,67,20,1,5,97,39,87,18,68,97,90,22,30,90,1,70,81,95,51,68,74,61,48,53,34,86,86,7,39,37,63,55,15,83,74,62,68,50,41,61},new int[]{25,28,82,35,83,53,84,39,97,59,65,1,45,19,48,49,73,14,67,30,65,69,87,6,84,46,42,72,61,31,79,26,58,33,52,32,54,1,5,22,95,5,8,70,63,10,62},new int[]{40,47,80,56,28,56,1,52,82,62,42,47,37,11,67,29,4,95,11,30,79,79,58,32,29,43,92,85,39,11,96,27,24,37,65,32,53,1,56,34,82,29,6,57,95,14,75},new int[]{69,62,86,51,13,76,4,38,4,30,54,65,61,49,31,42,50,23,78,99,81,60,32,56,56,87,34,41,39,86,42,66,20,14,38,37,37,12,92,56,8,93,21,39,48,18,63}}); List<Integer> param1 = new ArrayList<>(); param1.add(2); param1.add(3); param1.add(1); param1.add(2); param1.add(4); param1.add(10); param1.add(7); param1.add(35); param1.add(29); param1.add(41); 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,132
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SMALLEST_OF_THREE_INTEGERS_WITHOUT_COMPARISON_OPERATORS.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_OF_THREE_INTEGERS_WITHOUT_COMPARISON_OPERATORS{ static int f_gold ( int x , int y , int z ) { int c = 0 ; while ( x != 0 && y != 0 && z != 0 ) { x -- ; y -- ; z -- ; c ++ ; } return c ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(23); param0.add(87); param0.add(35); param0.add(25); param0.add(93); param0.add(52); param0.add(95); param0.add(91); param0.add(75); param0.add(96); List<Integer> param1 = new ArrayList<>(); param1.add(98); param1.add(55); param1.add(90); param1.add(9); param1.add(22); param1.add(42); param1.add(88); param1.add(64); param1.add(1); param1.add(44); List<Integer> param2 = new ArrayList<>(); param2.add(25); param2.add(94); param2.add(29); param2.add(41); param2.add(39); param2.add(96); param2.add(26); param2.add(51); param2.add(6); param2.add(76); 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,133
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SMALLEST_SUM_CONTIGUOUS_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 SMALLEST_SUM_CONTIGUOUS_SUBARRAY{ static int f_gold ( int arr [ ] , int n ) { int min_ending_here = 2147483647 ; int min_so_far = 2147483647 ; for ( int i = 0 ; i < n ; i ++ ) { if ( min_ending_here > 0 ) min_ending_here = arr [ i ] ; else min_ending_here += arr [ i ] ; min_so_far = Math . min ( min_so_far , min_ending_here ) ; } return min_so_far ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,9,13,14,15,18,19,19,25,26,29,29,29,30,31,36,37,37,38,39,39,40,40,42,42,46,50,53,58,60,62,64,65,67,68,69,72,77,78,83,85,89,90,93,95,95,97}); param0.add(new int[]{14,-58,8,78,-26,-20,-60,42,-64,-12}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{44,88,20,47,69,42,26,49,71,91,18,95,9,66,60,37,47,29,98,63,15,9,80,66,1,9,57,56,20,2,1}); param0.add(new int[]{-78,-64,-62,-60,-52,4,8,46,72,74}); param0.add(new int[]{0,0,1,0,0,0,0,1,1,0,0,1,1,0,1,1}); param0.add(new int[]{3,7,16,17,23,23,23,28,29,30,34,38,40,41,43,43,44,46,51,51,51,55,57,58,61,62,66,66,67,69,70,73,75,77,79,80,85,85,87,87,93,96}); param0.add(new int[]{80,22,38,26,62,-48,-48,46,-54,4,76,46,48,40,-92,-98,-88,12,-42,-94,76,-16,-82,62,18,-24}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{85,44,1,97,50,74,62,90,3,78,8,48,96,41,36,91,57,97,85,90,78,43,28,92,85,59,29,38,34,65,20,26,27,23,71,22,47,99,68,93,67,66,69,82,98,15,44,51,65}); List<Integer> param1 = new ArrayList<>(); param1.add(24); param1.add(6); param1.add(8); param1.add(26); param1.add(8); param1.add(11); param1.add(38); param1.add(22); param1.add(13); param1.add(45); 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,134
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/TRIANGULAR_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 TRIANGULAR_NUMBERS_1{ static boolean f_gold ( int num ) { if ( num < 0 ) return false ; int c = ( - 2 * num ) ; int b = 1 , a = 1 ; int d = ( b * b ) - ( 4 * a * c ) ; if ( d < 0 ) return false ; float root1 = ( - b + ( float ) Math . sqrt ( d ) ) / ( 2 * a ) ; float root2 = ( - b - ( float ) Math . sqrt ( d ) ) / ( 2 * a ) ; if ( root1 > 0 && Math . floor ( root1 ) == root1 ) return true ; if ( root2 > 0 && Math . floor ( root2 ) == root2 ) return true ; return false ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(1); param0.add(3); param0.add(6); param0.add(10); param0.add(55); param0.add(48); param0.add(63); param0.add(72); param0.add(16); param0.add(85); 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,135
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CONVERTING_ONE_STRING_USING_APPEND_DELETE_LAST_OPERATIONS.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 CONVERTING_ONE_STRING_USING_APPEND_DELETE_LAST_OPERATIONS{ static boolean f_gold ( String str1 , String str2 , int k ) { if ( ( str1 . length ( ) + str2 . length ( ) ) < k ) return true ; int commonLength = 0 ; for ( int i = 0 ; i < Math . min ( str1 . length ( ) , str2 . length ( ) ) ; i ++ ) { if ( str1 == str2 ) commonLength ++ ; else break ; } if ( ( k - str1 . length ( ) - str2 . length ( ) + 2 * commonLength ) % 2 == 0 ) return true ; return false ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("ZNHGro"); param0.add("382880806774"); param0.add("0"); param0.add("lxHTRFCTSQ"); param0.add("6399914758"); param0.add("01100011100000"); param0.add("WkGqlob"); param0.add("46974006151"); param0.add("1001001"); param0.add("IJQ"); List<String> param1 = new ArrayList<>(); param1.add("jAdbtDUYQu"); param1.add("65565"); param1.add("00100010100"); param1.add("sViXYE"); param1.add("780990121"); param1.add("0100"); param1.add("NpQVdXzEtUZy"); param1.add("74438"); param1.add("1000010"); param1.add("nFOHAeYEAp"); List<Integer> param2 = new ArrayList<>(); param2.add(3); param2.add(10); param2.add(2); param2.add(89); param2.add(9); param2.add(0); param2.add(6); param2.add(11); param2.add(15); param2.add(42); 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,136
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_THREE_ELEMENT_FROM_DIFFERENT_THREE_ARRAYS_SUCH_THAT_THAT_A_B_C_K_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_THREE_ELEMENT_FROM_DIFFERENT_THREE_ARRAYS_SUCH_THAT_THAT_A_B_C_K_1{ static boolean f_gold ( int a1 [ ] , int a2 [ ] , int a3 [ ] , int n1 , int n2 , int n3 , int sum ) { HashSet < Integer > s = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < n1 ; i ++ ) { s . add ( a1 [ i ] ) ; } ArrayList < Integer > al = new ArrayList < > ( s ) ; for ( int i = 0 ; i < n2 ; i ++ ) { for ( int j = 0 ; j < n3 ; j ++ ) { if ( al . contains ( sum - a2 [ i ] - a3 [ j ] ) & al . indexOf ( sum - a2 [ i ] - a3 [ j ] ) != al . get ( al . size ( ) - 1 ) ) { return true ; } } } return false ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{6,7,10,15,28,30,30,35,38,43,44,44,54,55,64,68,69,73,75,75,86,87,92,93,94}); param0.add(new int[]{-72,-90,-92,4,22,14,-50,16,-56,-66,62,-32,82,8,12,-24,92,-98,-94,56,-74,-66,26,-98,10,-74,-14,2,60,-88,-84,34,82,28,-86,-90,-92,52,72,90,92,-20,-86,74,-96,-46,28}); 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}); param0.add(new int[]{85,34,78,64,22,94,52,71,44,48,46,88,59,95,4,55,21,83,56,19,85,6,87,13}); param0.add(new int[]{-98,-98,-96,-94,-90,-90,-84,-36,-34,-34,-32,16,26,26,56,74,80}); param0.add(new int[]{1,1,1,0,0,0,1,1,1,1}); param0.add(new int[]{4,4,25,27,35,39,50,60,60,63,67,73,75,81,84,85,91,98}); param0.add(new int[]{54,-64,76,78,24,40,44,-56,80,-10,-12,-8,-18,42,70,14,-70,48,-68,-98,-74,-40,-16,-90,48,92,-64,58,-98,60,-10,-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,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[]{28,88,75,86,51,82,2,20,22,18,96,11}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{11,17,18,24,26,26,33,35,38,41,55,60,63,63,69,73,78,81,82,87,90,91,93,94,99}); param1.add(new int[]{50,-20,26,32,-46,38,36,0,-96,60,-70,-36,-12,50,64,-70,22,-22,32,60,-94,98,-58,-86,-16,40,-68,2,-50,6,-36,-28,-68,44,-98,-38,-46,68,4,60,-36,28,-38,4,50,-84,-12}); param1.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}); param1.add(new int[]{58,45,14,13,73,82,34,78,83,84,39,34,65,84,84,61,26,67,48,51,41,46,89,10}); param1.add(new int[]{-92,-70,-70,-56,-54,-48,-38,-14,-10,0,4,30,34,70,72,76,78}); param1.add(new int[]{0,0,1,0,0,1,0,1,0,1}); param1.add(new int[]{20,21,23,25,37,41,51,57,62,66,74,77,77,79,80,87,88,95}); param1.add(new int[]{88,-66,-50,74,-44,-32,-58,-24,-40,62,52,88,-48,-2,-46,38,30,-56,76,56,60,52,-32,36,90,92,-74,88,-36,-14,-16,-14}); 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,0,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[]{62,54,79,88,27,13,48,94,86,28,86,60}); List<int [ ]> param2 = new ArrayList<>(); param2.add(new int[]{3,3,8,22,24,24,28,30,32,32,34,39,40,45,46,50,54,59,75,78,79,90,95,95,97}); param2.add(new int[]{-28,20,-62,-84,14,10,28,-10,94,-2,52,66,38,-50,48,-88,-28,92,-48,86,4,-16,26,26,-82,44,70,72,-6,-98,80,56,38,42,-20,64,36,80,12,4,-50,54,22,98,-30,-52,4}); param2.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}); param2.add(new int[]{46,1,2,90,31,49,62,10,28,4,48,84,87,51,88,74,99,15,35,24,32,66,10,66}); param2.add(new int[]{-92,-88,-70,-56,-50,-50,-48,-36,-20,-10,-8,2,16,22,48,70,78}); param2.add(new int[]{1,1,1,1,0,1,1,1,0,1}); param2.add(new int[]{2,3,9,10,10,18,24,40,41,47,68,69,70,86,90,95,96,98}); param2.add(new int[]{38,-96,16,38,-48,-22,-52,-78,42,94,-26,-20,12,-10,72,16,-8,-2,-36,-76,-6,-92,10,34,-76,-54,-20,20,-76,-46,24,44}); param2.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,1,1,1}); param2.add(new int[]{49,14,18,61,94,54,12,56,97,59,85,44}); List<Integer> param3 = new ArrayList<>(); param3.add(21); param3.add(41); param3.add(26); param3.add(15); param3.add(15); param3.add(5); param3.add(12); param3.add(23); param3.add(38); param3.add(6); List<Integer> param4 = new ArrayList<>(); param4.add(16); param4.add(42); param4.add(20); param4.add(16); param4.add(10); param4.add(7); param4.add(17); param4.add(18); param4.add(22); param4.add(6); List<Integer> param5 = new ArrayList<>(); param5.add(17); param5.add(34); param5.add(30); param5.add(23); param5.add(15); param5.add(9); param5.add(13); param5.add(29); param5.add(40); param5.add(8); List<Integer> param6 = new ArrayList<>(); param6.add(18); param6.add(32); param6.add(16); param6.add(15); param6.add(15); param6.add(6); param6.add(9); param6.add(19); param6.add(32); param6.add(9); 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),param5.get(i),param6.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i),param4.get(i),param5.get(i),param6.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,137
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/HOW_TO_PRINT_MAXIMUM_NUMBER_OF_A_USING_GIVEN_FOUR_KEYS.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_TO_PRINT_MAXIMUM_NUMBER_OF_A_USING_GIVEN_FOUR_KEYS{ static int f_gold ( int N ) { if ( N <= 6 ) return N ; int [ ] screen = new int [ N ] ; int b ; int n ; for ( n = 1 ; n <= 6 ; n ++ ) screen [ n - 1 ] = n ; for ( n = 7 ; n <= N ; n ++ ) { screen [ n - 1 ] = Math . max ( 2 * screen [ n - 4 ] , Math . max ( 3 * screen [ n - 5 ] , 4 * screen [ n - 6 ] ) ) ; } return screen [ N - 1 ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(41); param0.add(94); param0.add(80); param0.add(40); param0.add(76); param0.add(5); param0.add(43); param0.add(67); param0.add(24); 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,138
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_DISTINCT_NON_NEGATIVE_PAIRS_X_Y_SATISFY_INEQUALITY_XX_YY_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 COUNT_DISTINCT_NON_NEGATIVE_PAIRS_X_Y_SATISFY_INEQUALITY_XX_YY_N_2{ static int f_gold ( int n ) { int res = 0 ; for ( int x = 0 ; x * x < n ; x ++ ) for ( int y = 0 ; x * x + y * y < n ; y ++ ) res ++ ; return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(61); param0.add(45); param0.add(53); param0.add(4); param0.add(82); param0.add(86); param0.add(37); param0.add(48); param0.add(81); param0.add(50); 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,139
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/HIGHWAY_BILLBOARD_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 HIGHWAY_BILLBOARD_PROBLEM{ static int f_gold ( int m , int [ ] x , int [ ] revenue , int n , int t ) { int [ ] maxRev = new int [ m + 1 ] ; for ( int i = 0 ; i < m + 1 ; i ++ ) maxRev [ i ] = 0 ; int nxtbb = 0 ; for ( int i = 1 ; i <= m ; i ++ ) { if ( nxtbb < n ) { if ( x [ nxtbb ] != i ) maxRev [ i ] = maxRev [ i - 1 ] ; else { if ( i <= t ) maxRev [ i ] = Math . max ( maxRev [ i - 1 ] , revenue [ nxtbb ] ) ; else maxRev [ i ] = Math . max ( maxRev [ i - t - 1 ] + revenue [ nxtbb ] , maxRev [ i - 1 ] ) ; nxtbb ++ ; } } else maxRev [ i ] = maxRev [ i - 1 ] ; } return maxRev [ m ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(16); param0.add(39); param0.add(5); param0.add(10); param0.add(14); param0.add(32); param0.add(2); param0.add(22); param0.add(15); param0.add(8); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{6,15,15,18,23,29,32,36,37,39,40,41,44,49,51,52,53,57,66,68,82,89,96}); param1.add(new int[]{76,60,88,46,-20,-78,-22,54,-18,92,-42,-66,-90,-72,-48,22,-72,-42,-46,94,82,-78,14,86,10,-64,-78,66,78,-36,50,-20,-40,-12,10,-46,56,-18,4,-76,-64,74,22,34,4,-2}); param1.add(new int[]{0,0,0,1,1,1,1,1,1,1}); param1.add(new int[]{21,69,30,10,71,72,71,78,30,9,72,10,7,87,30,46,56,74,73,60,86}); param1.add(new int[]{-76,-76,-66,-64,-62,-60,-52,-48,-42,-28,-14,-6,-6,16,20,20,38,46,58,60,70,72,86,98}); param1.add(new int[]{1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,0,1,1,1,0,1,0,1,1,0,1,0,1}); param1.add(new int[]{16,38,72,82}); param1.add(new int[]{28,-76,42,-2,30,-10,52,66,26,96,96,-72,26,-86,-30,-78,32,-32,58,12,-72,8,34,-68,-28,-66}); param1.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,1}); param1.add(new int[]{95,12,65,97,92,49,94,32,37,97,9,35}); List<int [ ]> param2 = new ArrayList<>(); param2.add(new int[]{1,2,5,5,24,26,31,32,33,41,57,59,71,75,79,87,87,88,92,94,96,96,99}); param2.add(new int[]{28,8,-60,84,68,-54,-56,0,-68,-84,-6,92,-80,-24,86,-6,-44,82,74,90,-46,40,62,50,-42,38,78,94,46,-14,-48,66,70,52,10,-88,54,-10,98,34,16,-2,-62,-56,-40,86}); param2.add(new int[]{0,0,0,0,0,0,0,1,1,1}); param2.add(new int[]{72,45,7,30,76,35,75,72,4,7,55,56,7,52,48,27,11,76,66,48,33}); param2.add(new int[]{-90,-82,-78,-76,-74,-52,-48,-44,-44,-40,-38,-14,-6,10,20,38,38,40,44,48,52,54,76,78}); param2.add(new int[]{0,1,0,1,0,0,0,1,0,0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1}); param2.add(new int[]{15,34,56,74}); param2.add(new int[]{68,-38,34,20,40,78,52,80,58,-12,-18,10,40,34,20,-32,-8,-46,8,62,94,-30,-94,26,-40,64}); param2.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}); param2.add(new int[]{25,32,14,49,90,37,92,1,8,75,50,9}); List<Integer> param3 = new ArrayList<>(); param3.add(12); param3.add(25); param3.add(9); param3.add(18); param3.add(15); param3.add(28); param3.add(2); param3.add(13); param3.add(25); param3.add(9); List<Integer> param4 = new ArrayList<>(); param4.add(12); param4.add(27); param4.add(6); param4.add(20); param4.add(17); param4.add(36); param4.add(3); param4.add(16); param4.add(15); param4.add(8); 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,140
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_OF_OCCURRENCES_OF_A_101_PATTERN_IN_A_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_OF_OCCURRENCES_OF_A_101_PATTERN_IN_A_STRING{ static int f_gold ( String str ) { int len = str . length ( ) ; boolean oneSeen = false ; int count = 0 ; for ( int i = 0 ; i < len ; i ++ ) { char getChar = str . charAt ( i ) ; if ( getChar == '1' && oneSeen == true ) { if ( str . charAt ( i - 1 ) == '0' ) count ++ ; } if ( getChar == '1' && oneSeen == false ) oneSeen = true ; if ( getChar != '0' && str . charAt ( i ) != '1' ) oneSeen = false ; } return count ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("1001ab010abc01001"); param0.add("1001010001"); param0.add("010100010100"); param0.add("DLCu"); param0.add("7072430592"); param0.add("011"); param0.add("pnJpypYOza"); param0.add("1037"); param0.add("111"); param0.add("HxK"); 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,141
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_INTEGER_OVERFLOW_MULTIPLICATION.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_INTEGER_OVERFLOW_MULTIPLICATION{ static Boolean f_gold ( long a , long b ) { if ( a == 0 || b == 0 ) return false ; long result = a * b ; if ( a == result / b ) return false ; else return true ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Long> param0 = new ArrayList<>(); param0.add(37L); param0.add(Long.parseLong("10000000000")); param0.add(Long.parseLong("10000000000")); param0.add(Long.parseLong("999999999")); param0.add(39L); param0.add(92L); param0.add(14L); param0.add(19L); param0.add(14L); param0.add(88L); List<Long> param1 = new ArrayList<>(); param1.add(80L); param1.add(Long.parseLong("-10000000000")); param1.add(Long.parseLong("10000000000")); param1.add(Long.parseLong("999999999")); param1.add(36L); param1.add(56L); param1.add(21L); param1.add(38L); param1.add(82L); param1.add(41L); 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,142
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHANGE_BITS_CAN_MADE_ONE_FLIP_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 CHANGE_BITS_CAN_MADE_ONE_FLIP_1{ static boolean f_gold ( String str ) { int sum = 0 ; int n = str . length ( ) ; for ( int i = 0 ; i < n ; i ++ ) sum += str . charAt ( i ) - '0' ; return ( sum == n - 1 || sum == 1 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("00001"); param0.add("0000"); param0.add("11"); param0.add("111110"); param0.add("1"); 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,143
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CENTER_ELEMENT_OF_MATRIX_EQUALS_SUMS_OF_HALF_DIAGONALS.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 CENTER_ELEMENT_OF_MATRIX_EQUALS_SUMS_OF_HALF_DIAGONALS{ static boolean f_gold ( int mat [ ] [ ] , int n ) { int diag1_left = 0 , diag1_right = 0 ; int diag2_left = 0 , diag2_right = 0 ; for ( int i = 0 , j = n - 1 ; i < n ; i ++ , j -- ) { if ( i < n / 2 ) { diag1_left += mat [ i ] [ i ] ; diag2_left += mat [ j ] [ i ] ; } else if ( i > n / 2 ) { diag1_right += mat [ i ] [ i ] ; diag2_right += mat [ j ] [ i ] ; } } return ( diag1_left == diag2_right && diag2_right == diag2_left && diag1_right == diag2_left && diag2_right == mat [ n / 2 ] [ n / 2 ] ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ] [ ]> param0 = new ArrayList<>(); param0.add(new int[][]{ new int[]{ 2, 9, 1, 4, -2}, new int[]{ 6, 7, 2, 11, 4}, new int[]{ 4, 2, 9, 2, 4}, new int[]{ 1, 9, 2, 4, 4}, new int[]{ 0, 2, 4, 2, 5} }); param0.add(new int[][]{ new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82}}); param0.add(new int[][]{new int[]{52,88,22,69,1,83,30,39,79,35,69,70,89,11,51,63,86,34,55,78,73,20,80,58,81,17,34,75,99,62,34,72,19,97,87,66,72,93,42,51,71,49,29,95},new int[]{30,99,25,68,62,38,17,74,1,18,63,46,19,50,96,54,31,97,86,65,46,35,49,81,34,29,6,1,55,27,12,4,80,52,11,52,84,26,28,72,66,90,27,97},new int[]{55,71,54,46,36,21,49,34,87,34,40,7,90,52,49,81,95,89,37,62,15,2,11,96,94,17,88,45,68,61,46,32,19,67,4,25,73,21,87,93,94,89,93,98},new int[]{14,22,48,51,80,11,59,14,7,69,58,40,93,81,94,25,78,42,86,44,5,28,76,60,77,21,96,49,56,57,85,61,38,73,2,3,43,74,35,73,40,96,85,58},new int[]{34,25,56,32,22,89,65,21,80,96,21,28,19,14,87,24,20,32,74,52,65,95,52,58,79,95,92,10,70,15,47,91,10,21,19,68,22,63,38,15,70,75,44,30},new int[]{24,86,94,46,4,6,38,26,19,2,68,69,47,99,29,64,80,12,85,73,11,8,60,26,32,39,4,98,92,89,44,99,83,35,51,51,29,78,85,36,78,60,15,51},new int[]{50,94,55,12,50,62,5,27,79,90,9,35,13,44,46,97,98,68,77,74,53,1,11,50,9,38,87,13,5,25,10,5,22,42,89,20,28,21,11,93,69,37,49,69},new int[]{33,45,8,6,15,15,9,61,56,5,26,87,80,57,35,10,91,80,21,12,9,16,73,93,54,23,39,88,22,55,31,74,47,27,98,48,39,88,21,15,81,45,19,53},new int[]{89,55,86,49,78,61,60,92,76,91,24,86,39,61,23,72,92,93,79,39,72,92,97,11,42,25,34,22,2,51,16,11,78,96,86,69,87,62,19,29,42,23,60,73},new int[]{18,95,81,55,18,27,85,1,96,14,59,78,33,36,39,76,45,25,15,20,34,58,60,78,30,13,78,93,90,67,89,91,45,40,80,38,75,93,47,88,29,34,11,20},new int[]{20,73,56,23,91,88,25,89,33,31,74,79,1,54,16,85,59,66,3,15,32,50,91,99,60,88,8,7,4,94,10,60,25,42,47,96,96,32,74,73,25,89,16,49},new int[]{16,94,38,5,7,77,8,33,62,74,84,32,93,1,91,20,55,63,78,79,6,52,2,93,39,32,51,69,86,92,32,93,3,62,95,13,70,21,61,14,89,71,22,32},new int[]{41,32,42,52,94,81,54,62,85,90,43,3,38,81,39,70,85,45,46,13,52,9,57,69,43,7,44,44,95,68,77,44,79,40,77,43,62,43,90,19,49,65,77,25},new int[]{84,41,23,58,88,43,40,30,34,10,60,1,12,46,93,75,17,84,58,38,6,62,84,74,10,95,26,58,17,53,78,5,67,20,51,46,79,67,3,23,9,11,47,49},new int[]{44,13,8,63,22,38,27,26,23,95,93,65,74,47,61,46,4,31,4,29,73,79,44,3,59,79,53,11,6,47,7,68,85,1,56,87,77,43,28,29,18,87,92,73},new int[]{62,6,16,1,22,46,62,23,21,51,95,38,28,44,91,39,42,42,60,57,77,96,7,51,97,77,32,7,76,40,15,59,85,12,77,42,39,63,2,29,61,29,38,7},new int[]{30,87,92,56,87,36,42,93,4,84,5,46,75,2,54,88,59,33,22,47,6,24,93,49,96,94,51,41,67,89,92,79,81,2,91,78,43,32,12,23,16,44,2,7},new int[]{21,58,95,23,60,25,35,99,45,7,69,32,53,69,25,95,84,86,77,2,86,61,9,51,2,45,32,72,80,97,75,32,8,96,85,89,20,65,21,7,89,9,86,2},new int[]{19,60,70,59,69,45,62,10,65,26,90,60,18,59,21,46,12,78,32,39,99,81,55,55,10,35,80,6,68,62,9,29,71,80,6,44,64,67,44,78,14,9,23,57},new int[]{57,15,64,7,20,64,19,6,51,39,65,71,99,25,23,89,58,11,34,31,38,46,12,9,13,64,20,59,85,22,65,60,41,81,45,4,70,45,58,83,94,23,32,63},new int[]{93,8,85,81,81,85,79,91,25,33,66,16,55,36,72,80,7,69,87,8,3,35,36,79,30,15,93,68,98,87,58,99,28,95,42,97,18,5,9,84,9,18,56,15},new int[]{79,78,62,35,40,51,60,56,84,75,41,54,17,25,93,87,9,56,89,23,2,45,65,38,6,48,44,79,7,66,62,30,93,76,52,98,94,36,35,66,50,3,76,4},new int[]{55,52,59,71,20,19,8,67,27,79,8,18,29,46,36,3,9,10,84,66,1,91,4,48,96,18,78,45,15,51,61,4,19,88,94,77,11,28,57,75,54,65,47,4},new int[]{34,76,54,88,61,96,83,93,93,83,20,3,40,69,23,69,94,32,24,51,58,42,35,32,54,45,48,86,85,92,49,34,16,11,97,19,92,29,54,53,67,82,82,76},new int[]{82,32,83,56,63,4,11,3,27,80,44,18,30,88,70,47,34,76,42,23,40,15,80,57,14,79,12,35,25,78,2,18,35,9,11,90,67,69,96,74,38,70,75,81},new int[]{59,66,41,24,50,5,21,6,4,9,69,68,9,18,59,43,80,66,29,48,51,42,36,76,45,98,35,6,37,36,84,16,72,22,69,69,63,75,19,81,18,73,17,41},new int[]{33,84,55,82,24,77,40,28,67,75,39,21,37,2,6,52,5,47,43,96,40,11,81,14,2,39,63,63,18,97,94,79,93,90,1,17,54,39,48,66,15,22,20,93},new int[]{89,43,56,24,98,43,21,48,66,16,40,21,52,8,78,55,86,82,58,5,42,30,95,9,95,95,41,51,57,73,61,6,26,74,6,53,61,33,45,94,40,24,92,45},new int[]{38,29,79,8,64,87,73,51,75,6,47,49,76,98,85,32,54,36,89,99,98,19,37,17,80,16,58,44,68,49,94,51,98,5,97,58,46,55,73,17,12,24,56,55},new int[]{76,79,16,87,82,22,44,95,43,79,21,8,49,6,81,47,36,92,23,31,75,62,84,96,81,57,70,65,37,68,95,75,17,7,52,35,2,40,37,57,10,76,81,46},new int[]{90,5,5,27,5,61,8,31,97,21,99,21,51,79,59,2,30,58,92,81,20,40,29,5,89,10,83,61,1,47,98,57,14,25,90,21,16,74,32,45,64,84,73,60},new int[]{98,95,19,47,95,64,30,47,88,33,82,21,95,63,42,61,43,68,26,33,33,49,84,41,72,36,72,95,22,47,83,20,87,24,43,88,73,16,27,45,37,13,51,2},new int[]{76,97,87,59,14,49,30,98,9,79,24,41,60,89,32,47,21,42,70,89,2,31,56,30,63,15,18,32,14,62,82,99,52,22,14,78,34,86,80,56,53,49,63,16},new int[]{80,40,38,18,23,48,82,46,22,54,40,30,55,56,42,42,62,82,53,82,53,64,1,79,69,27,17,63,41,58,57,96,38,90,66,92,45,23,20,36,42,22,60,11},new int[]{28,45,22,81,63,31,11,36,78,35,23,29,23,16,84,89,19,90,96,63,50,85,73,43,19,85,18,6,35,14,64,9,35,2,6,99,25,73,50,95,7,63,28,2},new int[]{65,59,24,62,99,71,38,93,62,65,51,94,52,96,74,98,63,11,48,54,91,50,74,38,86,88,8,6,68,69,6,32,38,57,84,64,54,14,64,50,47,54,19,75},new int[]{39,65,99,83,60,33,32,36,24,43,71,71,46,47,69,14,45,52,90,50,65,77,64,23,84,71,70,59,73,92,74,54,99,71,89,94,26,44,76,13,54,40,4,53},new int[]{1,6,55,66,91,18,29,53,33,3,20,4,82,8,86,86,83,28,66,73,99,86,26,34,71,94,49,89,49,73,27,65,33,72,49,63,32,19,50,22,90,67,9,35},new int[]{71,79,4,37,28,9,35,25,9,61,52,97,17,76,9,54,5,63,47,90,19,99,66,45,71,73,86,33,80,43,88,72,94,26,45,35,81,53,10,41,17,71,66,11},new int[]{63,67,46,20,13,87,17,93,32,99,99,98,85,16,23,11,14,67,71,45,75,33,83,45,54,51,87,23,29,6,39,5,96,40,90,78,82,21,59,89,20,24,3,86},new int[]{72,57,93,71,70,70,76,63,86,47,90,89,19,99,13,89,45,32,30,85,42,72,42,7,3,37,3,18,42,9,57,24,7,97,89,42,98,58,85,56,58,18,39,50},new int[]{33,28,56,25,14,55,84,84,7,4,95,30,62,57,37,55,85,65,52,3,77,7,70,70,34,96,16,8,21,11,50,87,6,15,11,27,79,45,38,4,78,45,10,54},new int[]{29,12,56,40,84,37,66,20,12,38,30,47,82,74,71,42,5,48,93,99,51,12,10,37,66,67,14,47,20,52,68,26,47,79,73,3,2,41,30,37,81,3,9,8},new int[]{9,17,24,72,14,54,80,18,88,39,47,27,92,71,98,91,34,19,6,30,92,12,15,39,64,64,15,58,67,1,7,9,1,5,47,10,2,23,93,56,19,38,47,84}}); param0.add(new int[][]{new int[]{99,52,49,71,23,50,17,48,2,69,62},new int[]{85,13,61,11,88,97,27,35,18,85,68},new int[]{61,41,96,43,49,11,67,51,52,85,43},new int[]{58,78,70,29,31,28,50,36,92,19,67},new int[]{12,88,76,24,65,92,80,21,94,98,26},new int[]{35,95,80,58,42,29,29,9,78,72,2},new int[]{75,2,18,69,57,71,23,19,19,58,83},new int[]{49,45,28,75,50,11,55,9,14,98,93},new int[]{21,48,58,69,97,9,67,78,18,12,87},new int[]{78,16,37,20,20,15,25,17,12,42,39},new int[]{56,53,71,72,88,47,25,85,50,33,74}}); param0.add(new int[][]{new int[]{29,3,39,4,37,95,6,92,10,12,66,3,65,64,35,24,47,52,34},new int[]{84,80,94,25,69,29,92,64,53,58,41,87,96,51,18,41,99,61,24},new int[]{47,28,36,21,56,69,26,54,87,44,33,26,22,20,2,41,54,57,18},new int[]{5,96,46,75,21,22,3,9,2,28,34,53,59,10,83,93,2,48,6},new int[]{44,54,71,36,8,83,10,33,91,93,19,18,51,23,1,59,3,10,71},new int[]{49,56,90,16,39,96,76,44,8,8,45,11,97,25,17,95,83,55,79},new int[]{56,44,53,35,39,2,98,25,38,68,80,32,79,78,41,79,71,7,72},new int[]{83,18,17,82,83,77,59,11,51,7,27,59,37,5,62,72,74,90,79},new int[]{55,16,93,92,74,56,51,68,46,61,78,33,55,18,12,74,21,97,78},new int[]{73,26,79,21,22,55,46,41,5,44,16,35,5,62,90,26,61,51,69},new int[]{56,50,36,24,79,30,69,48,22,33,69,96,50,23,10,36,17,53,91},new int[]{8,44,61,6,71,90,81,37,54,23,91,57,51,58,19,27,89,25,21},new int[]{25,51,71,35,70,50,15,24,49,68,7,94,81,54,38,94,45,9,55},new int[]{83,52,77,49,55,83,70,76,79,3,68,38,70,49,92,8,95,85,45},new int[]{29,79,49,24,21,23,95,98,28,32,22,62,67,73,6,65,22,51,68},new int[]{57,72,55,42,52,61,19,1,41,63,88,48,81,32,50,14,17,96,97},new int[]{30,51,98,92,62,24,63,14,34,59,65,86,33,58,18,12,74,66,2},new int[]{70,84,28,42,3,48,89,87,13,57,88,3,63,38,59,28,26,84,91},new int[]{65,74,74,61,57,1,32,32,27,13,17,28,89,52,36,47,66,32,32}}); param0.add(new int[][]{new int[]{55,73,80,89,40,28,81,31,87,31,26,4,58,79,23,69,60,43,89,94,26,67,68,55,47,82,59,75,75,16,58},new int[]{89,1,90,45,94,6,91,52,19,43,19,39,32,65,89,47,13,74,82,36,86,70,27,72,24,20,86,9,39,83,1},new int[]{11,74,1,91,81,44,51,17,66,23,41,59,74,94,99,25,17,19,82,82,46,35,74,23,86,44,9,32,90,93,59},new int[]{42,62,19,93,35,76,8,89,91,43,45,6,13,11,70,69,7,55,55,19,6,89,9,20,25,50,72,50,38,66,57},new int[]{22,56,36,51,68,1,48,33,24,49,69,58,48,57,64,99,53,60,90,43,41,26,59,49,64,5,44,18,57,89,40},new int[]{46,58,85,24,28,46,68,72,54,33,67,84,35,39,47,71,91,5,37,1,86,56,7,64,8,94,64,57,28,26,34},new int[]{96,22,20,14,23,67,19,78,39,37,99,1,19,15,89,1,31,52,43,46,86,50,20,62,43,5,79,66,12,57,60},new int[]{55,71,66,72,73,27,28,37,79,19,94,51,13,45,6,94,1,25,99,26,13,19,10,45,71,15,87,31,8,30,98},new int[]{97,1,16,11,27,86,40,83,44,70,57,48,40,39,84,3,55,1,23,67,62,34,17,48,91,53,61,87,11,15,90},new int[]{11,7,47,8,5,81,87,66,91,63,21,71,90,94,12,11,54,81,10,16,15,58,79,84,4,96,22,35,14,94,31},new int[]{74,70,91,11,36,74,80,24,85,40,42,87,21,96,81,51,81,55,85,4,62,87,25,96,70,14,41,57,38,62,41},new int[]{45,80,96,16,19,37,85,79,61,26,94,79,64,13,91,87,34,98,23,20,54,73,58,59,20,39,78,90,91,98,93},new int[]{32,41,69,68,87,21,97,24,16,32,83,26,3,99,82,7,96,88,16,53,88,4,45,32,98,83,78,58,13,22,95},new int[]{44,44,30,23,12,14,36,45,72,24,3,78,51,75,55,38,92,87,82,20,97,2,26,2,67,84,74,42,85,40,9},new int[]{2,28,3,16,4,23,94,77,6,74,55,81,8,73,98,81,86,64,67,41,40,93,27,39,53,40,52,37,67,19,34},new int[]{78,85,66,10,52,42,60,81,2,91,1,50,36,97,22,99,98,82,36,3,44,16,11,10,51,42,85,25,99,6,44},new int[]{8,34,41,1,3,52,91,77,43,47,83,19,70,47,78,5,64,45,64,45,36,9,23,32,93,45,28,52,11,19,64},new int[]{65,73,57,66,4,29,4,1,92,18,13,70,49,47,86,30,27,72,28,2,20,75,78,24,77,72,44,21,22,73,58},new int[]{11,80,53,9,67,52,13,1,44,75,24,5,66,81,81,20,64,15,68,54,11,23,1,42,47,68,38,2,45,27,98},new int[]{77,61,82,11,69,29,25,78,54,48,46,41,41,61,11,44,32,49,6,57,6,47,63,49,22,67,19,55,34,41,7},new int[]{57,16,59,38,9,77,34,46,37,43,47,6,38,61,4,5,70,60,77,88,92,77,56,82,59,7,68,31,88,86,85},new int[]{48,42,90,30,51,35,62,51,87,50,30,19,96,50,54,83,86,4,12,15,15,10,61,19,53,72,57,95,9,29,7},new int[]{72,17,79,16,71,83,38,89,76,96,47,10,24,50,68,43,37,45,54,43,68,37,89,41,94,1,93,16,37,37,7},new int[]{40,51,64,97,22,43,62,54,27,29,16,85,11,21,9,27,86,79,23,51,93,80,3,16,8,90,42,73,35,71,72},new int[]{99,48,54,36,6,71,12,59,65,50,43,43,49,89,76,55,91,87,83,85,50,21,88,13,42,15,50,1,51,34,42},new int[]{62,95,32,61,93,54,74,58,85,24,27,21,18,55,68,47,54,18,73,64,49,94,35,94,39,58,57,6,78,93,96},new int[]{78,20,50,9,76,14,23,48,98,80,82,56,40,97,69,39,74,86,43,97,31,70,3,4,27,89,27,47,60,36,46},new int[]{61,42,7,30,50,47,93,40,5,70,58,44,71,32,79,77,82,74,40,57,11,40,47,2,91,52,72,49,59,38,16},new int[]{88,87,78,27,74,28,89,66,45,33,60,50,46,35,41,58,77,55,5,5,22,34,65,59,17,51,49,9,74,15,29},new int[]{53,25,85,81,91,28,23,3,33,71,69,90,17,81,67,67,34,8,45,60,56,70,22,33,50,71,83,46,52,74,87},new int[]{66,21,24,48,13,64,5,18,75,37,54,32,28,86,45,28,65,70,75,42,33,16,13,21,59,47,39,88,43,27,37}}); param0.add(new int[][]{new int[]{76,7,58},new int[]{20,79,65},new int[]{74,14,79}}); param0.add(new int[][]{new int[]{89,95,74,37,6,6,28,78,13,13,10,80,39,99,79,23,37,8,90,60,86,5,98,27,19,43,43,35,84,55,61,47,77,56,82,18,65,96,53,89,85,91,11,1,83,96,8,19,55},new int[]{16,99,66,12,93,74,62,86,98,58,21,37,5,70,32,67,10,69,88,84,62,37,95,47,81,49,24,82,26,55,7,78,41,2,30,81,20,56,74,24,12,91,15,73,82,48,61,71,28},new int[]{3,16,36,4,99,9,12,74,44,66,19,13,55,97,65,92,70,3,25,52,16,43,56,68,8,80,44,38,23,6,43,44,80,80,23,16,76,9,82,9,85,58,65,59,23,69,19,35,97},new int[]{55,82,40,14,84,13,53,80,95,39,99,84,65,56,40,46,77,7,45,22,7,84,52,68,70,67,3,58,67,54,9,54,80,51,16,12,20,53,31,94,21,3,21,92,28,5,71,69,73},new int[]{47,85,20,38,37,58,17,42,92,95,97,32,62,96,87,21,89,33,67,6,92,66,32,64,26,62,5,11,74,79,82,49,78,92,94,62,60,77,84,2,89,59,76,25,68,42,76,71,55},new int[]{38,96,43,70,53,91,99,21,20,19,33,63,68,60,19,28,22,51,88,63,62,94,29,74,32,73,25,16,15,59,48,18,23,55,42,3,71,52,11,55,88,99,25,92,76,87,81,41,37},new int[]{82,55,9,99,36,57,63,82,20,85,47,20,6,73,93,29,77,91,49,6,39,32,49,43,28,45,65,50,54,51,43,64,95,30,82,93,42,38,87,86,66,69,15,61,96,6,78,24,85},new int[]{14,12,55,68,44,85,81,93,51,80,82,38,41,44,75,96,92,16,98,50,94,38,86,5,9,77,39,87,27,32,64,95,33,90,18,76,67,5,78,59,76,4,16,75,48,66,77,8,44},new int[]{21,26,35,15,40,30,66,80,13,1,43,28,1,40,34,13,61,66,4,89,98,13,36,96,61,58,85,90,15,93,90,85,12,76,69,61,42,90,32,2,8,91,54,8,88,13,29,13,58},new int[]{63,87,47,79,88,87,74,38,69,69,95,40,1,2,29,7,93,57,55,73,36,7,92,10,80,74,39,58,90,98,98,40,14,82,1,17,49,86,16,7,15,21,66,59,48,89,73,84,50},new int[]{10,52,85,68,30,34,94,78,86,65,60,8,75,65,69,57,45,49,74,62,39,77,21,53,45,97,28,53,9,75,93,71,61,27,22,95,30,92,84,15,15,53,76,81,23,70,16,91,87},new int[]{65,45,7,45,39,50,49,48,49,40,39,57,82,63,56,86,2,26,96,23,18,83,88,68,60,2,94,49,38,31,40,80,53,64,33,58,50,64,3,61,82,10,66,51,94,30,25,43,88},new int[]{64,59,62,99,10,64,94,60,90,99,88,20,49,99,74,27,51,57,79,79,37,99,3,29,68,47,80,69,21,42,21,2,78,69,7,75,35,30,44,46,55,1,54,80,1,63,55,86,77},new int[]{27,15,81,9,69,59,23,11,24,72,98,54,31,22,14,5,17,82,83,71,90,89,82,44,79,93,49,65,4,9,36,51,32,88,18,15,20,58,40,66,89,13,91,13,62,28,46,15,93},new int[]{85,44,95,23,67,99,78,66,50,13,2,76,91,34,40,69,61,25,75,77,63,28,85,56,26,27,26,15,50,6,68,4,30,77,9,42,14,92,40,3,41,93,33,79,60,64,62,79,7},new int[]{76,50,39,71,47,70,26,58,73,51,88,52,94,16,48,27,33,23,45,83,83,22,42,33,10,47,96,79,39,46,72,51,25,82,15,58,59,26,41,44,85,22,98,37,14,4,24,66,63},new int[]{65,66,13,27,81,17,69,88,57,72,73,18,16,51,96,40,39,56,54,44,46,32,48,61,66,38,43,4,5,58,37,26,9,15,88,88,99,89,26,63,87,70,27,54,83,31,32,2,18},new int[]{28,71,87,88,92,25,39,49,4,52,83,68,57,13,65,63,98,71,25,23,30,61,7,54,17,97,60,66,38,13,52,52,32,86,9,17,82,40,91,75,54,54,28,72,50,18,13,33,15},new int[]{86,38,94,6,45,59,98,83,97,78,48,41,83,79,74,55,61,2,2,85,76,10,76,39,2,65,66,87,92,81,52,85,44,34,73,81,45,32,5,78,89,86,63,69,54,38,9,61,95},new int[]{21,36,1,22,87,87,15,46,65,6,40,35,81,61,23,20,28,37,82,7,49,84,24,80,13,92,7,15,87,23,95,69,91,60,10,51,64,71,56,32,23,54,73,93,91,85,70,90,84},new int[]{61,79,20,53,15,29,70,80,65,62,70,16,54,97,7,60,10,53,8,85,90,37,82,4,84,83,97,23,9,38,45,45,18,46,2,48,17,16,45,48,24,95,65,92,33,4,1,33,74},new int[]{62,3,45,21,64,73,57,40,62,43,88,46,72,24,24,10,99,68,57,44,73,75,48,77,27,30,46,12,60,19,68,54,34,87,90,7,82,42,68,53,8,22,26,77,63,46,81,44,62},new int[]{36,41,79,82,27,70,98,41,5,57,76,29,12,25,34,75,87,24,82,63,63,10,5,95,89,53,81,28,65,45,66,49,40,66,91,8,27,17,68,44,31,5,60,89,92,19,42,23,77},new int[]{17,94,58,87,49,3,77,96,45,35,2,47,3,29,74,20,34,79,40,65,90,63,56,32,66,96,41,29,84,87,51,12,44,10,83,74,83,90,88,9,29,29,92,61,64,3,87,4,55},new int[]{14,77,28,63,39,64,60,20,28,96,14,77,75,58,39,58,15,73,3,5,92,42,15,3,35,7,94,24,31,78,80,4,3,99,9,68,83,88,60,11,79,36,95,72,2,50,3,67,85},new int[]{62,76,14,23,77,16,81,18,13,56,90,45,40,31,81,32,1,35,36,83,92,66,29,43,29,43,19,64,92,98,31,19,96,29,73,7,58,76,60,51,95,82,92,50,21,9,34,34,47},new int[]{24,80,28,46,51,99,6,63,53,64,52,60,41,11,4,14,13,15,8,88,11,99,89,23,7,69,32,92,44,3,94,44,69,51,61,51,33,20,30,44,86,86,29,21,82,53,11,10,35},new int[]{26,44,4,74,57,39,80,41,94,67,98,89,36,4,74,13,70,7,28,59,37,15,30,74,12,81,30,1,36,88,21,32,63,82,13,37,44,21,18,46,47,26,5,5,31,28,77,75,65},new int[]{88,13,18,24,29,28,45,86,84,11,51,59,84,13,47,88,43,24,48,63,17,69,54,94,14,15,73,78,10,22,95,13,81,65,14,44,39,35,65,27,45,57,22,34,9,50,54,58,96},new int[]{62,38,84,27,64,3,11,24,29,69,97,8,19,68,99,94,69,48,40,67,16,64,8,5,99,72,25,53,49,72,21,51,46,9,64,96,77,23,60,59,8,64,99,54,92,15,52,93,51},new int[]{4,34,24,21,2,7,56,75,76,68,35,26,18,64,56,80,55,12,37,52,19,15,86,84,52,77,87,95,26,45,96,21,81,93,53,29,48,86,19,54,78,87,2,32,62,97,7,98,68},new int[]{87,84,22,29,3,22,84,89,98,53,93,57,10,40,20,87,11,8,93,36,25,39,98,96,62,87,21,19,25,87,83,5,83,99,12,25,5,76,27,4,83,45,47,88,28,97,35,16,12},new int[]{80,75,43,28,87,81,19,75,68,74,55,83,36,62,39,41,60,86,66,59,97,40,91,19,55,46,4,83,62,25,63,70,13,86,4,2,67,30,4,48,43,93,45,97,13,47,96,28,37},new int[]{28,27,89,30,6,94,9,6,29,87,70,86,66,95,53,70,5,20,12,8,58,49,64,50,97,39,40,31,3,83,72,30,95,29,70,56,66,87,63,30,53,46,9,7,63,47,44,49,79},new int[]{79,85,62,59,78,75,75,84,13,30,84,43,51,8,37,97,90,64,39,8,62,82,39,14,52,82,57,21,23,4,74,43,11,84,19,65,95,2,49,69,34,4,91,39,49,3,26,41,65},new int[]{16,58,35,83,16,33,31,22,61,84,64,70,35,39,3,96,13,14,41,8,19,14,75,50,99,61,36,67,89,77,80,92,45,91,74,82,72,7,22,9,60,42,59,40,29,55,64,42,29},new int[]{92,21,97,63,63,90,38,79,66,12,33,79,1,97,68,28,62,78,59,49,45,76,6,20,85,16,12,52,20,58,45,97,2,34,26,33,42,94,65,8,65,10,32,51,57,40,66,31,63},new int[]{68,56,12,31,23,33,8,62,80,15,41,52,26,78,12,27,95,68,30,4,54,95,34,68,84,56,18,47,72,60,59,2,73,16,86,58,12,5,39,15,72,88,19,82,85,49,39,78,15},new int[]{55,67,56,45,75,57,67,94,6,70,31,22,85,38,58,70,29,56,11,48,86,60,51,39,6,30,89,1,86,9,45,8,34,80,83,8,12,43,56,31,42,33,19,91,88,92,55,4,12},new int[]{87,84,28,58,48,1,75,44,63,95,38,9,6,70,52,67,96,99,16,2,36,71,35,30,45,46,93,65,1,57,71,67,31,25,47,56,88,1,95,37,75,67,12,20,30,74,64,79,85},new int[]{64,18,32,19,94,33,62,22,29,88,4,50,76,4,5,83,39,57,31,7,12,10,29,85,13,87,70,31,9,51,88,16,59,58,11,36,1,21,44,37,6,14,93,1,8,44,83,87,75},new int[]{27,36,42,20,8,46,52,26,35,60,3,4,93,62,64,50,92,19,43,92,82,14,14,54,29,3,98,73,5,93,5,45,64,64,43,43,51,13,90,73,68,95,69,7,92,78,88,42,5},new int[]{47,48,98,92,47,8,21,88,24,13,15,89,53,92,72,31,71,51,47,39,81,57,50,57,35,86,7,53,10,92,39,58,93,35,59,22,9,8,94,94,58,95,22,95,40,28,46,69,81},new int[]{52,11,22,47,89,13,45,75,69,78,22,67,35,32,38,58,40,88,92,21,49,97,92,39,61,10,40,58,89,45,17,68,10,62,89,32,72,42,45,76,21,27,30,74,85,1,9,3,53},new int[]{42,19,6,7,43,80,36,68,82,96,96,82,39,43,37,28,50,39,2,37,66,19,69,44,13,22,7,2,62,78,89,90,5,20,54,76,63,36,95,81,16,57,64,10,99,97,99,51,27},new int[]{7,91,41,76,97,13,66,3,11,5,60,2,92,77,99,64,13,54,12,18,18,17,39,86,13,45,19,88,19,21,24,30,92,48,35,59,17,48,98,55,9,77,14,26,52,85,44,84,11},new int[]{51,42,62,35,64,95,18,14,49,69,17,21,14,3,31,89,47,44,17,90,81,56,83,27,71,90,69,2,80,62,75,87,99,6,65,97,18,55,67,57,19,74,84,11,96,84,55,96,37},new int[]{86,4,13,70,93,58,2,60,89,32,63,60,26,90,22,74,87,4,16,63,42,33,13,46,13,33,14,8,90,86,46,1,59,60,49,80,93,61,23,5,85,50,36,20,43,8,90,41,25},new int[]{7,86,61,33,69,38,12,44,53,14,71,92,52,52,46,80,41,2,49,95,78,28,32,92,76,77,22,42,29,94,79,68,33,46,9,38,80,26,43,53,27,11,26,78,57,1,11,30,88}}); param0.add(new int[][]{new int[]{4,86,72,80,33,33,74,66,4,87,51,27,33,97,84,77,75,83,32,67,77,28,86,57,19,31,84,53,88,32,9,51,83,23,25,97,46,44,66,67,28,99,78,24,56,50,3,23,34},new int[]{9,82,59,66,22,35,31,90,78,48,53,92,75,32,85,87,88,12,62,3,6,12,53,20,6,84,14,56,41,49,65,84,86,95,31,28,12,16,97,35,44,68,10,98,3,31,52,95,65},new int[]{5,5,66,15,65,21,71,11,90,42,66,94,61,60,14,5,31,48,32,57,34,74,95,27,82,5,17,75,69,56,38,54,48,85,88,94,80,49,41,22,57,66,19,2,75,33,73,59,89},new int[]{6,11,27,72,45,31,91,63,44,41,47,69,79,2,15,95,20,3,39,74,90,10,40,13,85,98,44,32,73,30,1,53,76,44,35,88,40,45,60,63,10,47,24,57,18,57,72,46,43},new int[]{77,16,14,9,73,69,61,11,19,64,38,10,16,93,69,82,42,44,53,35,36,22,24,76,12,35,50,83,78,87,40,22,47,75,66,10,43,69,94,85,97,25,47,7,28,80,45,67,83},new int[]{12,83,11,3,61,66,56,26,86,81,34,55,79,76,16,80,39,6,72,52,25,56,83,19,76,73,93,27,5,26,30,78,97,35,75,53,68,33,70,28,74,36,49,90,94,86,53,69,2},new int[]{97,80,71,64,21,35,46,86,48,22,6,33,39,43,25,18,41,35,24,55,40,87,97,29,10,79,10,90,64,29,98,18,2,25,85,51,95,22,9,91,89,89,91,74,94,4,21,30,33},new int[]{43,90,2,87,31,4,47,84,89,45,65,66,6,7,51,68,18,41,69,25,56,1,98,55,3,54,81,32,88,2,65,98,8,58,53,44,73,28,19,56,20,71,56,35,19,81,63,82,7},new int[]{27,39,30,23,84,23,90,47,78,48,95,91,63,9,23,63,74,47,87,74,66,37,38,1,48,82,35,71,86,53,25,42,23,9,27,75,51,91,92,57,82,36,34,13,55,46,52,94,28},new int[]{86,88,30,45,38,20,70,97,47,59,79,79,96,14,42,61,59,8,57,22,84,88,21,28,49,23,88,54,23,68,46,68,94,28,95,97,50,83,63,10,89,37,13,70,30,87,80,72,80},new int[]{11,1,86,18,11,84,10,48,61,10,60,22,75,99,9,15,83,37,70,44,69,3,10,77,4,56,40,33,98,33,60,21,69,45,57,77,40,81,64,10,74,66,85,65,30,82,35,53,39},new int[]{22,67,70,80,67,75,17,19,60,72,78,90,89,51,48,57,10,32,79,68,28,4,61,77,12,15,29,87,13,38,58,35,40,76,94,5,2,30,99,10,73,81,38,59,94,35,71,12,42},new int[]{98,49,67,33,13,75,20,95,33,34,50,50,9,7,9,26,2,5,66,10,31,33,6,14,78,15,97,95,81,43,79,20,21,64,29,59,73,64,93,44,34,47,9,60,30,17,52,59,4},new int[]{40,96,96,7,38,32,69,67,56,20,64,17,16,11,13,18,14,34,76,86,85,26,42,61,39,2,57,50,16,62,98,11,83,63,30,54,71,27,86,64,81,79,9,76,72,2,49,48,55},new int[]{80,67,31,26,66,30,77,78,1,96,70,22,75,87,54,14,14,84,71,19,26,59,22,6,63,77,74,54,19,95,10,37,77,17,55,5,21,39,20,71,15,79,53,87,33,44,66,50,32},new int[]{79,71,73,55,28,86,3,53,42,2,22,25,89,32,7,62,31,63,37,68,97,79,9,70,46,95,34,60,13,36,96,86,48,93,75,6,5,65,50,74,74,24,7,86,58,21,86,33,44},new int[]{25,95,80,15,29,83,52,17,90,36,35,40,23,73,34,58,82,80,61,96,28,60,32,58,82,44,34,93,21,1,55,80,49,97,21,99,55,27,20,95,16,78,48,32,32,53,53,2,57},new int[]{22,52,81,96,81,58,34,71,93,17,88,72,23,33,29,19,69,37,87,26,24,54,21,97,90,10,42,29,57,35,28,12,58,44,7,16,84,93,35,92,7,86,14,59,62,74,66,22,16},new int[]{99,75,43,97,98,97,83,20,10,19,12,10,71,56,11,80,97,61,38,17,54,45,25,31,65,39,20,73,43,66,1,55,51,5,12,14,60,96,40,9,42,42,33,25,78,9,91,44,83},new int[]{58,25,32,22,93,55,92,61,57,77,61,92,67,94,75,2,57,73,33,90,63,16,89,1,85,64,84,69,17,40,1,13,18,68,14,5,62,33,26,61,68,30,62,62,81,92,70,57,91},new int[]{36,7,65,74,77,41,32,14,33,30,73,6,10,75,20,89,12,22,76,14,48,54,36,61,55,14,2,2,61,6,25,67,23,73,95,28,25,99,65,66,79,43,40,80,23,49,99,8,7},new int[]{21,35,97,99,82,61,83,74,68,30,97,68,9,17,43,88,57,13,57,26,61,62,19,81,30,90,13,49,82,85,98,51,9,94,29,93,83,8,81,76,15,69,34,52,50,67,5,98,9},new int[]{88,5,27,84,47,62,45,66,23,98,61,93,43,35,30,67,10,56,34,65,6,70,43,16,63,65,5,25,27,42,55,26,16,90,28,92,30,77,89,45,19,13,75,23,14,74,98,23,40},new int[]{64,85,59,20,32,78,24,46,18,94,92,48,14,54,21,98,5,31,67,87,59,44,64,94,42,94,38,7,59,69,70,49,78,11,2,95,27,16,64,66,49,90,16,73,52,73,5,36,7},new int[]{61,96,29,67,30,40,31,48,91,6,62,29,9,54,84,11,19,74,5,87,70,95,18,21,15,59,95,74,6,24,97,60,28,92,74,23,79,46,37,14,48,78,71,36,82,60,54,79,63},new int[]{97,48,22,43,41,17,63,90,79,18,72,3,54,14,34,97,1,48,99,10,83,11,99,66,3,15,59,64,47,92,2,30,38,5,6,5,12,4,24,25,26,55,46,46,43,60,33,21,87},new int[]{37,12,21,13,33,70,76,61,30,37,82,16,45,71,1,53,28,53,44,67,39,10,51,14,79,6,39,80,82,99,48,25,97,33,83,75,67,65,40,25,57,32,46,4,23,80,75,22,33},new int[]{41,62,38,56,63,77,85,76,55,51,90,65,57,86,27,57,55,96,72,98,82,4,65,56,53,44,16,94,23,31,28,50,16,41,9,2,43,66,96,80,77,49,91,95,97,21,19,57,77},new int[]{60,19,99,64,35,33,67,85,87,48,60,45,75,68,68,15,92,72,88,98,15,23,60,91,14,2,99,43,71,16,86,28,32,71,86,2,72,7,38,48,85,86,99,82,73,2,42,42,81},new int[]{20,6,11,69,74,87,97,40,36,51,47,98,17,26,53,48,27,46,67,19,72,81,65,71,36,67,83,42,91,67,98,69,49,37,46,80,56,63,78,30,96,63,76,91,26,93,23,86,20},new int[]{46,80,31,67,21,51,39,63,69,20,23,96,42,73,3,27,91,74,80,24,87,9,2,6,99,71,79,21,87,29,13,69,42,1,20,43,1,99,40,7,35,52,34,50,69,29,91,71,1},new int[]{73,58,65,91,17,62,96,94,79,42,28,3,92,5,66,54,38,80,44,81,76,90,57,71,24,80,82,59,8,91,90,95,82,2,41,87,56,48,22,97,18,79,41,67,48,23,2,4,26},new int[]{19,49,74,86,53,6,62,1,16,52,7,88,35,78,68,15,57,23,83,78,91,86,11,4,58,96,40,58,88,98,67,38,2,87,40,84,56,72,35,49,67,96,95,44,31,65,76,18,88},new int[]{36,62,29,89,23,3,30,81,45,49,94,19,64,5,56,34,73,48,26,5,88,31,24,85,22,22,85,57,30,47,74,67,39,93,89,66,77,91,29,14,4,72,5,44,91,24,98,28,24},new int[]{5,13,82,55,81,30,83,86,49,82,90,15,92,30,28,84,4,68,15,34,75,87,99,43,99,75,61,63,2,52,52,15,40,28,95,96,98,55,50,22,29,72,86,12,87,38,2,12,55},new int[]{85,12,95,9,79,32,73,88,8,28,56,82,36,37,32,85,39,49,93,18,23,33,73,51,43,4,80,67,72,80,2,45,83,88,80,40,2,32,1,18,64,32,9,55,67,24,11,28,16},new int[]{93,12,68,90,4,75,66,31,56,50,67,89,98,1,69,39,52,95,36,67,12,61,80,72,11,14,91,82,54,8,33,4,30,84,94,91,89,54,6,5,78,51,14,34,41,89,39,18,20},new int[]{8,26,85,27,32,42,50,81,49,65,63,27,75,35,38,38,42,42,49,57,54,10,60,40,1,86,64,81,12,57,77,89,26,40,43,97,72,13,90,56,17,88,24,76,95,58,80,61,80},new int[]{94,28,67,97,51,88,94,92,39,66,77,74,40,13,19,6,18,9,81,68,54,50,70,11,55,42,90,11,72,67,2,82,66,26,76,37,90,36,16,78,66,21,7,11,56,44,54,93,57},new int[]{58,37,48,62,39,92,64,68,68,27,70,98,82,60,44,30,97,58,84,36,5,99,19,12,90,60,83,11,53,20,73,84,27,58,5,74,9,89,77,32,72,54,45,27,86,28,18,87,31},new int[]{41,34,7,5,21,6,45,35,87,3,33,38,87,80,89,16,89,71,8,3,69,19,7,86,90,50,89,6,5,61,86,95,58,22,57,75,32,17,58,41,22,80,42,79,8,46,48,3,77},new int[]{30,28,73,76,25,37,85,51,39,83,72,67,86,1,38,52,63,52,83,85,60,13,91,17,84,30,38,11,27,38,28,26,33,32,54,25,24,40,27,46,86,84,97,69,93,69,39,81,29},new int[]{75,86,31,65,15,83,74,9,13,45,90,6,44,2,29,48,12,87,67,50,11,5,45,74,47,6,80,95,87,94,84,89,99,69,63,67,47,34,12,27,69,86,68,28,71,45,98,2,9},new int[]{79,31,36,15,97,62,31,27,2,73,43,1,83,9,60,2,58,65,12,55,90,10,65,65,61,95,75,69,35,11,68,38,39,21,36,92,72,20,43,21,35,64,32,36,69,52,4,7,98},new int[]{84,71,24,21,57,73,19,84,28,32,34,16,38,81,75,4,56,40,50,40,82,49,48,6,96,5,79,45,16,17,59,56,79,35,8,99,61,27,78,87,20,57,70,88,23,76,2,27,32},new int[]{93,50,64,40,33,29,33,17,74,65,43,63,81,92,58,91,43,37,46,25,98,67,93,99,51,74,38,38,1,54,65,96,22,61,58,54,19,99,70,34,79,44,67,52,22,29,14,94,62},new int[]{15,93,14,67,22,97,87,7,84,7,17,32,79,77,56,62,58,58,3,89,96,80,1,67,20,92,86,62,56,53,65,56,78,45,79,96,18,48,38,22,80,75,71,73,1,42,72,75,69},new int[]{29,6,56,12,39,71,12,33,83,53,19,58,85,83,43,73,45,86,19,37,11,56,25,99,69,45,62,95,14,77,34,98,82,60,64,70,51,42,21,5,66,70,61,8,66,87,62,20,4},new int[]{15,94,56,20,24,9,21,41,13,5,64,46,78,71,70,59,76,51,16,51,96,42,11,68,93,52,98,73,10,72,63,36,96,45,6,6,91,66,73,64,38,69,98,61,78,74,63,71,20}}); param0.add(new int[][]{new int[]{64,81,37,36,97,10,34,45,63,13,25,44,97},new int[]{74,24,69,74,47,91,50,36,33,92,3,31,60},new int[]{29,44,45,42,21,32,28,85,47,99,94,47,17},new int[]{29,48,2,33,63,68,39,89,5,68,52,52,29},new int[]{37,8,20,41,70,36,32,5,20,68,22,97,31},new int[]{41,93,5,10,75,37,56,86,24,85,16,2,15},new int[]{41,63,49,26,94,66,29,70,60,65,40,11,52},new int[]{87,90,95,79,73,64,98,81,99,3,11,28,62},new int[]{48,28,46,64,55,83,2,96,75,16,11,3,55},new int[]{42,29,69,92,31,77,25,6,60,67,22,41,53},new int[]{60,39,55,96,30,71,89,2,8,63,59,97,28},new int[]{74,38,18,62,77,85,97,23,65,40,60,85,5},new int[]{99,18,38,29,26,60,36,82,29,31,63,13,94}}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(8); param1.add(33); param1.add(10); param1.add(0); param1.add(16); param1.add(2); param1.add(41); param1.add(34); 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,144
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMIZE_SUM_PRODUCT_TWO_ARRAYS_PERMUTATIONS_ALLOWED.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 MINIMIZE_SUM_PRODUCT_TWO_ARRAYS_PERMUTATIONS_ALLOWED{ static int f_gold ( int A [ ] , int B [ ] , int n ) { Arrays . sort ( A ) ; Arrays . sort ( B ) ; int result = 0 ; for ( int i = 0 ; i < n ; i ++ ) result += ( A [ i ] * B [ n - i - 1 ] ) ; return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{31,85}); param0.add(new int[]{22,-6,84,70,84,6,28,-74,-14,68,22,90,-10}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{12,33,93,2,83,9,61,84,9,69,2}); param0.add(new int[]{-92,-88,-84,-78,-78,-76,-66,-54,-52,-48,-46,-44,-40,-34,-32,-24,-20,-14,-6,-4,2,6,10,10,22,26,32,36,36,40,46,48,56,58,64,76,80,80,80,84,84,84,92}); param0.add(new int[]{1,0,1,1,0,1,1,0,1,0,0,1,1,1,0,0,0,0,0,0,1,0,1,1,0,1,0,1,1,0,0,0,1,0}); param0.add(new int[]{4,6,6,20,22,23,26,39,40,47,50,68,68,70,73,77,80,82,85}); param0.add(new int[]{78,60,-8,46,-12}); 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,1}); param0.add(new int[]{60,66,84,99,85,89,28,97,85,71,53,93,23,9,45,26,49,95,64,33,70,34,10,1,68,39,53,12}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{18,33}); param1.add(new int[]{2,-48,-36,-4,-22,-98,-74,-92,-72,-4,48,-32,94}); param1.add(new int[]{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{85,92,92,1,54,31,69,4,39,81,52}); param1.add(new int[]{-98,-90,-82,-80,-76,-66,-62,-62,-62,-50,-50,-50,-32,-30,-14,-12,4,6,12,14,16,30,30,30,32,34,40,42,50,52,56,58,60,62,62,64,66,68,78,82,86,90,94}); param1.add(new int[]{0,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,1,1,0,1,1,0,0,1,1,0,0,0,0,1,1,1}); param1.add(new int[]{2,3,15,21,22,26,35,37,37,38,57,59,62,63,64,76,81,85,91}); param1.add(new int[]{-72,-80,-30,16,-38}); param1.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}); param1.add(new int[]{37,33,33,77,78,34,28,1,63,15,51,50,90,22,71,23,68,55,2,22,31,54,76,36,2,27,96,89}); List<Integer> param2 = new ArrayList<>(); param2.add(1); param2.add(6); param2.add(14); param2.add(7); param2.add(26); param2.add(32); param2.add(17); param2.add(2); param2.add(17); param2.add(15); 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,145
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/AREA_CIRCUMSCRIBED_CIRCLE_SQUARE.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 AREA_CIRCUMSCRIBED_CIRCLE_SQUARE{ static float f_gold ( float a ) { float PI = 3.14159265f ; return ( a * a * ( PI / 2 ) ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Float> param0 = new ArrayList<>(); param0.add(3296.590241413969F); param0.add(-1688.6061770081972F); param0.add(1571.9067680023313F); param0.add(-3117.129927920369F); param0.add(8561.027934208052F); param0.add(-5052.211066243729F); param0.add(3601.752337206948F); param0.add(-651.9008970363393F); param0.add(4415.044414999076F); param0.add(-1453.219956352866F); 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,146
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_INCREMENT_K_OPERATIONS_MAKE_ELEMENTS_EQUAL.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_INCREMENT_K_OPERATIONS_MAKE_ELEMENTS_EQUAL{ static int f_gold ( int arr [ ] , int n , int k ) { Arrays . sort ( arr ) ; int max = arr [ arr . length - 1 ] ; int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( max - arr [ i ] ) % k != 0 ) return - 1 ; else res += ( max - arr [ i ] ) / k ; } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4, 7, 19, 16}); param0.add(new int[]{4,4,4,4,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,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[]{85,36,52,8,52,15,16}); param0.add(new int[]{-10,-5,-5,-20,10,30}); param0.add(new int[]{0,1,0,0,1,1,1,0,0,0,0,1,1,0,0,1,0}); param0.add(new int[]{1,5,5,9,11,12,12,13,13,14,16,18,26,26,28,28,30,31,32,37,37,38,40,43,44,45,47,47,55,58,60,62,63,64,69,78,83,84,92,96,96,99}); param0.add(new int[]{76,-78,92,-98,16,44,86,96,-8,2,-96,74,-28,12,54,-40,-64,-12,4,48,68,-82,8,0,-4,88,48,-54,90,62,-84,76,-48,62,-80,-94,38,-4,36}); 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,1,1,1,1,1}); param0.add(new int[]{62,99,29,23,55,30,79,63,1,88,59,8,11,80,23,51,97,32,80,48,84,36,73,59,1,34,92,10}); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(5); param1.add(39); param1.add(5); param1.add(6); param1.add(10); param1.add(26); param1.add(34); param1.add(39); param1.add(18); List<Integer> param2 = new ArrayList<>(); param2.add(3); param2.add(3); param2.add(1); param2.add(6); param2.add(5); param2.add(15); param2.add(33); param2.add(3); param2.add(10); param2.add(1); 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,147
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/RECURSIVELY_BREAK_NUMBER_3_PARTS_GET_MAXIMUM_SUM.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 RECURSIVELY_BREAK_NUMBER_3_PARTS_GET_MAXIMUM_SUM{ static int f_gold ( int n ) { if ( n == 0 || n == 1 ) return n ; return Math . max ( ( f_gold ( n / 2 ) + f_gold ( n / 3 ) + f_gold ( n / 4 ) ) , n ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(39); param0.add(79); param0.add(7); param0.add(76); param0.add(48); param0.add(18); param0.add(58); param0.add(17); param0.add(36); param0.add(5); 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,148
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_SUM_SUBARRAY_REMOVING_ONE_ELEMENT.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_SUBARRAY_REMOVING_ONE_ELEMENT{ static int f_gold ( int arr [ ] , int n ) { int fw [ ] = new int [ n ] ; int bw [ ] = new int [ n ] ; int cur_max = arr [ 0 ] , max_so_far = arr [ 0 ] ; fw [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { cur_max = Math . max ( arr [ i ] , cur_max + arr [ i ] ) ; max_so_far = Math . max ( max_so_far , cur_max ) ; fw [ i ] = cur_max ; } cur_max = max_so_far = bw [ n - 1 ] = arr [ n - 1 ] ; for ( int i = n - 2 ; i >= 0 ; i -- ) { cur_max = Math . max ( arr [ i ] , cur_max + arr [ i ] ) ; max_so_far = Math . max ( max_so_far , cur_max ) ; bw [ i ] = cur_max ; } int fans = max_so_far ; for ( int i = 1 ; i < n - 1 ; i ++ ) fans = Math . max ( fans , fw [ i - 1 ] + bw [ i + 1 ] ) ; return fans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,8,14,17,19,35,38,45,50,53,55,70,82,88,92,96}); param0.add(new int[]{-64,-56,-80,-82,72,62,-8,48,-96,34,64,-38,-60,80,4,-64,-62,34,94,-16,38,62,-84,48,42,-40}); param0.add(new int[]{0,0,0,0,1,1,1}); param0.add(new int[]{3,7,50,53,72,14,18,74,27,65,41,20,54,17,87,40,63,15,47}); param0.add(new int[]{-96,-96,-94,-80,-74,-74,-74,-74,-70,-64,-60,-58,-52,-52,-44,-42,-40,-38,-36,-34,-30,-14,-12,-8,-2,6,12,16,24,24,48,48,66,76,76,84,90}); param0.add(new int[]{1,1,0,1,1,1,1,0,0,0,1,0,1,0,0}); param0.add(new int[]{4,4,5,9,11,13,13,15,16,21,23,25,27,30,31,35,35,43,43,47,49,50,52,54,55,55,57,57,57,59,62,64,66,68,69,71,73,76,80,84,88,88,90,90,97,97,99}); param0.add(new int[]{-86,-60,4,14,6,-6,-50,46,-50,-62,-56,16,-76,90,40,2,36,48,-26,34,78,84,2,-54,94,60,-26,60,84,2,-98,2,-74}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}); param0.add(new int[]{36,99,27,8,90,74,67,77,49,23,43,25,68,56,85,6}); List<Integer> param1 = new ArrayList<>(); param1.add(13); param1.add(22); param1.add(6); param1.add(11); param1.add(32); param1.add(8); param1.add(34); param1.add(25); param1.add(9); 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,149
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NUMBER_IS_DIVISIBLE_BY_29_OR_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 NUMBER_IS_DIVISIBLE_BY_29_OR_NOT{ static boolean f_gold ( long n ) { while ( n / 100 > 0 ) { int last_digit = ( int ) n % 10 ; n /= 10 ; n += last_digit * 3 ; } return ( n % 29 == 0 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Long> param0 = new ArrayList<>(); param0.add(29L); param0.add(0L); param0.add(65L); param0.add(1419L); param0.add(54L); param0.add(7L); param0.add(44L); param0.add(34L); param0.add(1160L); param0.add(292929002929L); 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,150
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_PRODUCT_SUBSET_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 MINIMUM_PRODUCT_SUBSET_ARRAY{ static int f_gold ( int a [ ] , int n ) { if ( n == 1 ) return a [ 0 ] ; int negmax = Integer . MIN_VALUE ; int posmin = Integer . MAX_VALUE ; int count_neg = 0 , count_zero = 0 ; int product = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] == 0 ) { count_zero ++ ; continue ; } if ( a [ i ] < 0 ) { count_neg ++ ; negmax = Math . max ( negmax , a [ i ] ) ; } if ( a [ i ] > 0 && a [ i ] < posmin ) posmin = a [ i ] ; product *= a [ i ] ; } if ( count_zero == n || ( count_neg == 0 && count_zero > 0 ) ) return 0 ; if ( count_neg == 0 ) return posmin ; if ( count_neg % 2 == 0 && count_neg != 0 ) { product = product / negmax ; } return product ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,6,7,8,8,9,12,12,12,13,15,15,15,16,18,18,18,19,20,21,22,22,23,28,29,30,30,33,33,35,35,36,40,43,58,63,73,78,82,83,84,87,89,89,92,94}); param0.add(new int[]{18,-6,-8,98,66,-86,24,6,58,74,82}); 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}); param0.add(new int[]{97,79,93,41,76,34,94,57,63,98,52,62,96,7,63,44,55,43,36,66,35,14,24,40,26,16,67,19,31,86,64,93,85,86,66,24,73,86,45,99,25,98,38,57}); param0.add(new int[]{-58,-48,-46,-36,0,18}); param0.add(new int[]{1,1,1,0,0,0,1,0,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,0}); param0.add(new int[]{1,3,5,15,18,19,21,23,29,29,33,33,34,37,39,43,43,68,73,74,75,84,87,88,89,90,93}); param0.add(new int[]{74,70,-36,16,10,60,-82,96,-30,58,56,-54,-14,94,10,-82,-80,-40,-72,-68,8,38,-50,-76,34,2,-66,-30,26}); 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}); param0.add(new int[]{74,74,8,74,85,41,31,3,84,46,73,39,64,72,28,83,98,27,64,7,95,37,10,38,77,32,69,72,62,96,5,81,34,96,80,25,38}); List<Integer> param1 = new ArrayList<>(); param1.add(23); param1.add(10); param1.add(25); param1.add(30); param1.add(3); param1.add(36); param1.add(18); param1.add(15); param1.add(20); param1.add(33); 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,151
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD.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 PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD{ 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(37); param0.add(39); param0.add(73); param0.add(8); param0.add(28); param0.add(66); param0.add(20); param0.add(36); param0.add(6); 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,152
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIRST_UPPERCASE_LETTER_IN_A_STRING_ITERATIVE_AND_RECURSIVE.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_UPPERCASE_LETTER_IN_A_STRING_ITERATIVE_AND_RECURSIVE{ static char f_gold ( String str ) { for ( int i = 0 ; i < str . length ( ) ; i ++ ) if ( Character . isUpperCase ( str . charAt ( i ) ) ) return str . charAt ( i ) ; return 0 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("pH"); param0.add("96544000"); param0.add("000010000"); param0.add("ujqpx"); param0.add("20684847994"); param0.add("111"); param0.add("rclkv"); param0.add("45173693434"); param0.add("11111011001101"); param0.add("f"); 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,153
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PROGRAM_COUNT_OCCURRENCE_GIVEN_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 PROGRAM_COUNT_OCCURRENCE_GIVEN_CHARACTER_STRING{ public static int f_gold ( String s , char c ) { int res = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == c ) res ++ ; } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("mhjnKfd"); param0.add("716662107"); param0.add("01"); param0.add("wPHSxIbnHakGRO"); param0.add("721106"); param0.add("111"); param0.add("TIBFU"); param0.add("0"); param0.add("10"); param0.add("lqq"); List<Character> param1 = new ArrayList<>(); param1.add('l'); param1.add('6'); param1.add('1'); param1.add('n'); param1.add('8'); param1.add('0'); param1.add('Q'); param1.add('3'); param1.add('0'); param1.add('d'); 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,154
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_SUM_ODD_FACTORS_NUMBER.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_SUM_ODD_FACTORS_NUMBER{ static int f_gold ( int n ) { int res = 1 ; while ( n % 2 == 0 ) n = n / 2 ; for ( int i = 3 ; i <= Math . sqrt ( n ) ; i ++ ) { int count = 0 , curr_sum = 1 ; int curr_term = 1 ; while ( n % i == 0 ) { count ++ ; n = n / i ; curr_term *= i ; curr_sum += curr_term ; } res *= curr_sum ; } if ( n >= 2 ) res *= ( 1 + n ) ; return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(20); param0.add(6); param0.add(39); param0.add(80); param0.add(88); param0.add(7); param0.add(16); param0.add(27); param0.add(83); param0.add(6); 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,155
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_LARGE_NUMBER_DIVISIBLE_13_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_13_NOT{ static boolean f_gold ( String num ) { int length = num . length ( ) ; if ( length == 1 && num . charAt ( 0 ) == '0' ) return true ; if ( length % 3 == 1 ) { num += "00" ; length += 2 ; } else if ( length % 3 == 2 ) { num += "0" ; length += 1 ; } int sum = 0 , p = 1 ; for ( int i = length - 1 ; i >= 0 ; i -- ) { int group = 0 ; group += num . charAt ( i -- ) - '0' ; group += ( num . charAt ( i -- ) - '0' ) * 10 ; group += ( num . charAt ( i ) - '0' ) * 100 ; sum = sum + group * p ; p *= ( - 1 ) ; } sum = Math . abs ( sum ) ; return ( sum % 13 == 0 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("vzTUaItpCpLnjY"); param0.add("33855"); param0.add("0011110101011"); param0.add("MMQ"); param0.add("439340517954"); param0.add("000000000"); param0.add("UugAuRRJbjEgl"); param0.add("6406553695441"); param0.add("011001"); param0.add("yjFqEEvgiNjEX"); 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,156
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/LARGEST_SUBSEQUENCE_GCD_GREATER_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_SUBSEQUENCE_GCD_GREATER_1{ static int f_gold ( int arr [ ] , int n ) { int ans = 0 ; int maxele = Arrays . stream ( arr ) . max ( ) . getAsInt ( ) ; ; for ( int i = 2 ; i <= maxele ; ++ i ) { int count = 0 ; for ( int j = 0 ; j < n ; ++ j ) { if ( arr [ j ] % i == 0 ) ++ count ; } ans = Math . max ( ans , count ) ; } return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{10,18,22,22,22,29,30,32,33,34,37,39,40,41,44,47,49,50,50,51,53,67,69,70,71,71,73,75,78,80,81,82,91,91,93,97,97,99}); param0.add(new int[]{-42,62,6,98,38,-4,-38,72,42,4,-22,-94,78,-90,14}); 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}); param0.add(new int[]{89,92,96,71,24,27,18,19,41,1,45,8}); param0.add(new int[]{-98,-94,-92,-90,-82,-80,-76,-76,-72,-62,-60,-58,-56,-52,-42,-36,-32,-32,-24,-22,-20,-10,-10,-10,-8,-2,-2,0,2,4,6,6,8,10,14,18,22,26,30,46,46,62,68,74,78,82,86,86}); param0.add(new int[]{1,0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1,0,1,1,1,0,0,0,0,1,0,1,0,0,0,1}); param0.add(new int[]{4,8,10,10,11,17,18,25,32,33,34,37,40,41,44,47,47,52,63,77,85,87,89,89,91,95,96,98}); param0.add(new int[]{-86,52,-48,70,10,-94,16,14,38,62}); 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,1,1,1,1,1}); param0.add(new int[]{95,32,87,37,86,71,30,88,96,52,88,92,79,86,19,5,74,67}); List<Integer> param1 = new ArrayList<>(); param1.add(35); param1.add(10); param1.add(23); param1.add(7); param1.add(40); param1.add(41); param1.add(23); param1.add(9); param1.add(30); param1.add(13); 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,157
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PRINT_WORDS_STRING_REVERSE_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 PRINT_WORDS_STRING_REVERSE_ORDER{ static String f_gold ( String str ) { int i = str . length ( ) - 1 ; int start , end = i + 1 ; String result = "" ; while ( i >= 0 ) { if ( str . charAt ( i ) == ' ' ) { start = i + 1 ; while ( start != end ) result += str . charAt ( start ++ ) ; result += ' ' ; end = i ; } i -- ; } start = 0 ; while ( start != end ) result += str . charAt ( start ++ ) ; return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("m Dm YZ"); param0.add("65 48 57 71"); param0.add("01 010"); param0.add("mT vhByi"); param0.add("19 44 9 1"); param0.add("0"); param0.add("z vUi "); param0.add("7 591 36643 9 055"); param0.add("01"); param0.add("ti YGaijPY"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)).equals(f_gold(param0.get(i)))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,158
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PROGRAM_DECIMAL_BINARY_CONVERSION_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 PROGRAM_DECIMAL_BINARY_CONVERSION_2{ static int f_gold ( int N ) { int B_Number = 0 ; int cnt = 0 ; while ( N != 0 ) { int rem = N % 2 ; double c = Math . pow ( 10 , cnt ) ; B_Number += rem * c ; N /= 2 ; cnt ++ ; } return B_Number ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(18); param0.add(92); param0.add(87); param0.add(50); param0.add(56); param0.add(88); param0.add(3); param0.add(16); param0.add(45); 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,159
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_NUMBER_OF_SQUARES_THAT_CAN_BE_FIT_IN_A_RIGHT_ANGLE_ISOSCELES_TRIANGLE.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_NUMBER_OF_SQUARES_THAT_CAN_BE_FIT_IN_A_RIGHT_ANGLE_ISOSCELES_TRIANGLE{ static int f_gold ( int b , int m ) { return ( b / m - 1 ) * ( b / m ) / 2 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(40); param0.add(38); param0.add(47); param0.add(52); param0.add(21); param0.add(50); param0.add(8); param0.add(56); param0.add(93); param0.add(21); List<Integer> param1 = new ArrayList<>(); param1.add(74); param1.add(35); param1.add(71); param1.add(29); param1.add(9); param1.add(33); param1.add(82); param1.add(80); param1.add(5); param1.add(90); 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,160
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/K_TH_DIGIT_RAISED_POWER_B.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_DIGIT_RAISED_POWER_B{ public static int f_gold ( int a , int b , int k ) { int p = ( int ) Math . pow ( a , b ) ; int count = 0 ; while ( p > 0 && count < k ) { int rem = p % 10 ; count ++ ; if ( count == k ) return rem ; p = p / 10 ; } return 0 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(11); param0.add(41); param0.add(5); param0.add(1); param0.add(24); param0.add(5); param0.add(66); param0.add(7); param0.add(77); param0.add(60); List<Integer> param1 = new ArrayList<>(); param1.add(2); param1.add(3); param1.add(4); param1.add(2); param1.add(1); param1.add(2); param1.add(5); param1.add(10); param1.add(30); param1.add(50); List<Integer> param2 = new ArrayList<>(); param2.add(1); param2.add(0); param2.add(3); param2.add(4); param2.add(5); param2.add(3); param2.add(8); param2.add(3); param2.add(10); param2.add(1); 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,161
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/ARRAY_RANGE_QUERIES_ELEMENTS_FREQUENCY_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 ARRAY_RANGE_QUERIES_ELEMENTS_FREQUENCY_VALUE{ static int f_gold ( int start , int end , int arr [ ] ) { Map < Integer , Integer > mp = new HashMap < > ( ) ; for ( int i = start ; i <= end ; i ++ ) mp . put ( arr [ i ] , mp . get ( arr [ i ] ) == null ? 1 : mp . get ( arr [ i ] ) + 1 ) ; int count = 0 ; for ( Map . Entry < Integer , Integer > entry : mp . entrySet ( ) ) if ( entry . getKey ( ) == entry . getValue ( ) ) count ++ ; return count ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(0); param0.add(1); param0.add(3); param0.add(10); param0.add(2); param0.add(0); param0.add(14); param0.add(29); param0.add(31); param0.add(21); List<Integer> param1 = new ArrayList<>(); param1.add(31); param1.add(25); param1.add(4); param1.add(15); param1.add(3); param1.add(6); param1.add(18); param1.add(33); param1.add(19); param1.add(32); List<int [ ]> param2 = new ArrayList<>(); param2.add(new int[]{1,2,2,3,3,3,12,13,18,18,26,28,29,36,37,39,40,49,55,57,63,69,69,73,85,86,87,87,89,89,90,91,92,93,93,93,95,99}); param2.add(new int[]{24,-62,2,1,94,56,-22,-70,-22,-34,-92,-18,56,2,60,38,-88,16,-28,30,-30,58,-80,94,6,56}); param2.add(new int[]{0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param2.add(new int[]{84,13,81,40,87,82,50,30,90,80,81,70,14,54,72,93,78,27,61}); param2.add(new int[]{-20,20,34,60,90}); param2.add(new int[]{1,0,0,0,0,0,0,0,0,0}); param2.add(new int[]{11,18,18,19,25,30,42,42,56,58,63,66,67,68,69,75,78,83,83}); param2.add(new int[]{-24,-82,24,-84,94,2,-30,86,58,-56,-96,60,-38,76,94,74,-98,-84,-38,46,4,-84,-90,-28,-50,46,16,28,-14,-82,-64,42,64,-2,-40,96,60,2,-86,32,38,-66}); param2.add(new int[]{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}); param2.add(new int[]{2,91,42,85,97,92,24,39,63,89,31,59,51,89,72,62,26,92,75,4,6,13,20,95,22,30,52,60,37,27,49,15,67,26}); 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,162
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_SUBARRAY_WITH_GIVEN_SUM.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_SUBARRAY_WITH_GIVEN_SUM{ static int f_gold ( int arr [ ] , int n , int sum ) { int curr_sum , i , j ; for ( i = 0 ; i < n ; i ++ ) { curr_sum = arr [ i ] ; for ( j = i + 1 ; j <= n ; j ++ ) { if ( curr_sum == sum ) { int p = j - 1 ; System . out . println ( "Sum found between indexes " + i + " and " + p ) ; return 1 ; } if ( curr_sum > sum || j == n ) break ; curr_sum = curr_sum + arr [ j ] ; } } System . out . println ( "No subarray found" ) ; return 0 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,8,8,10,15,18,19,22,25,26,30,32,35,36,40,41,43,48,53,57,59,63,64,68,71,76,76,77,78,89,96,97}); param0.add(new int[]{-78,16,-16,-10,-2,-38,58,-72,-78,50,-68,-16,-96,82,70,2,-20}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{16,10,55,43,46,74,57,65,86,60,28,6,92}); param0.add(new int[]{-98,-98,-90,-84,-84,-80,-76,-76,-70,-54,-48,-46,-44,-42,-38,-14,-12,-4,6,8,24,28,32,40,40,42,64,84,98}); param0.add(new int[]{0,1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,1}); param0.add(new int[]{2,10,40,45,56,66,66,70,75,83,93,98}); param0.add(new int[]{-20,30,56,-68,54,-6,78,-86,88,-66,76,-66,62,78,22,46,-94,-10,18,16,-36,34,-98,-84,-40,98,82,10,12,54,-88}); param0.add(new int[]{0,0,1,1}); param0.add(new int[]{38,24,12}); List<Integer> param1 = new ArrayList<>(); param1.add(26); param1.add(9); param1.add(9); param1.add(10); param1.add(23); param1.add(12); param1.add(10); param1.add(30); param1.add(2); param1.add(1); List<Integer> param2 = new ArrayList<>(); param2.add(23); param2.add(12); param2.add(11); param2.add(6); param2.add(19); param2.add(8); param2.add(10); param2.add(17); param2.add(2); param2.add(1); 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,163
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_SUM_IARRI_AMONG_ROTATIONS_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 MAXIMUM_SUM_IARRI_AMONG_ROTATIONS_GIVEN_ARRAY{ static int f_gold ( int arr [ ] , int n ) { int res = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { int curr_sum = 0 ; for ( int j = 0 ; j < n ; j ++ ) { int index = ( i + j ) % n ; curr_sum += j * arr [ index ] ; } res = Math . max ( res , curr_sum ) ; } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{11,12,16,26,29,40,54,59,65,70,71,73,78,81,87,87,88,90,95,97}); param0.add(new int[]{-46,-32,54,96,-72,-58,-36,-44,26,-2,-68,42,90,26,-92,-96,88,-42,-18,46,-70,24,0,24,34,34,-52,50,94,-60,64,58}); 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,1,1,1}); param0.add(new int[]{48,2,79,98,28,17,41,47,61,76,82,5,74,4,80,51,22,45,91,75,91,93,42,45,69,98,76,74,83,17,30,88,53,25,35,19,26}); param0.add(new int[]{-88,-84,-82,-74,-44,-34,-32,-20,-20,-14,6,6,10,12,16,24,32,34,38,46,54,54,56,60,82,88,90,94,98}); param0.add(new int[]{0,1,1,1,1,0,1,1,1,1,1,1,1}); param0.add(new int[]{10,14,14,14,19,20,22,26,35,36,40,53,54,55,55,57,57,67,72,72,77,78,83,84,95,96}); param0.add(new int[]{-80,18,-76,48,-52,-38,52,-82,40,-44,-90,86,-86,-36,-32,-2,56,-12,-88,14,-16,8,52,24,46,56,84,-36,84,-60,72,-46,32,-16,-20,68,-86,-62,58,8,78,-52,22,-28,-22,-42,12,-48}); 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[]{20,94,36,2,50,62,84,50,66,75,1,18,41,48,72,61,86,22,54,6,71,46,92,68,59,51,89,31,58,78,82,84}); List<Integer> param1 = new ArrayList<>(); param1.add(11); param1.add(22); param1.add(33); param1.add(20); param1.add(24); param1.add(7); param1.add(16); param1.add(30); param1.add(14); 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,164
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PRODUCT_MAXIMUM_FIRST_ARRAY_MINIMUM_SECOND.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{ public static int f_gold ( int arr1 [ ] , int arr2 [ ] , int n1 , int n2 ) { Arrays . sort ( arr1 ) ; Arrays . sort ( arr2 ) ; return arr1 [ n1 - 1 ] * arr2 [ 0 ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,11,12,12,14,14,15,33,51,51,61,63,68,69,75,83,84,97}); param0.add(new int[]{88,-10,-18,74,56,-36,-86,72,76,26,-36,10,-6,-80,-34,14,-82,74,48,-76,-78,-50,-62,-86,96,22,42,-28,18,6,58,-72,54}); 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,1,1}); param0.add(new int[]{84,2,52,25,38,63,10,44,36,12,67,25,79,36,12,14,14,18,32,8,94,34,9,72,27,44,75,80,28,57,34,67,26,21,53,92,31,87,62}); param0.add(new int[]{-64,-60,-36,-36,-34,-32,-18,-16,-2,6,22,36,42,46,52,54,70,94}); param0.add(new int[]{0,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,0,1,1,1,0,0,1,0,0,0,0,1,1,0,1,1,0,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0}); param0.add(new int[]{24,36,73}); param0.add(new int[]{86,-46,76,66,38,24,-10,-10,-88,-22,54,12,42,20,-6,-44,-26,78,-46,-88,-6,-24,72,-38,26,84,-70,90,56,-4,94,-72,-44,-40,-8,18,4,-72,72,-72,-38}); 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,1}); param0.add(new int[]{41,47,59,85,10,38,4,63,74,71,76,32,54,40,20,38,17,76,87,49,53,73,92,90,36,76,1,65,62,10,93,65}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{4,4,5,12,16,27,28,41,44,60,73,76,77,90,91,92,96,96}); param1.add(new int[]{24,-26,38,28,94,64,-36,42,62,-50,-12,-18,-72,-76,26,-4,44,-98,32,-48,54,-66,-84,16,-12,-30,-58,42,-88,-40,66,-66,30}); param1.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,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{92,20,7,22,79,50,27,19,2,58,93,19,60,45,16,50,87,31,45,8,89,39,61,76,48,92,22,18,19,35,54,32,81,57,22,29,63,83,20}); param1.add(new int[]{-96,-92,-64,-44,-22,-22,-22,-20,6,8,14,16,24,40,46,54,76,78}); param1.add(new int[]{0,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0,1,0,1,0,0,1,1,1,1,0,1}); param1.add(new int[]{5,41,60}); param1.add(new int[]{-30,-38,58,-6,-2,-18,34,24,-52,56,-80,-82,20,64,54,-96,70,-78,78,54,6,-4,34,0,90,-74,-50,-40,16,-48,-4,78,80,-98,-12,-64,94,-42,-22,-34,96}); 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}); param1.add(new int[]{62,30,71,1,83,88,62,50,88,80,22,98,62,43,84,21,23,89,78,5,36,21,17,30,54,88,66,48,83,12,4,50}); List<Integer> param2 = new ArrayList<>(); param2.add(10); param2.add(20); param2.add(40); param2.add(32); param2.add(11); param2.add(37); param2.add(2); param2.add(20); param2.add(38); param2.add(26); List<Integer> param3 = new ArrayList<>(); param3.add(15); param3.add(27); param3.add(39); param3.add(19); param3.add(10); param3.add(44); param3.add(2); param3.add(28); param3.add(35); param3.add(22); 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,165
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PRINT_MAXIMUM_SHORTEST_DISTANCE.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 PRINT_MAXIMUM_SHORTEST_DISTANCE{ static int f_gold ( int a [ ] , int n , int k ) { HashMap < Integer , Integer > b = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int x = a [ i ] ; int d = Math . min ( 1 + i , n - i ) ; if ( ! b . containsKey ( x ) ) b . put ( x , d ) ; else { b . put ( x , Math . min ( d , b . get ( x ) ) ) ; } } int ans = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { int x = a [ i ] ; if ( x != k - x && b . containsKey ( k - x ) ) ans = Math . min ( Math . max ( b . get ( x ) , b . get ( k - x ) ) , ans ) ; } return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,27,66,89,96,96}); param0.add(new int[]{84,-38,-56,-20,-98,-40,-16,22,20,98,-56,-32,-44,30,-58,26,-44,-32,50,46,92}); param0.add(new int[]{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[]{20,71,66,58,74,2,63,13,1,36,28,83,24,20,85,30,59,56,8,97,58,28,28,42}); param0.add(new int[]{-94,-88,-86,-68,-66,-64,-28,-12,4,18,22,28,32,34,34,40,44,46,60,68,72,78,80,84,88,96}); param0.add(new int[]{0,0,0,0,0,1,1,1,1,0,0,0,1,1,1}); param0.add(new int[]{8,13,54,59,61,69,89,90,92}); param0.add(new int[]{-58,50,-74,-8,-50,90,90,-2,-22,8,-76,16,4,56,94,36,28,-42,80,-88,88,52,74,40,12,-72,-50,50,88,-54,32,-24,-48,-66,-86,40,-6,14,10,-88,56,80,-34}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{2,60,66,39,18,60,37,75,3,64,24,16,72,95,96,44,23,58,58,33,24,96}); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(13); param1.add(23); param1.add(23); param1.add(16); param1.add(8); param1.add(4); param1.add(27); param1.add(9); param1.add(21); List<Integer> param2 = new ArrayList<>(); param2.add(4); param2.add(11); param2.add(13); param2.add(17); param2.add(15); param2.add(13); param2.add(8); param2.add(42); param2.add(12); param2.add(17); 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,166
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NUMBER_NON_NEGATIVE_INTEGRAL_SOLUTIONS_B_C_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 NUMBER_NON_NEGATIVE_INTEGRAL_SOLUTIONS_B_C_N_1{ static int f_gold ( int n ) { return ( ( n + 1 ) * ( n + 2 ) ) / 2 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(41); param0.add(72); param0.add(54); param0.add(75); param0.add(87); param0.add(41); param0.add(78); param0.add(80); param0.add(46); param0.add(9); 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,167
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/BASIC_AND_EXTENDED_EUCLIDEAN_ALGORITHMS_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 BASIC_AND_EXTENDED_EUCLIDEAN_ALGORITHMS_1{ public static int f_gold ( int a , int b , int x , int y ) { if ( a == 0 ) { x = 0 ; y = 1 ; return b ; } int x1 = 1 , y1 = 1 ; int gcd = f_gold ( b % a , a , x1 , y1 ) ; x = y1 - ( b / a ) * x1 ; y = x1 ; return gcd ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(44); param0.add(33); param0.add(39); param0.add(52); param0.add(64); param0.add(45); param0.add(53); param0.add(86); param0.add(57); param0.add(11); List<Integer> param1 = new ArrayList<>(); param1.add(17); param1.add(81); param1.add(77); param1.add(96); param1.add(48); param1.add(32); param1.add(88); param1.add(19); param1.add(67); param1.add(86); List<Integer> param2 = new ArrayList<>(); param2.add(10); param2.add(67); param2.add(21); param2.add(23); param2.add(17); param2.add(89); param2.add(24); param2.add(29); param2.add(30); param2.add(96); List<Integer> param3 = new ArrayList<>(); param3.add(65); param3.add(20); param3.add(34); param3.add(97); param3.add(33); param3.add(3); param3.add(74); param3.add(21); param3.add(32); param3.add(81); 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,168
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DYNAMIC_PROGRAMMING_SET_17_PALINDROME_PARTITIONING.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_17_PALINDROME_PARTITIONING{ static int f_gold ( String str ) { int n = str . length ( ) ; int [ ] [ ] C = new int [ n ] [ n ] ; boolean [ ] [ ] P = new boolean [ n ] [ n ] ; int i , j , k , L ; for ( i = 0 ; i < n ; i ++ ) { P [ i ] [ i ] = true ; C [ i ] [ i ] = 0 ; } for ( L = 2 ; L <= n ; L ++ ) { for ( i = 0 ; i < n - L + 1 ; i ++ ) { j = i + L - 1 ; if ( L == 2 ) P [ i ] [ j ] = ( str . charAt ( i ) == str . charAt ( j ) ) ; else P [ i ] [ j ] = ( str . charAt ( i ) == str . charAt ( j ) ) && P [ i + 1 ] [ j - 1 ] ; if ( P [ i ] [ j ] == true ) C [ i ] [ j ] = 0 ; else { C [ i ] [ j ] = Integer . MAX_VALUE ; for ( k = i ; k <= j - 1 ; k ++ ) C [ i ] [ j ] = Integer . min ( C [ i ] [ j ] , C [ i ] [ k ] + C [ k + 1 ] [ j ] + 1 ) ; } } } return C [ 0 ] [ n - 1 ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("ydYdV"); param0.add("4446057"); param0.add("0111"); param0.add("keEj"); param0.add("642861576557"); param0.add("11111000101"); param0.add("ram"); param0.add("09773261"); param0.add("1"); param0.add("AVBEKClFdj"); 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,169
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_WORDS_APPEAR_EXACTLY_TWO_TIMES_ARRAY_WORDS.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_WORDS_APPEAR_EXACTLY_TWO_TIMES_ARRAY_WORDS{ static int f_gold ( String str [ ] , int n ) { HashMap < String , Integer > m = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( m . containsKey ( str [ i ] ) ) { int get = m . get ( str [ i ] ) ; m . put ( str [ i ] , get + 1 ) ; } else { m . put ( str [ i ] , 1 ) ; } } int res = 0 ; for ( Map . Entry < String , Integer > it : m . entrySet ( ) ) { if ( it . getValue ( ) == 2 ) res ++ ; } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String [ ]> param0 = new ArrayList<>(); param0.add(new String[]{"hate", "love", "peace", "love", "peace", "hate", "love", "peace", "love", "peace"}); param0.add(new String[]{"16","946613197072","532052","42780833","511552","1241934","4","3444540","47487223670074","23753","14158","4","95420017116714","16","0845","689000748","976403809728","8922","487784120896","329","611","59101","611","2131059721","53952148295020","445948587","3905249775372","4683180907","7169093","01413852276627","63","5864","40862536595","2280304422294","930028582","05","33447"}); param0.add(new String[]{"001000100000","1010","01011","11","011","1010"}); param0.add(new String[]{"Om", "Om", "Shankar", "Tripathi", "Tom", "Jerry", "Jerry"}); param0.add(new String[]{"2","644","2","42484637089","81578664","0778"}); param0.add(new String[]{"001000101","011010","1","101010011","011010","01","10111000101","0","1","00101101","0","0"}); param0.add(new String[]{"kl","p sH","PwCPMPu","tQoIgPpk","wtsNP WjS","kl ","TXsFWgU","kl","AD","NjjTyFGwNWZcB","jpFQslbGbDI","cEpGAgvpk","EMaDkMOm","YZuNZgfwDIjG","k","hJx jHmGpQYwQP","CIETe","RH","Pj","h","DInR","AEsqOvliQtz","NwzHTALTt LS","LwLR","WvDCzlQF","soJb","WktoldCbWyTO","pIdRJxY","BmpWxjOwTXkjjL","zmtCiQ","g","yBmDW","QhaBZrQnOJaAJ","u","MGTwCKve","UxYQrONag","xsGSz","dqNPTT","U W","ygJKvCEKDClby","M","yXJQHxjyDQDLkT","oJmaREOEk YA","zUwiwhSMdiC","jYgZEktcdgLD","fwyTAAW","GENttdzeGY "}); param0.add(new String[]{"938","074209","0949093096","218622476","71692175","0714","81217924991","74016430795374","52213147","338","939","798161500954","90528060774015","68715","75810","43450","8017","0193164","5945740","212","4589289","2912211026","0","49","8230114","0733435391403","5429","10070"}); param0.add(new String[]{"00","0","00","0101111010100","110"}); param0.add(new String[]{"g","h","ok","h","ok","sqozuC","ut","ZwRcG","ok","MR","jHrWyy","qaJlrokgRHuZH","LjPNzDUKszYmCq","g","ZGjLfMnyAGL","kEZoSxOMEWSFpw","IFtqNaDVnG","iJoJXl","vjrQMyWor","FTEHZqbHGlmHph","QeSdzm","nPostKHkigyJt","mOSekk"}); List<Integer> param1 = new ArrayList<>(); param1.add(10); param1.add(32); param1.add(6); param1.add(7); param1.add(6); param1.add(12); param1.add(43); param1.add(20); param1.add(4); 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,170
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NEXT_POWER_OF_2_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 NEXT_POWER_OF_2_2{ static int f_gold ( int n ) { n -- ; n |= n >> 1 ; n |= n >> 2 ; n |= n >> 4 ; n |= n >> 8 ; n |= n >> 16 ; n ++ ; return n ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(63); param0.add(78); param0.add(13); param0.add(5); param0.add(34); param0.add(69); param0.add(63); param0.add(78); param0.add(80); param0.add(19); 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,171
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_MAXIMUM_DOT_PRODUCT_TWO_ARRAYS_INSERTION_0S.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_DOT_PRODUCT_TWO_ARRAYS_INSERTION_0S{ static int f_gold ( int A [ ] , int B [ ] , int m , int n ) { int dp [ ] [ ] = new int [ n + 1 ] [ m + 1 ] ; for ( int [ ] row : dp ) Arrays . fill ( row , 0 ) ; for ( int i = 1 ; i <= n ; i ++ ) for ( int j = i ; j <= m ; j ++ ) dp [ i ] [ j ] = Math . max ( ( dp [ i - 1 ] [ j - 1 ] + ( A [ j - 1 ] * B [ i - 1 ] ) ) , dp [ i ] [ j - 1 ] ) ; return dp [ n ] [ m ] ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{7,9,22,68}); param0.add(new int[]{24,40,98,58,-24,24,76,48,-92,-16,-46,-48,-70,88,66,2,44,36,34,34,46,90,-80,-24,-58,68,72,-20,-62,-40}); 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,1,1,1,1,1,1,1,1}); param0.add(new int[]{32,15,41,41,4,42,22,33,33,11,68,5,41,80,39,15,36,75,41,11,25,40,50,19,39,12,75,28,52,20,63,5,27,53,19,62,98,72,10,90,74,93,52,81,91,65,90,93}); param0.add(new int[]{-94,-76,-68,-50,-28,-20,18,24,30,54,74,84,98}); param0.add(new int[]{1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,0,0,1,1,0,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,1,1,1,0,1,0}); param0.add(new int[]{14,27,43,49}); param0.add(new int[]{78,-26,-12,38,-90}); param0.add(new int[]{0,1,1,1}); param0.add(new int[]{12,69,57,7,52,14,15,83,67,57,15,86,81,43,1,64,45,68,30,23,14,70,13,51,23,33,98,68,24,43,12,82,46}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{14,22,54,58}); param1.add(new int[]{30,-88,6,-26,-76,14,-80,-30,-58,76,40,-28,-54,38,-60,-60,88,-80,-22,90,50,-48,68,-26,26,-2,68,-16,88,-72}); param1.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}); param1.add(new int[]{80,18,9,29,62,89,4,40,47,15,35,82,22,97,63,54,7,58,64,73,54,79,21,21,20,19,56,42,6,97,7,34,55,35,57,86,73,88,20,29,48,52,8,77,2,12,6,47}); param1.add(new int[]{-88,-80,-78,-68,-44,-38,42,50,62,68,70,80,92}); param1.add(new int[]{1,0,0,1,1,1,1,1,1,0,0,1,1,0,1,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,0,1,0,1,0,1,0,1}); param1.add(new int[]{51,59,76,83}); param1.add(new int[]{14,50,-6,-38,80}); param1.add(new int[]{0,0,0,1}); param1.add(new int[]{12,48,57,40,47,36,22,50,68,98,77,78,39,55,87,75,65,27,33,27,70,34,67,71,84,33,7,61,3,9,67,92,60}); List<Integer> param2 = new ArrayList<>(); param2.add(3); param2.add(22); param2.add(22); param2.add(30); param2.add(11); param2.add(21); param2.add(2); param2.add(3); param2.add(3); param2.add(17); List<Integer> param3 = new ArrayList<>(); param3.add(2); param3.add(22); param3.add(19); param3.add(25); param3.add(8); param3.add(33); param3.add(2); param3.add(2); param3.add(2); param3.add(32); 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,172
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUBARRAYS_DISTINCT_ELEMENTS.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 SUBARRAYS_DISTINCT_ELEMENTS{ public static int f_gold ( int [ ] arr , int n ) { Set < Integer > s = new HashSet < > ( ) ; int j = 0 , ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { while ( j < n && ! s . contains ( arr [ j ] ) ) { s . add ( arr [ i ] ) ; j ++ ; } ans += ( ( j - i ) * ( j - i + 1 ) ) / 2 ; s . remove ( 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,4,5,6,12,15,16,17,20,20,22,24,24,27,28,34,37,39,39,41,43,49,49,51,55,62,63,67,71,74,74,74,77,84,84,89,89,97,99}); param0.add(new int[]{-8,54,-22,18,20,44,0,54,90,-4,4,40,-74,-16}); 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}); param0.add(new int[]{36,71,36,58,38,90,17}); param0.add(new int[]{-90,-32,-16,18,38,82}); param0.add(new int[]{1,0,1}); param0.add(new int[]{3,11,21,25,28,28,38,42,48,53,55,55,55,58,71,75,79,80,80,94,96,99}); param0.add(new int[]{-16,-52,-4,-46,54,0,8,-64,-82,-10,-62,-10,58,44,-28,86,-24,16,44,22,-28,-42,-52,8,76,-44,-34,2,88,-88,-14,-84,-36,-68,76,20,20,-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,1,1,1,1}); param0.add(new int[]{19,13,61,32,92,90,12,81,52}); List<Integer> param1 = new ArrayList<>(); param1.add(24); param1.add(13); param1.add(28); param1.add(4); param1.add(5); param1.add(2); param1.add(20); param1.add(35); param1.add(27); 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,173
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/PROGRAM_FOR_FACTORIAL_OF_A_NUMBER_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 PROGRAM_FOR_FACTORIAL_OF_A_NUMBER_2{ static int f_gold ( int n ) { return ( n == 1 || n == 0 ) ? 1 : n * f_gold ( n - 1 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(24); param0.add(46); param0.add(47); param0.add(41); param0.add(98); param0.add(69); param0.add(83); param0.add(2); param0.add(12); param0.add(11); 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,174
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SQUARE_ROOT_OF_AN_INTEGER_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 SQUARE_ROOT_OF_AN_INTEGER_1{ public static int f_gold ( int x ) { if ( x == 0 || x == 1 ) return x ; int start = 1 , end = x , ans = 0 ; while ( start <= end ) { int mid = ( start + end ) / 2 ; if ( mid * mid == x ) return mid ; if ( mid * mid < x ) { start = mid + 1 ; ans = mid ; } else end = mid - 1 ; } return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(40); param0.add(10); param0.add(46); param0.add(54); param0.add(1); param0.add(67); param0.add(64); param0.add(10); param0.add(75); param0.add(11); 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,175
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_FAI_AJ_PAIRS_ARRAY_N_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 SUM_FAI_AJ_PAIRS_ARRAY_N_INTEGERS{ public static int f_gold ( int a [ ] , int n ) { Map < Integer , Integer > cnt = new HashMap < Integer , Integer > ( ) ; int ans = 0 , pre_sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { ans += ( i * a [ i ] ) - pre_sum ; pre_sum += a [ i ] ; if ( cnt . containsKey ( a [ i ] - 1 ) ) ans -= cnt . get ( a [ i ] - 1 ) ; if ( cnt . containsKey ( a [ i ] + 1 ) ) ans += cnt . get ( a [ i ] + 1 ) ; if ( cnt . containsKey ( a [ i ] ) ) { cnt . put ( a [ i ] , cnt . get ( a [ i ] ) + 1 ) ; } else { cnt . put ( a [ i ] , 1 ) ; } } return ans ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,8,12,19,23,23,26,39,54,56,57,57,73,78,83,83,89,91}); param0.add(new int[]{62,-34,10,-28,-42,-12,4,20,-20,-84,-76,-16,-44,26,-78,-40,50,-10,-56,76,-88,24,64,10,64,-8,-68,-42,26,24,62,36,-68,8,-68,-2,8,38,-18}); 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[]{23,14,44,29,93,56,22,29,97,71,43,72,74,8,92,40,18,34,78,79,93,63,79,44,35,72,88,83,40,89,66,66,54,56,44,62,72,94,79,79,24,55,72,37,27,55,16,58,83}); param0.add(new int[]{-96,-94,-90,-90,-86,-82,-80,-80,-58,-48,-40,-32,-32,-20,-20,-20,-12,-12,-6,-6,-2,0,4,16,16,16,42,48,58,64,68,76,76,76,78,80,82,88,88,88,92,94,96,98}); param0.add(new int[]{1,1,1,1,0,0,0,1,1,0,0,1,0,0,1,1,0,0,0,0,1,1,0,0,1,1,1,0,1,0,0,0,1,1,1,0,0,1,1,1,1}); param0.add(new int[]{3,4,4,8,10,10,11,15,19,19,20,24,25,25,27,30,41,43,44,45,47,55,59,59,61,63,63,67,67,69,72,73,75,77,77,78,81,81,83,84,92,94,99}); param0.add(new int[]{94,-86,94,54,-52,86,68,64,98,54,-14,-60,-60,-92,80,-16,28,16,-74,68,32,-54,58,-16,-2,-52,-92,-36,96,-18,14,76,16}); param0.add(new int[]{0,0,0,0,1,1,1,1}); param0.add(new int[]{10,28,63,2,78,12,51,82,89,65,99}); List<Integer> param1 = new ArrayList<>(); param1.add(15); param1.add(20); param1.add(18); param1.add(25); param1.add(27); param1.add(34); param1.add(31); param1.add(26); param1.add(7); 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,176
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DIVISIBILITY_9_USING_BITWISE_OPERATORS.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 DIVISIBILITY_9_USING_BITWISE_OPERATORS{ static boolean f_gold ( int n ) { if ( n == 0 || n == 9 ) return true ; if ( n < 9 ) return false ; return f_gold ( ( int ) ( n >> 3 ) - ( int ) ( n & 7 ) ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(96); param0.add(85); param0.add(54); param0.add(14); param0.add(47); param0.add(11); param0.add(49); param0.add(99); param0.add(28); param0.add(82); 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,177
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/LEXICOGRAPHICAL_CONCATENATION_SUBSTRINGS_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 LEXICOGRAPHICAL_CONCATENATION_SUBSTRINGS_STRING{ static String f_gold ( String s ) { int n = s . length ( ) ; int sub_count = n * ( n + 1 ) / 2 ; String [ ] arr = new String [ sub_count ] ; int index = 0 ; for ( int i = 0 ; i < n ; i ++ ) for ( int len = 1 ; len <= n - i ; len ++ ) { arr [ index ++ ] = s . substring ( i , i + len ) ; } Arrays . sort ( arr ) ; String res = "" ; for ( int i = 0 ; i < sub_count ; i ++ ) res += arr [ i ] ; return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("sqGOi"); param0.add("848580"); param0.add("01001110011001"); param0.add("ZhWXUKmeiI"); param0.add("0917296541285"); param0.add("01101001111100"); param0.add("tjP kR"); param0.add("999907"); param0.add("011100"); param0.add("qJPHNSJOUj"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)).equals(f_gold(param0.get(i)))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
1,178
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/WRITE_A_C_PROGRAM_TO_CALCULATE_POWXN.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_CALCULATE_POWXN{ static int f_gold ( int x , int y ) { if ( y == 0 ) return 1 ; else if ( y % 2 == 0 ) return f_gold ( x , y / 2 ) * f_gold ( x , y / 2 ) ; else return x * f_gold ( x , y / 2 ) * f_gold ( x , y / 2 ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(46); param0.add(99); param0.add(30); param0.add(1); param0.add(26); param0.add(1); param0.add(27); param0.add(10); param0.add(26); param0.add(29); List<Integer> param1 = new ArrayList<>(); param1.add(92); param1.add(87); param1.add(32); param1.add(86); param1.add(81); param1.add(49); param1.add(46); param1.add(52); param1.add(38); param1.add(80); 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,179
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/NUMBER_SUBSEQUENCES_FORM_AI_BJ_CK.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_FORM_AI_BJ_CK{ static int f_gold ( String s ) { int aCount = 0 ; int bCount = 0 ; int cCount = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == 'a' ) aCount = ( 1 + 2 * aCount ) ; else if ( s . charAt ( i ) == 'b' ) bCount = ( aCount + 2 * bCount ) ; else if ( s . charAt ( i ) == 'c' ) cCount = ( bCount + 2 * cCount ) ; } return cCount ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add(""); param0.add("abbc"); param0.add("abcabc"); param0.add("agsdbkfdc "); param0.add("ababab"); param0.add("aaaaaaa"); param0.add("aabaaabcc"); param0.add("19"); param0.add("1001100"); param0.add("DtAnuQbU"); 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,180
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/LONGEST_COMMON_SUBSTRING.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_SUBSTRING{ static int f_gold ( char X [ ] , char Y [ ] , int m , int n ) { int LCStuff [ ] [ ] = new int [ m + 1 ] [ n + 1 ] ; int result = 0 ; for ( int i = 0 ; i <= m ; i ++ ) { for ( int j = 0 ; j <= n ; j ++ ) { if ( i == 0 || j == 0 ) LCStuff [ i ] [ j ] = 0 ; else if ( X [ i - 1 ] == Y [ j - 1 ] ) { LCStuff [ i ] [ j ] = LCStuff [ i - 1 ] [ j - 1 ] + 1 ; result = Integer . max ( result , LCStuff [ i ] [ j ] ) ; } else LCStuff [ i ] [ j ] = 0 ; } } return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<char [ ]> param0 = new ArrayList<>(); param0.add(new char[]{'A','D','E','E','L','L','T','r','x'}); param0.add(new char[]{'9','3','4','8','7','6','3','8','3','3','5','3','5','4','2','5','5','3','6','2','1','7','4','2','7','3','2','1','3','7','6','5','0','6','3','8','5','1','7','9','2','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','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 char[]{'W','X','P','u','s','k','O','y','Q','i','t','z','F','f','s','N','K','m','I','M','g','e','E','P','b','Y','c','O',' ','G','F','x'}); param0.add(new char[]{'0','1','2','4','5','7','7','7','8','8','9','9','9'}); param0.add(new char[]{'0','0','1'}); param0.add(new char[]{'A','C','F','G','G','H','I','K','K','N','O','Q','R','V','V','W','Y','a','a','c','d','k','k','m','o','p','t','u','y','y','y','z'}); param0.add(new char[]{'0','0','0','2','8','3','5','1','0','7','7','9','9','4','8','9','5'}); param0.add(new char[]{'0','0','0','0','0','0','0','0','1','1','1'}); param0.add(new char[]{'B','o','R','k','Y','M','g','b','h','A','i','X','p','i','j','f','V','n','d','P','T','U','f','G','M','W','g','a','C','E','v','C',' '}); List<char [ ]> param1 = new ArrayList<>(); param1.add(new char[]{'D','F','H','O','g','o','u','v','w'}); param1.add(new char[]{'5','5','3','7','8','0','9','8','5','8','5','1','4','4','0','2','9','2','3','1','1','3','6','1','2','0','5','4','3','7','5','5','8','1','1','4','8','1','7','5','5','4'}); param1.add(new char[]{'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','1'}); param1.add(new char[]{'e','R','P','W','d','a','A','j','H','v','T','w','x','I','d','o','z','K','B','M','J','L','a',' ','T','L','V','t','M','U','z','R'}); param1.add(new char[]{'0','0','2','2','2','3','4','6','6','7','8','9','9'}); param1.add(new char[]{'0','0','1'}); param1.add(new char[]{' ',' ','B','C','C','C','D','E','I','J','M','N','P','T','U','U','V','V','W','W','Y','b','c','e','i','o','p','r','t','y','y','z'}); param1.add(new char[]{'8','5','8','7','1','4','0','2','2','7','2','4','0','8','3','8','7'}); param1.add(new char[]{'0','0','0','0','0','0','1','1','1','1','1'}); param1.add(new char[]{'F','h','G','H','Q','Q','K','g','k','u','l','c','c','o','n','G','i','Z','d','b','c','b','v','t','S','t','P','A','K','g','G','i','m'}); List<Integer> param2 = new ArrayList<>(); param2.add(4); param2.add(41); param2.add(35); param2.add(31); param2.add(12); param2.add(1); param2.add(21); param2.add(13); param2.add(9); param2.add(19); List<Integer> param3 = new ArrayList<>(); param3.add(4); param3.add(37); param3.add(29); param3.add(18); param3.add(8); param3.add(1); param3.add(23); param3.add(12); param3.add(9); param3.add(32); 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,181
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CEILING_IN_A_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 CEILING_IN_A_SORTED_ARRAY_1{ static int f_gold ( int arr [ ] , int low , int high , int x ) { int mid ; if ( x <= arr [ low ] ) return low ; if ( x > arr [ high ] ) return - 1 ; mid = ( low + high ) / 2 ; if ( arr [ mid ] == x ) return mid ; else if ( arr [ mid ] < x ) { if ( mid + 1 <= high && x <= arr [ mid + 1 ] ) return mid + 1 ; else return f_gold ( arr , mid + 1 , high , x ) ; } else { if ( mid - 1 >= low && x > arr [ mid - 1 ] ) return mid ; else return f_gold ( arr , low , mid - 1 , x ) ; } } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,6,13,16,23,24,24,27,30,32,34,34,55,56,56,63,66,81,83,96}); param0.add(new int[]{-28,-96,48,22,-12,72,48,-70,-96,-84,-62,22,18,-92,-74,14,28,52,64,72,16,-76,46}); param0.add(new int[]{0,1}); param0.add(new int[]{51,98,25,10,43,91,33,25,85,51,94,6,35,48,11,97,67,21,50,9,11,51,86,61,22,88,89,11}); param0.add(new int[]{-94,-92,-88,-74,-52,-50,-48,-44,-40,-36,-32,-26,20,22,30,32,46,56,56,60,62,64,80,84,86,94,96,96}); param0.add(new int[]{1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0}); param0.add(new int[]{4,5,5,13,26,40,46,51,58,60,64,66,68,69,71,74,78,81,83,88,88,90,98,99}); param0.add(new int[]{92,6,-54,84,-10,32,50,40,-38,64,-64,-10,70,-68,-6,-16,68,34,-66,-82,84,98,50,82,78,4,34,-34,78,64,32,58,-94,40,50,0,-92,-36,10,-54,58,-78,-88,32,6}); 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,1}); param0.add(new int[]{80,67,30,35,9}); List<Integer> param1 = new ArrayList<>(); param1.add(13); param1.add(11); param1.add(1); param1.add(20); param1.add(20); param1.add(15); param1.add(12); param1.add(23); param1.add(24); param1.add(2); List<Integer> param2 = new ArrayList<>(); param2.add(11); param2.add(18); param2.add(1); param2.add(20); param2.add(15); param2.add(17); param2.add(17); param2.add(28); param2.add(17); param2.add(3); List<Integer> param3 = new ArrayList<>(); param3.add(18); param3.add(21); param3.add(1); param3.add(15); param3.add(15); param3.add(22); param3.add(14); param3.add(28); param3.add(22); 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,182
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_EQULIBRIUM_SUM_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_EQULIBRIUM_SUM_ARRAY{ static int f_gold ( int [ ] arr , int n ) { int res = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { int prefix_sum = arr [ i ] ; for ( int j = 0 ; j < i ; j ++ ) prefix_sum += arr [ j ] ; int suffix_sum = arr [ i ] ; for ( int j = n - 1 ; j > i ; j -- ) suffix_sum += arr [ j ] ; if ( prefix_sum == suffix_sum ) res = Math . max ( res , prefix_sum ) ; } return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,3,9,19,22,27,32,41,45,63,66,67,81,91}); param0.add(new int[]{-64,-2,68,-48,22,-14,-98}); 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}); param0.add(new int[]{86,79,23,55,4,22,37,1,72,22,82,62,96,47}); param0.add(new int[]{-96,-96,-96,-96,-92,-82,-72,-72,-62,-58,-52,-48,-44,-44,-40,-34,-28,-26,-26,0,0,2,4,4,12,12,18,34,36,40,48,48,54,60,66,66,72,76,78,82,82,96,98}); param0.add(new int[]{0,1,0,1,1,0,0,0,1,1,1,0,0,1,0,0,1,1,0,0,0,0,1,1,0,1,0,0,0,0,0,1,1,1,1,1,0,0,1,1,0,0,0,1,0}); param0.add(new int[]{2,3,7,13,20,24,39,49,53,58,72,80,90,99}); param0.add(new int[]{-48,44,60,-30,8,20,70,-50,80,-2,-28,-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[]{64,13,18,3,22,29,51,45,21,13,47,15,17,34,60,99,30,54,16,47,13,49,60,66,28,57,85,66,65,7,62,29,9}); List<Integer> param1 = new ArrayList<>(); param1.add(13); param1.add(4); param1.add(19); param1.add(8); param1.add(33); param1.add(38); param1.add(11); param1.add(11); param1.add(16); 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,183
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_FIBONACCI_NUMBERS_GIVEN_RANGE_LOG_TIME.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_FIBONACCI_NUMBERS_GIVEN_RANGE_LOG_TIME{ static int f_gold ( int low , int high ) { int f1 = 0 , f2 = 1 , f3 = 1 ; int result = 0 ; while ( f1 <= high ) { if ( f1 >= low ) result ++ ; f1 = f2 ; f2 = f3 ; f3 = f1 + f2 ; } return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(76); param0.add(96); param0.add(19); param0.add(36); param0.add(60); param0.add(20); param0.add(76); param0.add(63); param0.add(2); param0.add(41); List<Integer> param1 = new ArrayList<>(); param1.add(43); param1.add(52); param1.add(79); param1.add(2); param1.add(11); param1.add(15); param1.add(4); param1.add(93); param1.add(25); param1.add(39); 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,184
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_LENGTH_SUBARRAY_SUM_GREATER_GIVEN_VALUE_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 MINIMUM_LENGTH_SUBARRAY_SUM_GREATER_GIVEN_VALUE_1{ static int f_gold ( int arr [ ] , int n , int x ) { int curr_sum = 0 , min_len = n + 1 ; int start = 0 , end = 0 ; while ( end < n ) { while ( curr_sum <= x && end < n ) { if ( curr_sum <= 0 && x > 0 ) { start = end ; curr_sum = 0 ; } curr_sum += arr [ end ++ ] ; } while ( curr_sum > x && start < n ) { if ( end - start < min_len ) min_len = end - start ; curr_sum -= arr [ start ++ ] ; } } return min_len ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,4,5,10,14,15,16,20,23,28,31,35,36,36,43,48,49,55,57,57,58,61,64,64,68,70,70,73,74,76,76,77,81,81,82,87,89,92,99}); param0.add(new int[]{66,-20,12,-48,22,28,40,-30,-6,-96,10,-88,40}); 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,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{28,19,38,31,17,27,60,35,19,47,34,51,3,95,33,29,84,46,74,87}); param0.add(new int[]{-48,-2}); param0.add(new int[]{1,1,0,1,1,1,1,0,1,0,1,1,0,1,1,0,1,1,0,1,1,1}); param0.add(new int[]{1,4,4,6,8,10,12,12,13,15,18,20,21,23,25,28,28,33,33,35,35,36,37,38,42,44,63,63,65,65,65,66,70,74,77,78,80,80,84,87,87,89,92,93,94,97,98,99}); param0.add(new int[]{-82,-12,-40,58,22,-76,-94,-28,42,36,64}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{76,65,96,76,1,91,22,29,95,21,73,68,30,52,73,86,52,66,67,37,76,53,68,6,95,81,98,42,63,38,92,78,59,86,10,38,18,15,52,62,16,66}); List<Integer> param1 = new ArrayList<>(); param1.add(33); param1.add(11); param1.add(42); param1.add(15); param1.add(1); param1.add(12); param1.add(42); param1.add(10); param1.add(10); param1.add(23); List<Integer> param2 = new ArrayList<>(); param2.add(28); param2.add(12); param2.add(23); param2.add(15); param2.add(1); param2.add(15); param2.add(27); param2.add(6); param2.add(14); param2.add(35); 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,185
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/DISTRIBUTING_ITEMS_PERSON_CANNOT_TAKE_TWO_ITEMS_TYPE.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 DISTRIBUTING_ITEMS_PERSON_CANNOT_TAKE_TWO_ITEMS_TYPE{ static boolean f_gold ( int [ ] arr , int n , int k ) { int count ; for ( int i = 0 ; i < n ; i ++ ) { count = 0 ; for ( int j = 0 ; j < n ; j ++ ) { if ( arr [ j ] == arr [ i ] ) count ++ ; if ( count > 2 * k ) 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,1,2,3,1}); param0.add(new int[]{2,3,3,5,3,3}); param0.add(new int[]{0,0,1,1,1}); param0.add(new int[]{7,60,78,91,80,75,85,21,41,63,1,84,69,13,94,25,54,54,52,68,53,35,17,37,98,27,2,31}); param0.add(new int[]{-96,-94,-82,-80,-78,-66,-36,-24,-18,-12,-2,-2,6,8,10,12,36,38,42,58,64,68,82,84,86,88,94}); param0.add(new int[]{0,1,1,1,0,0,0,0,1,0,0,0,1,0,0,1,1,1,1,1,1,0,0,0,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,0,0,1,1,1,0}); param0.add(new int[]{16,19,25,25,32,37,48,59,60,60,71,74,77,81,91,94}); param0.add(new int[]{-62,-94,72,-22,86,-80,64,98,-82,-50,12,-4,56,46,-80,2,-86,-44,-26,68,-94,-82,74,26,94,40,50,-40,-42,-10}); param0.add(new int[]{0,0,0,0,0,1,1,1}); param0.add(new int[]{83,57,2,47,70,22,49,51,25,57,32,7,8,99,6,86,24,79,42,43,1,24,68,11,24,12,43,40,14,45,11,46,12,80,66}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(6); param1.add(2); param1.add(24); param1.add(24); param1.add(34); param1.add(10); param1.add(20); param1.add(5); param1.add(21); List<Integer> param2 = new ArrayList<>(); param2.add(2); param2.add(2); param2.add(1); param2.add(2); param2.add(3); param2.add(2); param2.add(8); param2.add(4); param2.add(2); param2.add(33); 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,186
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_THE_FIRST_MISSING_NUMBER.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_FIRST_MISSING_NUMBER{ static int f_gold ( int array [ ] , int start , int end ) { if ( start > end ) return end + 1 ; if ( start != array [ start ] ) return start ; int mid = ( start + end ) / 2 ; if ( array [ mid ] == mid ) return f_gold ( array , mid + 1 , end ) ; return f_gold ( array , start , mid ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,6,7,9,11,14,18,30,30,32,32,34,37,44,45,45,48,48,48,52,58,60,63,67,69,69,81,83,87,89,97,99}); param0.add(new int[]{88,-62,16,80,66,78,88,38,52,-96,48,98,96,-62,18,34,-58,30,-10,26,-98,48,-96,4,92,36,36,-36,-32,-70,62,-58,-58,-84,86,-98}); 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[]{79,99,79,85,61,58,62,61,39,87,39,74,36,70,30,43,20,52,54,50,81,98,42}); param0.add(new int[]{-98,-72,-46,-44,-42,-40,-16,-4,62,70,74}); param0.add(new int[]{1,1,0,1,0,0,0,0,1,1,0,1,0,1,1,1,1,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0}); param0.add(new int[]{58}); param0.add(new int[]{4,-84,-42,12,-50,42,-36,-38,-36,98,-2,20,6,-96,-78,24,34,88,0,74,0,-8,-86,-68,-42,98,-26,86,-70,-32,-82,78,46,58,84,4,-60,-90,-52,-78}); param0.add(new int[]{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}); List<Integer> param1 = new ArrayList<>(); param1.add(24); param1.add(19); param1.add(26); param1.add(20); param1.add(8); param1.add(26); param1.add(0); param1.add(37); param1.add(28); param1.add(0); List<Integer> param2 = new ArrayList<>(); param2.add(18); param2.add(26); param2.add(28); param2.add(20); param2.add(10); param2.add(23); param2.add(0); param2.add(31); param2.add(28); 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,187
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SWAP_BITS_IN_A_GIVEN_NUMBER.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_BITS_IN_A_GIVEN_NUMBER{ static int f_gold ( int x , int p1 , int p2 , int n ) { int set1 = ( x >> p1 ) & ( ( 1 << n ) - 1 ) ; int set2 = ( x >> p2 ) & ( ( 1 << n ) - 1 ) ; int xor = ( set1 ^ set2 ) ; xor = ( xor << p1 ) | ( xor << p2 ) ; int result = x ^ xor ; return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(95); param0.add(16); param0.add(55); param0.add(75); param0.add(90); param0.add(58); param0.add(69); param0.add(5); param0.add(36); param0.add(62); List<Integer> param1 = new ArrayList<>(); param1.add(88); param1.add(26); param1.add(56); param1.add(35); param1.add(12); param1.add(65); param1.add(64); param1.add(1); param1.add(33); param1.add(69); List<Integer> param2 = new ArrayList<>(); param2.add(97); param2.add(59); param2.add(40); param2.add(79); param2.add(59); param2.add(25); param2.add(17); param2.add(59); param2.add(97); param2.add(66); List<Integer> param3 = new ArrayList<>(); param3.add(92); param3.add(42); param3.add(41); param3.add(30); param3.add(34); param3.add(19); param3.add(94); param3.add(38); param3.add(44); param3.add(9); 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,188
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MINIMUM_COST_CUT_BOARD_SQUARES.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_COST_CUT_BOARD_SQUARES{ static int f_gold ( Integer X [ ] , Integer Y [ ] , int m , int n ) { int res = 0 ; Arrays . sort ( X , Collections . reverseOrder ( ) ) ; Arrays . sort ( Y , Collections . reverseOrder ( ) ) ; int hzntl = 1 , vert = 1 ; int i = 0 , j = 0 ; while ( i < m && j < n ) { if ( X [ i ] > Y [ j ] ) { res += X [ i ] * vert ; hzntl ++ ; i ++ ; } else { res += Y [ j ] * hzntl ; vert ++ ; j ++ ; } } int total = 0 ; while ( i < m ) total += X [ i ++ ] ; res += total * vert ; total = 0 ; while ( j < n ) total += Y [ j ++ ] ; res += total * hzntl ; return res ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer [ ]> param0 = new ArrayList<>(); param0.add(new Integer[]{1,9,9,16,18,20,22,22,23,25,25,26,28,32,33,33,33,34,37,40,44,46,46,52,53,56,58,58,59,60,61,67,67,69,70,70,73,75,77,83,87,87,87,90,90,93,97,98}); param0.add(new Integer[]{-52,66,66,-4,-74,78,52,-72}); param0.add(new Integer[]{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 Integer[]{58,78,48,44,63,37,89,76,66,83,52,97,19,28,67,38,54,77,2,96,28,87}); param0.add(new Integer[]{-84,-78,-76,-72,-68,-62,-62,-60,-58,-44,-34,-10,-8,-4,-2,-2,14,16,20,26,26,32,70,78,86,90,96}); param0.add(new Integer[]{0,1,1,0,0,1,1,0,1,0,1,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,0}); param0.add(new Integer[]{30,75}); param0.add(new Integer[]{70,78,-60,-10,-8,46,38,60,-54,-68,16,10,36,-10,38,-96,-52,-82,-56,22,-56,0,96,-60,24,70,40,62,-20,-36,74,32,44,14,-18,50,58}); param0.add(new Integer[]{0,0,0,1}); param0.add(new Integer[]{81,40,29,74,13,67,10,25,24,81,90}); List<Integer [ ]> param1 = new ArrayList<>(); param1.add(new Integer[]{2,3,9,10,13,16,17,19,20,23,25,27,29,30,30,35,37,39,39,45,47,50,55,55,55,56,59,60,62,63,67,70,70,71,72,73,73,74,77,86,87,88,91,92,95,96,97,99}); param1.add(new Integer[]{-40,30,-34,-76,84,88,-78,72}); param1.add(new Integer[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param1.add(new Integer[]{37,36,26,5,83,75,33,33,72,63,91,94,75,92,9,19,79,29,40,47,63,36}); param1.add(new Integer[]{-98,-98,-86,-82,-76,-62,-60,-48,-32,-32,-24,-18,-10,-4,0,16,16,26,36,42,48,50,64,66,78,92,98}); param1.add(new Integer[]{1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,0,0,1,1,1,1,0,1,1,1,0,0,1,0}); param1.add(new Integer[]{10,39}); param1.add(new Integer[]{64,-42,-50,-76,46,32,-66,86,-6,46,94,70,-62,90,78,4,6,-20,92,-18,-34,-96,92,-24,-90,-94,62,40,-14,-28,80,-86,-86,-56,40,-92,-22}); param1.add(new Integer[]{0,1,1,1}); param1.add(new Integer[]{51,45,23,7,53,14,49,58,25,75,74}); List<Integer> param2 = new ArrayList<>(); param2.add(25); param2.add(6); param2.add(15); param2.add(13); param2.add(15); param2.add(25); param2.add(1); param2.add(19); param2.add(2); param2.add(8); List<Integer> param3 = new ArrayList<>(); param3.add(27); param3.add(7); param3.add(19); param3.add(14); param3.add(24); param3.add(26); param3.add(1); param3.add(19); param3.add(2); param3.add(10); 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,189
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SUM_MANHATTAN_DISTANCES_PAIRS_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 SUM_MANHATTAN_DISTANCES_PAIRS_POINTS{ static int f_gold ( int x [ ] , int y [ ] , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) sum += ( Math . abs ( x [ i ] - x [ j ] ) + Math . abs ( y [ i ] - y [ j ] ) ) ; return sum ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,4,6,6,8,11,12,13,14,19,20,22,24,28,29,30,32,35,37,44,48,49,51,51,56,59,59,62,65,68,68,68,72,75,77,78,89,89,91,93,95,99}); param0.add(new int[]{16,76,2,42,-24,-82,68,-2,98,-42,-72,28,-22,-52,28,-38,36,66,84,64,-28,86,52,84,-98,-30}); param0.add(new int[]{0,0,0,0,0,1,1,1,1,1}); param0.add(new int[]{61,37,57,99,22,72,38,85,23,85,15,4,49,9,15,25,7,63,79,6,85,30,12,34,38,6,59,62,59,34,72,97,70,44,95,58,99}); param0.add(new int[]{-96,-86,-82,-72,-72,-64,-62,-60,-56,-56,-56,-54,-52,-40,-36,-30,-10,10,18,26,28,56,56,56,64,90,92,94}); param0.add(new int[]{1,0,1,1,1,0,1}); param0.add(new int[]{6,10,24,25,31,41,43,45,47,65,67,90}); param0.add(new int[]{-74,92,34,56,-54,-98,-76,-34,16,32,-4,-16,22,90,-52,-90,-60,70,-40,78,96,-68,78,-56,-94}); 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,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{20,32}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{6,19,19,22,25,27,31,33,34,35,37,38,38,44,46,50,51,55,58,58,64,64,64,64,65,66,66,66,67,70,75,78,79,81,81,81,82,84,84,86,94,96}); param1.add(new int[]{-34,92,-24,-62,28,72,-10,10,8,90,-72,-24,50,-46,52,58,68,-62,-64,-78,-12,24,62,-30,62,-60}); param1.add(new int[]{0,0,0,0,1,1,1,1,1,1}); param1.add(new int[]{72,41,77,62,78,36,75,28,91,39,32,56,60,64,21,15,80,85,28,22,53,58,69,62,60,48,66,91,38,66,54,5,24,1,49,71,49}); param1.add(new int[]{-98,-98,-96,-96,-82,-80,-80,-68,-62,-60,-46,-38,-26,-26,-20,-18,16,22,24,26,34,46,52,52,74,76,90,92}); param1.add(new int[]{1,0,1,0,0,1,1}); param1.add(new int[]{4,7,11,19,21,39,57,80,84,93,94,97}); param1.add(new int[]{14,20,24,-92,58,12,78,78,-90,96,-44,36,30,-46,-30,-80,26,-2,26,28,-16,-50,-2,-36,-8}); param1.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,1,1,1,1,1,1,1,1}); param1.add(new int[]{23,50}); List<Integer> param2 = new ArrayList<>(); param2.add(37); param2.add(24); param2.add(5); param2.add(26); param2.add(26); param2.add(3); param2.add(10); param2.add(21); param2.add(23); param2.add(1); 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,190
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/FIND_INDEX_GIVEN_FIBONACCI_NUMBER_CONSTANT_TIME_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_INDEX_GIVEN_FIBONACCI_NUMBER_CONSTANT_TIME_1{ static int f_gold ( int n ) { float fibo = 2.078087F * ( float ) Math . log ( n ) + 1.672276F ; return Math . round ( fibo ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(20); param0.add(95); param0.add(39); param0.add(21); param0.add(94); param0.add(79); param0.add(56); param0.add(62); param0.add(23); 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,191
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/COUNT_ENTRIES_EQUAL_TO_X_IN_A_SPECIAL_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_ENTRIES_EQUAL_TO_X_IN_A_SPECIAL_MATRIX{ static int f_gold ( int n , int x ) { int f_gold = 0 ; for ( int i = 1 ; i <= n && i <= x ; i ++ ) { if ( x / i <= n && x % i == 0 ) f_gold ++ ; } return f_gold ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(47); param0.add(57); param0.add(55); param0.add(11); param0.add(55); param0.add(63); param0.add(64); param0.add(28); param0.add(49); param0.add(48); List<Integer> param1 = new ArrayList<>(); param1.add(30); param1.add(16); param1.add(63); param1.add(23); param1.add(49); param1.add(64); param1.add(98); param1.add(30); param1.add(61); 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,192
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/LONGEST_CONSECUTIVE_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 LONGEST_CONSECUTIVE_SUBSEQUENCE{ static int f_gold ( int arr [ ] , int n ) { HashSet < Integer > S = new HashSet < Integer > ( ) ; int ans = 0 ; for ( int i = 0 ; i < n ; ++ i ) S . add ( arr [ i ] ) ; for ( int i = 0 ; i < n ; ++ i ) { if ( ! S . contains ( arr [ i ] - 1 ) ) { int j = arr [ i ] ; while ( S . contains ( j ) ) j ++ ; if ( ans < j - arr [ i ] ) 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[]{2,28,31,64,73}); param0.add(new int[]{46,26,-84,-24,50,94,-14,74,-52,-62,2,46,62,54,-30,-70,-76,74,60,10,60,98,-92,98,-96,34,30,58,-60,-52,-66,-40,-78,-26,80,-58,-26,80,92,66,90,4,46,-78,80,62,30,0,38}); 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[]{24,72,87,81,90,59,18,29,12,24,78,59,93,80,79,26,17,28,43,85,85,76,83,71,28,99,80,14,9,92,46,59,66,34}); param0.add(new int[]{-94,-94,-94,-76,-68,-64,-64,-56,-48,-46,-36,-26,-12,-6,-6,-2,-2,6,6,24,46,48,50,52,58,76,88}); param0.add(new int[]{1}); param0.add(new int[]{1,8,22,27,28,58,80,89,95}); param0.add(new int[]{46,38,-50,98,-22,92,84,-48}); 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}); param0.add(new int[]{74,2,85,72,1,49,53,48,46,44,98,75,5,13,98,69,65,68,37,38,77,69,14,17,46,54,55,20,23,59,98,44,22,12,71,18,94,49,57,82,7,64,33,7,29,58,45,98}); List<Integer> param1 = new ArrayList<>(); param1.add(3); param1.add(29); param1.add(38); param1.add(32); param1.add(19); param1.add(0); param1.add(5); param1.add(6); param1.add(19); param1.add(36); 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,193
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CALCULATING_FACTORIALS_USING_STIRLING_APPROXIMATION.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 CALCULATING_FACTORIALS_USING_STIRLING_APPROXIMATION{ public static int f_gold ( double n ) { if ( n == 1 ) return 1 ; double z ; double e = 2.71 ; z = Math . sqrt ( 2 * 3.14 * n ) * Math . pow ( ( n / e ) , n ) ; return ( int ) ( z ) ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Double> param0 = new ArrayList<>(); param0.add(1.0); param0.add(5.0); param0.add(10.0); param0.add(20.0); param0.add(40.0); param0.add(2.0); param0.add(3.0); param0.add(-1.0); param0.add(4663.43115050185); param0.add(-3722.039522409859); 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,194
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SPLIT_N_MAXIMUM_COMPOSITE_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 SPLIT_N_MAXIMUM_COMPOSITE_NUMBERS{ static int f_gold ( int n ) { if ( n < 4 ) return - 1 ; int rem = n % 4 ; if ( rem == 0 ) return n / 4 ; if ( rem == 1 ) { if ( n < 9 ) return - 1 ; return ( n - 9 ) / 4 + 1 ; } if ( rem == 2 ) return ( n - 6 ) / 4 + 1 ; if ( rem == 3 ) { if ( n < 15 ) return - 1 ; return ( n - 15 ) / 4 + 2 ; } return 0 ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(55); param0.add(35); param0.add(24); param0.add(75); param0.add(5); param0.add(7); param0.add(50); param0.add(28); param0.add(67); param0.add(59); 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,195
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAXIMUM_LENGTH_PREFIX_ONE_STRING_OCCURS_SUBSEQUENCE_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 MAXIMUM_LENGTH_PREFIX_ONE_STRING_OCCURS_SUBSEQUENCE_ANOTHER{ static int f_gold ( String s , String t ) { int count = 0 ; for ( int i = 0 ; i < t . length ( ) ; i ++ ) { if ( count == t . length ( ) ) break ; if ( t . charAt ( i ) == s . charAt ( count ) ) count ++ ; } return count ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("nObYIOjEQZ"); param0.add("84574"); param0.add("1010001010010"); param0.add("DjZtAfUudk"); param0.add("550"); param0.add("1110"); param0.add("GywyxwH"); param0.add("67318370914755"); param0.add("11011000000101"); param0.add("G"); List<String> param1 = new ArrayList<>(); param1.add("uARTDTQbmGI"); param1.add("8538229"); param1.add("11"); param1.add("OewGm"); param1.add("132744553919"); param1.add("0101"); param1.add("LPQqEqrDZiwY"); param1.add("9928"); param1.add("00000"); param1.add("V"); 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,196
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/SMALLEST_DIFFERENCE_PAIR_VALUES_TWO_UNSORTED_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 SMALLEST_DIFFERENCE_PAIR_VALUES_TWO_UNSORTED_ARRAYS{ static int f_gold ( int A [ ] , int B [ ] , int m , int n ) { Arrays . sort ( A ) ; Arrays . sort ( B ) ; int a = 0 , b = 0 ; int result = Integer . MAX_VALUE ; while ( a < m && b < n ) { if ( Math . abs ( A [ a ] - B [ b ] ) < result ) result = Math . abs ( A [ a ] - B [ b ] ) ; if ( A [ a ] < B [ b ] ) a ++ ; else b ++ ; } return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,2,11,13,18,18,23,25,28,28,37,39,53,56,67,70,74,74,75,79,80,82,84,89,94,95,95,98,98}); param0.add(new int[]{-78,10,-8,30,-70,-94,-48,-4,-22,-40,-36,-48,-4,86,-50,62,-72,-44,-62,22,-30,-72,6,-24,-78,72,-44,56,38,-36,0,-72,-10,-12,-70,-64,-24}); param0.add(new int[]{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[]{57,82,90,9,61,71,15,2,39,24,28,28,47}); param0.add(new int[]{-92,-90,-90,-28,-16,-14,-14,-8,42,52,62,84}); param0.add(new int[]{1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,1,1,1,0,0,1,1,0,0,1,0,1,0,1,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,0}); param0.add(new int[]{6,7,7,12,15,15,21,24,26,26,28,36,38,42,46,52,55,56,59,62,63,65,65,66,68,71,73,77,77,77,77,85,87,87,88,90,93,94,98}); param0.add(new int[]{-68,44,88,-68,22,34,-82,18,-60,30,24,18,78,90,-20,-60,94,70,4,-16,-38}); param0.add(new int[]{0,0,1}); param0.add(new int[]{14,7,9,71,37,20,85,62,70,67,26,47,61,99,2,90,70,46,53,16,56,7,15,81,85,94,73,40,35,58,21,98,45}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{5,6,11,13,13,16,17,19,23,25,28,31,31,39,41,44,45,52,62,64,70,71,73,78,78,79,85,86,92}); param1.add(new int[]{78,-80,-24,-50,-26,-62,26,-12,22,-90,84,10,18,62,26,-68,92,64,-52,76,-84,64,50,36,-24,-98,42,72,-78,-98,-24,86,2,60,-30,14,-42}); param1.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}); param1.add(new int[]{85,92,84,27,54,77,26,49,47,51,70,11,41}); param1.add(new int[]{-98,-98,-58,-6,14,16,18,46,52,52,52,56}); param1.add(new int[]{0,1,1,1,0,0,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,1,0,1}); param1.add(new int[]{1,3,4,4,6,7,8,8,15,17,18,18,20,23,23,24,25,25,26,33,39,43,46,54,59,67,69,69,69,69,76,76,81,81,85,86,86,91,95}); param1.add(new int[]{-18,-30,-74,-50,98,-44,-62,-20,18,84,62,-64,-2,62,-32,-34,-14,-52,-36,-60,-68}); param1.add(new int[]{0,0,1}); param1.add(new int[]{99,72,29,55,88,1,88,19,7,80,79,18,28,41,48,49,67,27,24,94,86,14,45,84,37,71,92,98,16,64,67,44,29}); List<Integer> param2 = new ArrayList<>(); param2.add(28); param2.add(23); param2.add(14); param2.add(7); param2.add(11); param2.add(35); param2.add(30); param2.add(16); param2.add(2); param2.add(20); List<Integer> param3 = new ArrayList<>(); param3.add(14); param3.add(33); param3.add(16); param3.add(8); param3.add(6); param3.add(33); param3.add(20); param3.add(12); param3.add(1); param3.add(25); 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,197
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/CHECK_WHETHER_GIVEN_NUMBER_EVEN_ODD_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_WHETHER_GIVEN_NUMBER_EVEN_ODD_1{ public static boolean f_gold ( int n ) { if ( ( n & 1 ) == 0 ) return true ; else return false ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(57); param0.add(73); param0.add(79); param0.add(36); param0.add(71); param0.add(23); param0.add(41); param0.add(66); param0.add(46); param0.add(50); 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,198
0
Create_ds/CodeGen/data/transcoder_evaluation_gfg
Create_ds/CodeGen/data/transcoder_evaluation_gfg/java/MAKING_ELEMENTS_OF_TWO_ARRAYS_SAME_WITH_MINIMUM_INCREMENTDECREMENT.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 MAKING_ELEMENTS_OF_TWO_ARRAYS_SAME_WITH_MINIMUM_INCREMENTDECREMENT{ static int f_gold ( int a [ ] , int b [ ] , int n ) { Arrays . sort ( a ) ; Arrays . sort ( b ) ; int result = 0 ; for ( int i = 0 ; i < n ; ++ i ) { if ( a [ i ] > b [ i ] ) result = result + Math . abs ( a [ i ] - b [ i ] ) ; else if ( a [ i ] < b [ i ] ) result = result + Math . abs ( a [ i ] - b [ i ] ) ; } return result ; } //TOFILL public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,6,6,7,10,11,13,18,19,19,19,31,34,37,37,40,41,41,47,47,53,54,55,55,56,56,60,60,62,62,66,73,75,76,78,81,81,85,88,90,91,92,93,95,97,98}); param0.add(new int[]{-12,-6,78,62,86,-32}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{76,74}); param0.add(new int[]{-92,-90,-88,-84,-76,-54,-44,-42,-38,-30,34,42}); param0.add(new int[]{1,1,0,0,1,1,1,0,1,1,0,0,1,0,0,1,1,1}); param0.add(new int[]{4,5,6,13,16,24,36,40,40,44,47,52,58,58,59,63,66,67,69,70,74,77,81,88,89,90,94,96}); param0.add(new int[]{-16,66,-2,54,-8,10,44,-36,-54,50,92,84,-36,40,-12,98,36,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,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[]{42,24,43,64,55,94,26,30,76,3,37,43,81,7,15,64,63,88,34,8,55,32,19,55}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{2,2,4,7,8,8,8,8,8,9,9,12,15,16,21,25,26,27,29,34,34,35,38,40,40,44,44,47,48,54,58,61,63,64,66,69,69,70,73,74,75,76,79,80,80,93}); param1.add(new int[]{-86,20,32,52,50,-60}); param1.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{16,98}); param1.add(new int[]{-80,-54,-34,12,14,16,16,46,50,64,84,92}); param1.add(new int[]{0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1}); param1.add(new int[]{1,7,10,17,21,22,22,27,36,37,39,46,52,53,56,59,65,67,70,75,78,78,79,89,89,94,96,97}); param1.add(new int[]{-76,-74,62,22,50,84,78,26,-62,-10,86,-10,-92,-10,86,-6,-58,-26,-18}); 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,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{96,11,63,90,28,80,44,63,17,81,80,69,66,22,81,4,86,74,91,17,3,81,65,98}); List<Integer> param2 = new ArrayList<>(); param2.add(23); param2.add(4); param2.add(14); param2.add(1); param2.add(8); param2.add(14); param2.add(24); param2.add(16); param2.add(36); 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,199