id
stringlengths
9
111
java
stringlengths
188
2.04k
python
stringlengths
40
1.94k
cpp
stringlengths
65
1.25k
java_test
stringlengths
532
56.4k
python_test
stringlengths
348
57.4k
cpp_test
stringlengths
328
4.71k
MAXIMUM_CONSECUTIVE_NUMBERS_PRESENT_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_CONSECUTIVE_NUMBERS_PRESENT_ARRAY{ static int f_gold ( int arr [ ] , int n ) { HashSet < Integer > S = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) S . add ( arr [ i ] ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( S . contains ( arr [ i ] ) ) { int j = arr [ i ] ; while ( S . contains ( j ) ) j ++ ; ans = Math . max ( ans , j - arr [ i ] ) ; } } return ans ; }
def f_gold ( arr , n ) : S = set ( ) ; for i in range ( n ) : S.add ( arr [ i ] ) ; ans = 0 ; for i in range ( n ) : if S.__contains__ ( arr [ i ] ) : j = arr [ i ] ; while ( S.__contains__ ( j ) ) : j += 1 ; ans = max ( ans , j - arr [ i ] ) ; return ans ;
using namespace std; int f_gold ( int arr [ ], int n ) { unordered_set < int > S; for ( int i = 0; i < n; i ++ ) S . insert ( arr [ i ] ); int ans = 0; for ( int i = 0; i < n; i ++ ) { if ( S . find ( arr [ i ] - 1 ) == S . end ( ) ) { int j = arr [ i ]; while ( S . find ( j ) != S . end ( ) ) j ++; ans = max ( ans, j - arr [ i ] ); } } return ans; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,5,9,24,28,31,49,54,67,85,86,94,97,97}); param0.add(new int[]{-34,16,-80,-10,80,2,50,-74,-76,36,-84,-24,74,-54,-22,46,80,58,-8,70,24,-88,52,62,30,42,48,16,78,-82,64,-36,84,-72}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{49,61,68,4,90,89,71,74,45,61,35,41,59}); param0.add(new int[]{-42,-8,28,56,80,96}); param0.add(new int[]{1,0,1,0,0,0,0,1,1,0,1,1,0,1,0,1,1,1,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,1,1}); param0.add(new int[]{3,4,6,6,13,27,27,29,32,36,46,50,52,65,69,70,71,83,87,91}); param0.add(new int[]{64,-76,28,6,56,18,32,-50,-20,18,-26,-90,32,50,-18,98,84,40,50,88,-70,-6,-24,-44,-96,-58,48,-78,-14}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{50,48,61,87,7,78,93,44,16,88,98,15,73,93,43,46,42,34,1,35,79,35,84,60,18,79,17,4,78,1,20,64}); List<Integer> param1 = new ArrayList<>(); param1.add(11); param1.add(29); param1.add(13); param1.add(11); param1.add(4); param1.add(17); param1.add(10); param1.add(15); param1.add(15); param1.add(25); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([3, 5, 9, 24, 28, 31, 49, 54, 67, 85, 86, 94, 97, 97],11,), ([-34, 16, -80, -10, 80, 2, 50, -74, -76, 36, -84, -24, 74, -54, -22, 46, 80, 58, -8, 70, 24, -88, 52, 62, 30, 42, 48, 16, 78, -82, 64, -36, 84, -72],29,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],13,), ([49, 61, 68, 4, 90, 89, 71, 74, 45, 61, 35, 41, 59],11,), ([-42, -8, 28, 56, 80, 96],4,), ([1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1],17,), ([3, 4, 6, 6, 13, 27, 27, 29, 32, 36, 46, 50, 52, 65, 69, 70, 71, 83, 87, 91],10,), ([64, -76, 28, 6, 56, 18, 32, -50, -20, 18, -26, -90, 32, 50, -18, 98, 84, 40, 50, 88, -70, -6, -24, -44, -96, -58, 48, -78, -14],15,), ([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],15,), ([50, 48, 61, 87, 7, 78, 93, 44, 16, 88, 98, 15, 73, 93, 43, 46, 42, 34, 1, 35, 79, 35, 84, 60, 18, 79, 17, 4, 78, 1, 20, 64],25,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{3,5,9,24,28,31,49,54,67,85,86,94,97,97},{-34,16,-80,-10,80,2,50,-74,-76,36,-84,-24,74,-54,-22,46,80,58,-8,70,24,-88,52,62,30,42,48,16,78,-82,64,-36,84,-72},{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1},{49,61,68,4,90,89,71,74,45,61,35,41,59},{-42,-8,28,56,80,96},{1,0,1,0,0,0,0,1,1,0,1,1,0,1,0,1,1,1,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,1,1},{3,4,6,6,13,27,27,29,32,36,46,50,52,65,69,70,71,83,87,91},{64,-76,28,6,56,18,32,-50,-20,18,-26,-90,32,50,-18,98,84,40,50,88,-70,-6,-24,-44,-96,-58,48,-78,-14},{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},{50,48,61,87,7,78,93,44,16,88,98,15,73,93,43,46,42,34,1,35,79,35,84,60,18,79,17,4,78,1,20,64}}; vector<int> param1 {11,29,13,11,4,17,10,15,15,25}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
LARGEST_SUM_CONTIGUOUS_SUBARRAY_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LARGEST_SUM_CONTIGUOUS_SUBARRAY_2{ static int f_gold ( int a [ ] , int size ) { int max_so_far = a [ 0 ] ; int curr_max = a [ 0 ] ; for ( int i = 1 ; i < size ; i ++ ) { curr_max = Math . max ( a [ i ] , curr_max + a [ i ] ) ; max_so_far = Math . max ( max_so_far , curr_max ) ; } return max_so_far ; }
def f_gold ( a , size ) : max_so_far = a [ 0 ] curr_max = a [ 0 ] for i in range ( 1 , size ) : curr_max = max ( a [ i ] , curr_max + a [ i ] ) max_so_far = max ( max_so_far , curr_max ) return max_so_far
using namespace std; int f_gold ( int a [ ], int size ) { int max_so_far = a [ 0 ]; int curr_max = a [ 0 ]; for ( int i = 1; i < size; i ++ ) { curr_max = max ( a [ i ], curr_max + a [ i ] ); max_so_far = max ( max_so_far, curr_max ); } return max_so_far; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,3,4,7,8,8,10,12,16,19,19,20,20,21,21,22,26,27,29,34,36,38,38,39,41,43,44,47,47,49,57,57,60,62,63,65,75,77,77,78,81,82,82,83,83,84,85,98,99}); param0.add(new int[]{-40,14,2,-70,86,-90,-50,-54,-2,90,30}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{60,69,41,7,77,36,36,26,35,30,64,75,3,35,60,71,29,47,15,29,43,88,56,22,9,45,40,50,52}); param0.add(new int[]{-96,-88,-80,-72,-64,-64,-60,-60,-60,-58,-56,-54,-54,-50,-50,-26,-26,-24,-20,-8,-2,0,4,4,12,14,18,18,24,32,42,44,44,44,48,50,50,56,60,60,70,80,88,88,90,98}); param0.add(new int[]{0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,1,0,0,0,1,1,1,0}); param0.add(new int[]{2,4,4,5,6,7,11,12,14,18,23,24,27,28,33,36,37,38,39,40,41,41,48,48,52,61,64,66,66,77,79,82,85,88,91,94,99}); param0.add(new int[]{-56,0,16,12,20,36,32,-52,-68,-36,-96,-46,-34,56,2,78,6,30,-68,-48,2,44,-26,-36,-30,-20,-90,-66,4,94,8,4,-4,-32,-24}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{39,87,27,89,26,25,80,82,21,25,55,27,20,81,47,79,26,72,10,11,90,89}); List<Integer> param1 = new ArrayList<>(); param1.add(38); param1.add(10); param1.add(18); param1.add(25); param1.add(35); param1.add(22); param1.add(34); param1.add(20); param1.add(22); param1.add(21); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([1, 3, 4, 7, 8, 8, 10, 12, 16, 19, 19, 20, 20, 21, 21, 22, 26, 27, 29, 34, 36, 38, 38, 39, 41, 43, 44, 47, 47, 49, 57, 57, 60, 62, 63, 65, 75, 77, 77, 78, 81, 82, 82, 83, 83, 84, 85, 98, 99],38,), ([-40, 14, 2, -70, 86, -90, -50, -54, -2, 90, 30],10,), ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],18,), ([60, 69, 41, 7, 77, 36, 36, 26, 35, 30, 64, 75, 3, 35, 60, 71, 29, 47, 15, 29, 43, 88, 56, 22, 9, 45, 40, 50, 52],25,), ([-96, -88, -80, -72, -64, -64, -60, -60, -60, -58, -56, -54, -54, -50, -50, -26, -26, -24, -20, -8, -2, 0, 4, 4, 12, 14, 18, 18, 24, 32, 42, 44, 44, 44, 48, 50, 50, 56, 60, 60, 70, 80, 88, 88, 90, 98],35,), ([0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0],22,), ([2, 4, 4, 5, 6, 7, 11, 12, 14, 18, 23, 24, 27, 28, 33, 36, 37, 38, 39, 40, 41, 41, 48, 48, 52, 61, 64, 66, 66, 77, 79, 82, 85, 88, 91, 94, 99],34,), ([-56, 0, 16, 12, 20, 36, 32, -52, -68, -36, -96, -46, -34, 56, 2, 78, 6, 30, -68, -48, 2, 44, -26, -36, -30, -20, -90, -66, 4, 94, 8, 4, -4, -32, -24],20,), ([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],22,), ([39, 87, 27, 89, 26, 25, 80, 82, 21, 25, 55, 27, 20, 81, 47, 79, 26, 72, 10, 11, 90, 89],21,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{1,3,4,7,8,8,10,12,16,19,19,20,20,21,21,22,26,27,29,34,36,38,38,39,41,43,44,47,47,49,57,57,60,62,63,65,75,77,77,78,81,82,82,83,83,84,85,98,99},{-40,14,2,-70,86,-90,-50,-54,-2,90,30},{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1},{60,69,41,7,77,36,36,26,35,30,64,75,3,35,60,71,29,47,15,29,43,88,56,22,9,45,40,50,52},{-96,-88,-80,-72,-64,-64,-60,-60,-60,-58,-56,-54,-54,-50,-50,-26,-26,-24,-20,-8,-2,0,4,4,12,14,18,18,24,32,42,44,44,44,48,50,50,56,60,60,70,80,88,88,90,98},{0,1,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,1,1,0,0,0,1,1,1,0},{2,4,4,5,6,7,11,12,14,18,23,24,27,28,33,36,37,38,39,40,41,41,48,48,52,61,64,66,66,77,79,82,85,88,91,94,99},{-56,0,16,12,20,36,32,-52,-68,-36,-96,-46,-34,56,2,78,6,30,-68,-48,2,44,-26,-36,-30,-20,-90,-66,4,94,8,4,-4,-32,-24},{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},{39,87,27,89,26,25,80,82,21,25,55,27,20,81,47,79,26,72,10,11,90,89}}; vector<int> param1 {38,10,18,25,35,22,34,20,22,21}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MINIMUM_SUM_TWO_NUMBERS_FORMED_DIGITS_ARRAY_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_SUM_TWO_NUMBERS_FORMED_DIGITS_ARRAY_2{ static int f_gold ( int a [ ] , int n ) { Arrays . sort ( a ) ; int num1 = 0 ; int num2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 2 == 0 ) num1 = num1 * 10 + a [ i ] ; else num2 = num2 * 10 + a [ i ] ; } return num2 + num1 ; }
def f_gold ( a , n ) : a = sorted ( a ) num1 , num2 = 0 , 0 for i in range ( n ) : if i % 2 == 0 : num1 = num1 * 10 + a [ i ] else : num2 = num2 * 10 + a [ i ] return num2 + num1
using namespace std; int f_gold ( int a [ ], int n ) { sort ( a, a + n ); int num1 = 0; int num2 = 0; for ( int i = 0; i < n; i ++ ) { if ( i % 2 == 0 ) num1 = num1 * 10 + a [ i ]; else num2 = num2 * 10 + a [ i ]; } return num2 + num1; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,16,29,30,38,83}); param0.add(new int[]{58,74,-28,-60,-6,66,-76,46,0,-24,28,-16,-14,24,-94,-56,-80,40,-18,-68,-8,-94,-88,-12,-20,-8}); param0.add(new int[]{0,1}); param0.add(new int[]{7,12,78,8}); param0.add(new int[]{-78,-48,-48,-26,8,34}); param0.add(new int[]{1,1,1,1,0,1,1,1,0,1,0,1,0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,1,1,0}); param0.add(new int[]{2,3,5,7,25,30,31,38,42,45,52,53,56,59,60,71,74,76,80,90,91,98}); param0.add(new int[]{40,-62,-2,-58,60,38,48,-4,0,62,-52,-80,56,38,58,-72,32,-26,-14,70,58,-86,-32,56,-40,84,24,60,-46,-32,78,78,-66,20,-32,98,84,44,48,4,54,-66,6,-62,58}); param0.add(new int[]{0,0,0,0,0,0,1,1,1}); param0.add(new int[]{59,9,3,20,83,87,48,4,86,67,89,96,17,36,39,45,99,8,56,92,63,81,7,75,32,10,71,82,97,92,65,23,22,47,70,79,57,81,65,50}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(16); param1.add(1); param1.add(3); param1.add(4); param1.add(27); param1.add(13); param1.add(34); param1.add(8); param1.add(35); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([4, 16, 29, 30, 38, 83],5,), ([58, 74, -28, -60, -6, 66, -76, 46, 0, -24, 28, -16, -14, 24, -94, -56, -80, 40, -18, -68, -8, -94, -88, -12, -20, -8],16,), ([0, 1],1,), ([7, 12, 78, 8],3,), ([-78, -48, -48, -26, 8, 34],4,), ([1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0],27,), ([2, 3, 5, 7, 25, 30, 31, 38, 42, 45, 52, 53, 56, 59, 60, 71, 74, 76, 80, 90, 91, 98],13,), ([40, -62, -2, -58, 60, 38, 48, -4, 0, 62, -52, -80, 56, 38, 58, -72, 32, -26, -14, 70, 58, -86, -32, 56, -40, 84, 24, 60, -46, -32, 78, 78, -66, 20, -32, 98, 84, 44, 48, 4, 54, -66, 6, -62, 58],34,), ([0, 0, 0, 0, 0, 0, 1, 1, 1],8,), ([59, 9, 3, 20, 83, 87, 48, 4, 86, 67, 89, 96, 17, 36, 39, 45, 99, 8, 56, 92, 63, 81, 7, 75, 32, 10, 71, 82, 97, 92, 65, 23, 22, 47, 70, 79, 57, 81, 65, 50],35,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{4,16,29,30,38,83},{58,74,-28,-60,-6,66,-76,46,0,-24,28,-16,-14,24,-94,-56,-80,40,-18,-68,-8,-94,-88,-12,-20,-8},{0,1},{7,12,78,8},{-78,-48,-48,-26,8,34},{1,1,1,1,0,1,1,1,0,1,0,1,0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,1,1,0},{2,3,5,7,25,30,31,38,42,45,52,53,56,59,60,71,74,76,80,90,91,98},{40,-62,-2,-58,60,38,48,-4,0,62,-52,-80,56,38,58,-72,32,-26,-14,70,58,-86,-32,56,-40,84,24,60,-46,-32,78,78,-66,20,-32,98,84,44,48,4,54,-66,6,-62,58},{0,0,0,0,0,0,1,1,1},{59,9,3,20,83,87,48,4,86,67,89,96,17,36,39,45,99,8,56,92,63,81,7,75,32,10,71,82,97,92,65,23,22,47,70,79,57,81,65,50}}; vector<int> param1 {5,16,1,3,4,27,13,34,8,35}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MODULAR_EXPONENTIATION_POWER_IN_MODULAR_ARITHMETIC
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MODULAR_EXPONENTIATION_POWER_IN_MODULAR_ARITHMETIC{ static int f_gold ( int x , int y , int p ) { int res = 1 ; x = x % p ; while ( y > 0 ) { if ( ( y & 1 ) == 1 ) res = ( res * x ) % p ; y = y >> 1 ; x = ( x * x ) % p ; } return res ; }
def f_gold ( x , y , p ) : res = 1 x = x % p while ( y > 0 ) : if ( ( y & 1 ) == 1 ) : res = ( res * x ) % p y = y >> 1 x = ( x * x ) % p return res
using namespace std; int f_gold ( int x, unsigned int y, int p ) { int res = 1; x = x % p; while ( y > 0 ) { if ( y & 1 ) res = ( res * x ) % p; y = y >> 1; x = ( x * x ) % p; } return res; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(45); param0.add(67); param0.add(26); param0.add(33); param0.add(35); param0.add(68); param0.add(14); param0.add(5); param0.add(23); param0.add(37); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(25); param1.add(91); param1.add(61); param1.add(8); param1.add(41); param1.add(76); param1.add(89); param1.add(42); param1.add(63); List<Integer> param2 = new ArrayList<>(); param2.add(68); param2.add(49); param2.add(44); param2.add(9); param2.add(13); param2.add(5); param2.add(20); param2.add(13); param2.add(45); param2.add(56); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (45,5,68,), (67,25,49,), (26,91,44,), (33,61,9,), (35,8,13,), (68,41,5,), (14,76,20,), (5,89,13,), (23,42,45,), (37,63,56,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {45,67,26,33,35,68,14,5,23,37}; vector<int> param1 {5,25,91,61,8,41,76,89,42,63}; vector<int> param2 {68,49,44,9,13,5,20,13,45,56}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i],param2[i]) == f_gold(param0[i],param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
WRITE_A_C_PROGRAM_TO_FIND_THE_PARITY_OF_AN_UNSIGNED_INTEGER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class WRITE_A_C_PROGRAM_TO_FIND_THE_PARITY_OF_AN_UNSIGNED_INTEGER{ static boolean f_gold ( int n ) { boolean parity = false ; while ( n != 0 ) { parity = ! parity ; n = n & ( n - 1 ) ; } return parity ; }
def f_gold ( n ) : parity = 0 while n : parity = ~ parity n = n & ( n - 1 ) return parity
using namespace std; bool f_gold ( unsigned int n ) { bool parity = 0; while ( n ) { parity = ! parity; n = n & ( n - 1 ); } return parity; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(63); param0.add(64); param0.add(85); param0.add(36); param0.add(20); param0.add(63); param0.add(42); param0.add(19); param0.add(62); param0.add(97); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (63,), (64,), (85,), (36,), (20,), (63,), (42,), (19,), (62,), (97,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {63,64,85,36,20,63,42,19,62,97}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CHECK_LARGE_NUMBER_DIVISIBLE_11_NOT
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_LARGE_NUMBER_DIVISIBLE_11_NOT{ static boolean f_gold ( String str ) { int n = str . length ( ) ; int oddDigSum = 0 , evenDigSum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 2 == 0 ) oddDigSum += ( str . charAt ( i ) - '0' ) ; else evenDigSum += ( str . charAt ( i ) - '0' ) ; } return ( ( oddDigSum - evenDigSum ) % 11 == 0 ) ; }
null
using namespace std; int f_gold ( string str ) { int n = str . length ( ); int oddDigSum = 0, evenDigSum = 0; for ( int i = 0; i < n; i ++ ) { if ( i % 2 == 0 ) oddDigSum += ( str [ i ] - '0' ); else evenDigSum += ( str [ i ] - '0' ); } return ( ( oddDigSum - evenDigSum ) % 11 == 0 ); }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("r"); param0.add("7386620"); param0.add("1010"); param0.add("rWFOLX VB"); param0.add("3845847974820"); param0.add("01001"); param0.add("yq"); param0.add("770356"); param0.add("0000110111001"); param0.add("tDMrBdHJJITDx"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<string> param0 {"r","7386620","1010","rWFOLX VB","3845847974820","01001","yq","770356","0000110111001","tDMrBdHJJITDx"}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SMALLEST_POWER_OF_2_GREATER_THAN_OR_EQUAL_TO_N_1{ static int f_gold ( int n ) { int p = 1 ; if ( n > 0 && ( n & ( n - 1 ) ) == 0 ) return n ; while ( p < n ) p <<= 1 ; return p ; }
def f_gold ( n ) : p = 1 if ( n and not ( n & ( n - 1 ) ) ) : return n while ( p < n ) : p <<= 1 return p ;
using namespace std; unsigned int f_gold ( unsigned int n ) { unsigned int p = 1; if ( n && ! ( n & ( n - 1 ) ) ) return n; while ( p < n ) p <<= 1; return p; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(31); param0.add(89); param0.add(92); param0.add(66); param0.add(38); param0.add(34); param0.add(17); param0.add(24); param0.add(54); param0.add(20); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (31,), (89,), (92,), (66,), (38,), (34,), (17,), (24,), (54,), (20,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {31,89,92,66,38,34,17,24,54,20}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
K_TH_MISSING_ELEMENT_INCREASING_SEQUENCE_NOT_PRESENT_GIVEN_SEQUENCE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class K_TH_MISSING_ELEMENT_INCREASING_SEQUENCE_NOT_PRESENT_GIVEN_SEQUENCE{ static int f_gold ( int a [ ] , int b [ ] , int k , int n1 , int n2 ) { LinkedHashSet < Integer > s = new LinkedHashSet < > ( ) ; for ( int i = 0 ; i < n2 ; i ++ ) s . add ( b [ i ] ) ; int missing = 0 ; for ( int i = 0 ; i < n1 ; i ++ ) { if ( ! s . contains ( a [ i ] ) ) missing ++ ; if ( missing == k ) return a [ i ] ; } return - 1 ; }
def f_gold ( a , b , k , n1 , n2 ) : s = set ( ) for i in range ( n2 ) : s.add ( b [ i ] ) missing = 0 for i in range ( n1 ) : if a [ i ] not in s : missing += 1 if missing == k : return a [ i ] return - 1
null
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,9,9,13,38,41,50,59,64,64,72,78,79,80,84,92,94,98,99}); param0.add(new int[]{-54,-80,-62,98,-68,42,98,80,-8,-6,26,0,-60,-24,-74,-48,4,-54,20,32,42,68,-50,58,-50,96,-34,22,56,-60,-10,-18,80,20,-50}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{85,44,60,86,26,22,95,47,43,24,30,37,22,33,6,56}); param0.add(new int[]{-32,-18,2,54,72,92,94}); param0.add(new int[]{1,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,1,0,1,0,1,0,1,0,1,0,0,0,1,1,0,1,1,1,1,1,1,0,0,0,1,0,1,1,1,0,0}); param0.add(new int[]{3,9,13,14,16,19,20,21,23,26,27,27,28,29,31,36,37,38,41,42,45,46,52,56,63,65,70,70,72,72,76,77,78,78,79,82,83,86,87,87,90,93,93,94,96,96,97,98}); param0.add(new int[]{-82,-62}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}); param0.add(new int[]{26,5,60,53,35}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{5,9,11,21,24,27,30,35,38,39,40,45,48,48,51,58,61,91,92}); param1.add(new int[]{90,-86,-82,92,-42,-34,10,-28,-78,8,66,96,-16,-22,-68,-36,-72,84,-54,-44,-80,-30,64,10,-60,-90,22,54,-88,74,-56,22,-24,-52,82}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param1.add(new int[]{66,76,38,91,57,50,12,21,90,17,18,78,23,12,90,81}); param1.add(new int[]{-76,-68,-34,-24,8,12,32}); param1.add(new int[]{0,0,1,1,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,0}); param1.add(new int[]{2,5,6,7,9,11,11,13,17,18,20,20,26,27,35,35,36,37,41,42,45,46,48,49,50,50,54,54,56,60,62,63,65,67,68,68,70,72,74,74,78,79,80,80,86,89,97,99}); param1.add(new int[]{48,32}); param1.add(new int[]{0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{41,80,35,14,47}); List<Integer> param2 = new ArrayList<>(); param2.add(11); param2.add(24); param2.add(15); param2.add(12); param2.add(6); param2.add(29); param2.add(27); param2.add(1); param2.add(10); param2.add(3); List<Integer> param3 = new ArrayList<>(); param3.add(9); param3.add(24); param3.add(15); param3.add(14); param3.add(3); param3.add(29); param3.add(39); param3.add(1); param3.add(14); param3.add(2); List<Integer> param4 = new ArrayList<>(); param4.add(18); param4.add(21); param4.add(11); param4.add(10); param4.add(5); param4.add(37); param4.add(28); param4.add(1); param4.add(12); param4.add(3); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i),param4.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i),param4.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([2, 9, 9, 13, 38, 41, 50, 59, 64, 64, 72, 78, 79, 80, 84, 92, 94, 98, 99],[5, 9, 11, 21, 24, 27, 30, 35, 38, 39, 40, 45, 48, 48, 51, 58, 61, 91, 92],11,9,18,), ([-54, -80, -62, 98, -68, 42, 98, 80, -8, -6, 26, 0, -60, -24, -74, -48, 4, -54, 20, 32, 42, 68, -50, 58, -50, 96, -34, 22, 56, -60, -10, -18, 80, 20, -50],[90, -86, -82, 92, -42, -34, 10, -28, -78, 8, 66, 96, -16, -22, -68, -36, -72, 84, -54, -44, -80, -30, 64, 10, -60, -90, 22, 54, -88, 74, -56, 22, -24, -52, 82],24,24,21,), ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1],[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1],15,15,11,), ([85, 44, 60, 86, 26, 22, 95, 47, 43, 24, 30, 37, 22, 33, 6, 56],[66, 76, 38, 91, 57, 50, 12, 21, 90, 17, 18, 78, 23, 12, 90, 81],12,14,10,), ([-32, -18, 2, 54, 72, 92, 94],[-76, -68, -34, -24, 8, 12, 32],6,3,5,), ([1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0],[0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0],29,29,37,), ([3, 9, 13, 14, 16, 19, 20, 21, 23, 26, 27, 27, 28, 29, 31, 36, 37, 38, 41, 42, 45, 46, 52, 56, 63, 65, 70, 70, 72, 72, 76, 77, 78, 78, 79, 82, 83, 86, 87, 87, 90, 93, 93, 94, 96, 96, 97, 98],[2, 5, 6, 7, 9, 11, 11, 13, 17, 18, 20, 20, 26, 27, 35, 35, 36, 37, 41, 42, 45, 46, 48, 49, 50, 50, 54, 54, 56, 60, 62, 63, 65, 67, 68, 68, 70, 72, 74, 74, 78, 79, 80, 80, 86, 89, 97, 99],27,39,28,), ([-82, -62],[48, 32],1,1,1,), ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1],10,14,12,), ([26, 5, 60, 53, 35],[41, 80, 35, 14, 47],3,2,3,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
null
FIND_THE_NUMBER_OCCURRING_ODD_NUMBER_OF_TIMES_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_THE_NUMBER_OCCURRING_ODD_NUMBER_OF_TIMES_2{ static int f_gold ( int ar [ ] , int ar_size ) { int i ; int res = 0 ; for ( i = 0 ; i < ar_size ; i ++ ) { res = res ^ ar [ i ] ; } return res ; }
null
using namespace std; int f_gold ( int ar [ ], int ar_size ) { int res = 0; for ( int i = 0; i < ar_size; i ++ ) res = res ^ ar [ i ]; return res; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,1,7,10,12,19,20,22,23,25,27,32,33,39,43,44,45,46,47,47,48,49,50,51,55,58,68,69,73,76,77,79,81,84,92,95,99}); param0.add(new int[]{-12,-40,-68}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{86,56,98,58,7,40,84,45,69,77,36,50,72,99,95}); param0.add(new int[]{-90,-68,-66,-66,-58,-54,-52,-48,-40,-30,-26,-24,-20,-14,-10,-8,-6,-6,-6,18,30,34,36,42,50,56,64,68,70,74,92,92,98}); param0.add(new int[]{0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,0,1,0,0,1,0,1,1,1,0,1,0,1,1,1,1,0,0,1,0,0,0}); param0.add(new int[]{3,21,47,51,78,84,84,85,86,99}); param0.add(new int[]{-26,-72,44,62,-22,22,28,-28,32,-72,72,96,92,-52,-2,-22,-76,-88,-74,-8,-30,54,0,-62,14,-92,-58,72,40,46,96,86,-54,-92,46,92,20,-96,-92,-70,-94,78,-92,-54,-90}); param0.add(new int[]{0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{69,1,12,81,78,18,81,47,49,19,99,40,52,47,71,69,80,72,66,84,72,6,98,89,3,87,81,85,37,14,5,36,26,74}); List<Integer> param1 = new ArrayList<>(); param1.add(36); param1.add(2); param1.add(21); param1.add(9); param1.add(26); param1.add(27); param1.add(9); param1.add(33); param1.add(9); param1.add(22); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{1,1,7,10,12,19,20,22,23,25,27,32,33,39,43,44,45,46,47,47,48,49,50,51,55,58,68,69,73,76,77,79,81,84,92,95,99},{-12,-40,-68},{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},{86,56,98,58,7,40,84,45,69,77,36,50,72,99,95},{-90,-68,-66,-66,-58,-54,-52,-48,-40,-30,-26,-24,-20,-14,-10,-8,-6,-6,-6,18,30,34,36,42,50,56,64,68,70,74,92,92,98},{0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,0,1,0,0,1,0,1,1,1,0,1,0,1,1,1,1,0,0,1,0,0,0},{3,21,47,51,78,84,84,85,86,99},{-26,-72,44,62,-22,22,28,-28,32,-72,72,96,92,-52,-2,-22,-76,-88,-74,-8,-30,54,0,-62,14,-92,-58,72,40,46,96,86,-54,-92,46,92,20,-96,-92,-70,-94,78,-92,-54,-90},{0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},{69,1,12,81,78,18,81,47,49,19,99,40,52,47,71,69,80,72,66,84,72,6,98,89,3,87,81,85,37,14,5,36,26,74}}; vector<int> param1 {36,2,21,9,26,27,9,33,9,22}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS{ static int f_gold ( int n ) { int [ ] [ ] arr = new int [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) arr [ i ] [ j ] = Math . abs ( i - j ) ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) sum += arr [ i ] [ j ] ; return sum ; }
def f_gold ( n ) : arr = [ [ 0 for x in range ( n ) ] for y in range ( n ) ] for i in range ( n ) : for j in range ( n ) : arr [ i ] [ j ] = abs ( i - j ) sum = 0 for i in range ( n ) : for j in range ( n ) : sum += arr [ i ] [ j ] return sum
using namespace std; int f_gold ( int n ) { int arr [ n ] [ n ]; for ( int i = 0; i < n; i ++ ) for ( int j = 0; j < n; j ++ ) arr [ i ] [ j ] = abs ( i - j ); int sum = 0; for ( int i = 0; i < n; i ++ ) for ( int j = 0; j < n; j ++ ) sum += arr [ i ] [ j ]; return sum; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(60); param0.add(44); param0.add(72); param0.add(90); param0.add(99); param0.add(45); param0.add(27); param0.add(11); param0.add(65); param0.add(52); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (60,), (44,), (72,), (90,), (99,), (45,), (27,), (11,), (65,), (52,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {60,44,72,90,99,45,27,11,65,52}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
WRITE_YOU_OWN_POWER_WITHOUT_USING_MULTIPLICATION_AND_DIVISION
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class WRITE_YOU_OWN_POWER_WITHOUT_USING_MULTIPLICATION_AND_DIVISION{ static int f_gold ( int a , int b ) { if ( b == 0 ) return 1 ; int answer = a ; int increment = a ; int i , j ; for ( i = 1 ; i < b ; i ++ ) { for ( j = 1 ; j < a ; j ++ ) { answer += increment ; } increment = answer ; } return answer ; }
def f_gold ( a , b ) : if ( b == 0 ) : return 1 answer = a increment = a for i in range ( 1 , b ) : for j in range ( 1 , a ) : answer += increment increment = answer return answer
using namespace std; int f_gold ( int a, int b ) { if ( b == 0 ) return 1; int answer = a; int increment = a; int i, j; for ( i = 1; i < b; i ++ ) { for ( j = 1; j < a; j ++ ) { answer += increment; } increment = answer; } return answer; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(66); param0.add(82); param0.add(12); param0.add(55); param0.add(34); param0.add(22); param0.add(13); param0.add(57); param0.add(76); param0.add(76); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(66); param1.add(38); param1.add(33); param1.add(26); param1.add(23); param1.add(98); param1.add(84); param1.add(94); param1.add(95); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (66,4,), (82,66,), (12,38,), (55,33,), (34,26,), (22,23,), (13,98,), (57,84,), (76,94,), (76,95,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {66,82,12,55,34,22,13,57,76,76}; vector<int> param1 {4,66,38,33,26,23,98,84,94,95}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
FIND_WHETHER_AN_ARRAY_IS_SUBSET_OF_ANOTHER_ARRAY_SET_1_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_WHETHER_AN_ARRAY_IS_SUBSET_OF_ANOTHER_ARRAY_SET_1_1{ static boolean f_gold ( int arr1 [ ] , int arr2 [ ] , int m , int n ) { int i = 0 , j = 0 ; if ( m < n ) return false ; Arrays . sort ( arr1 ) ; Arrays . sort ( arr2 ) ; while ( i < n && j < m ) { if ( arr1 [ j ] < arr2 [ i ] ) j ++ ; else if ( arr1 [ j ] == arr2 [ i ] ) { j ++ ; i ++ ; } else if ( arr1 [ j ] > arr2 [ i ] ) return false ; } if ( i < n ) return false ; else return true ; }
def f_gold ( arr1 , arr2 , m , n ) : i = 0 j = 0 if m < n : return 0 arr1.sort ( ) arr2.sort ( ) while i < n and j < m : if arr1 [ j ] < arr2 [ i ] : j += 1 elif arr1 [ j ] == arr2 [ i ] : j += 1 i += 1 elif arr1 [ j ] > arr2 [ i ] : return 0 return False if i < n else True
using namespace std; bool f_gold ( int arr1 [ ], int arr2 [ ], int m, int n ) { int i = 0, j = 0; if ( m < n ) return 0; sort ( arr1, arr1 + m ); sort ( arr2, arr2 + n ); while ( i < n && j < m ) { if ( arr1 [ j ] < arr2 [ i ] ) j ++; else if ( arr1 [ j ] == arr2 [ i ] ) { j ++; i ++; } else if ( arr1 [ j ] > arr2 [ i ] ) return 0; } return ( i < n ) ? false : true; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{7,10,10,10,13,17,23,24,25,28,30,33,37,49,49,50,57,60,60,63,63,64,65,65,72,81,84,85,85,94,96}); param0.add(new int[]{12,30,-94,-92,-62,-18,-56,44,-50,-92,6,2,56,-90,0,0,18,86,-58,58,-54,62,-94,94,0,8,82,-68,-88,-18,8,-80,-42,18,62,-8,56,-76,-42,56,44,-2,-20,62,-14,74,-86,-76}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{94,26,32,20,46,55,9,51,57,80,45,38,68,12,90,10,80,65,12,52,51,86,64,57,93,19,30,92,85,82,24,26,36,56}); param0.add(new int[]{-98,-90,-86,-86,-84,-84,-82,-80,-78,-72,-70,-68,-66,-64,-52,-52,-50,-38,-28,-26,-24,-14,-8,16,26,26,28,34,36,40,42,44,44,46,50,60,68,78,80,86,90,92,98}); param0.add(new int[]{1,0,1,0,1,0,0,0,1,0,0,0,0,1,1,0,1,1}); param0.add(new int[]{6,8,11,13,14,26,26,41,48,70,82,83,84,88,96}); param0.add(new int[]{-88,80,62,76,48,92,18,-94,-62,98,-46,-50,70,32,68,-54,26,16,94,0,-84,2,-16,88,26,-38,18,64,90,80,76,2,14,-90,50,4,76,30}); param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{54,44,97,92,13,54,27,8,43,70,77,84,55,64,5,59,27,19,65,68,66,26,33,38,7}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{10,13,17,63}); param1.add(new int[]{12, -18, 44}); param1.add(new int[]{0,0,0}); param1.add(new int[]{80,58,32,2}); param1.add(new int[]{-99,-90,-90,-86}); param1.add(new int[]{0,0,1,1}); param1.add(new int[]{1,9,12,16}); param1.add(new int[]{-76,-54,4,78}); param1.add(new int[]{0,1,0,1}); param1.add(new int[]{93,5,9,13}); List<Integer> param2 = new ArrayList<>(); param2.add(29); param2.add(46); param2.add(34); param2.add(17); param2.add(23); param2.add(10); param2.add(10); param2.add(27); param2.add(10); param2.add(19); List<Integer> param3 = new ArrayList<>(); param3.add(4); param3.add(3); param3.add(3); param3.add(4); param3.add(4); param3.add(4); param3.add(4); param3.add(4); param3.add(4); param3.add(4); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([7, 10, 10, 10, 13, 17, 23, 24, 25, 28, 30, 33, 37, 49, 49, 50, 57, 60, 60, 63, 63, 64, 65, 65, 72, 81, 84, 85, 85, 94, 96], [10,13,17,63],29,4,), ([12, 30, -94, -92, -62, -18, -56, 44, -50, -92, 6, 2, 56, -90, 0, 0, 18, 86, -58, 58, -54, 62, -94, 94, 0, 8, 82, -68, -88, -18, 8, -80, -42, 18, 62, -8, 56, -76, -42, 56, 44, -2, -20, 62, -14, 74, -86, -76], [12, -18, 44],46,3,), ([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], [0,0,0],34,3,), ([94, 26, 32, 20, 46, 55, 9, 51, 57, 80, 45, 38, 68, 12, 90, 10, 80, 65, 12, 52, 51, 86, 64, 57, 93, 19, 30, 92, 85, 82, 24, 26, 36, 56], [80,58,32,2],17,4,), ([-98, -90, -86, -86, -84, -84, -82, -80, -78, -72, -70, -68, -66, -64, -52, -52, -50, -38, -28, -26, -24, -14, -8, 16, 26, 26, 28, 34, 36, 40, 42, 44, 44, 46, 50, 60, 68, 78, 80, 86, 90, 92, 98], [-99,-90,-90,-86],23,4,), ([1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1], [0,0,1,1],10,4,), ([6, 8, 11, 13, 14, 26, 26, 41, 48, 70, 82, 83, 84, 88, 96], [1,9,12,16],10,4,), ([-88, 80, 62, 76, 48, 92, 18, -94, -62, 98, -46, -50, 70, 32, 68, -54, 26, 16, 94, 0, -84, 2, -16, 88, 26, -38, 18, 64, 90, 80, 76, 2, 14, -90, 50, 4, 76, 30], [-76,-54,4,78],27,4,), ([0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0,1,0,1],10,4,), ([54, 44, 97, 92, 13, 54, 27, 8, 43, 70, 77, 84, 55, 64, 5, 59, 27, 19, 65, 68, 66, 26, 33, 38, 7], [93,5,9,13],19,4,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{7,10,10,10,13,17,23,24,25,28,30,33,37,49,49,50,57,60,60,63,63,64,65,65,72,81,84,85,85,94,96},{12,30,-94,-92,-62,-18,-56,44,-50,-92,6,2,56,-90,0,0,18,86,-58,58,-54,62,-94,94,0,8,82,-68,-88,-18,8,-80,-42,18,62,-8,56,-76,-42,56,44,-2,-20,62,-14,74,-86,-76},{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},{94,26,32,20,46,55,9,51,57,80,45,38,68,12,90,10,80,65,12,52,51,86,64,57,93,19,30,92,85,82,24,26,36,56},{-98,-90,-86,-86,-84,-84,-82,-80,-78,-72,-70,-68,-66,-64,-52,-52,-50,-38,-28,-26,-24,-14,-8,16,26,26,28,34,36,40,42,44,44,46,50,60,68,78,80,86,90,92,98},{1,0,1,0,1,0,0,0,1,0,0,0,0,1,1,0,1,1},{6,8,11,13,14,26,26,41,48,70,82,83,84,88,96},{-88,80,62,76,48,92,18,-94,-62,98,-46,-50,70,32,68,-54,26,16,94,0,-84,2,-16,88,26,-38,18,64,90,80,76,2,14,-90,50,4,76,30},{0,0,0,0,0,1,1,1,1,1,1,1},{54,44,97,92,13,54,27,8,43,70,77,84,55,64,5,59,27,19,65,68,66,26,33,38,7}}; vector<vector<int>> param1 { {10,13,17,63}, {12, -18, 44}, {0,0,0}, {80,58,32,2}, {-99,-90,-90,-86}, {0,0,1,1}, {1,9,12,16}, {-76,-54,4,78}, {0,1,0,1}, {93,5,9,13}}; vector<int> param2 {29,46,34,17,23,10,10,27,10,19}; vector<int> param3 {4,3,3,4,4,4,4,4,4,4}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),&param1[i].front(),param2[i],param3[i]) == f_gold(&param0[i].front(),&param1[i].front(),param2[i],param3[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SORT_EVEN_PLACED_ELEMENTS_INCREASING_ODD_PLACED_DECREASING_ORDER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SPLIT_ARRAY_ADD_FIRST_PART_END{ public static void f_gold ( int arr [ ] , int n , int k ) { for ( int i = 0 ; i < k ; i ++ ) { int x = arr [ 0 ] ; for ( int j = 0 ; j < n - 1 ; ++ j ) arr [ j ] = arr [ j + 1 ] ; arr [ n - 1 ] = x ; } }
def f_gold ( arr , n ) : evenArr = [ ] oddArr = [ ] for i in range ( n ) : if ( ( i % 2 ) == 0 ) : evenArr.append ( arr [ i ] ) else : oddArr.append ( arr [ i ] ) evenArr = sorted ( evenArr ) oddArr = sorted ( oddArr ) oddArr = oddArr [ : : - 1 ] i = 0 for j in range ( len ( evenArr ) ) : arr [ i ] = evenArr [ j ] i += 1 for j in range ( len ( oddArr ) ) : arr [ i ] = oddArr [ j ] i += 1
using namespace std; void f_gold ( int arr [ ], int n ) { vector < int > evenArr; vector < int > oddArr; for ( int i = 0; i < n; i ++ ) { if ( ! ( i % 2 ) ) evenArr . push_back ( arr [ i ] ); else oddArr . push_back ( arr [ i ] ); } sort ( evenArr . begin ( ), evenArr . end ( ) ); sort ( oddArr . begin ( ), oddArr . end ( ), greater < int > ( ) ); int i = 0; for ( int j = 0; j < evenArr . size ( ); j ++ ) arr [ i ++ ] = evenArr [ j ]; for ( int j = 0; j < oddArr . size ( ); j ++ ) arr [ i ++ ] = oddArr [ j ]; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{75}); param0.add(new int[]{-58,-60,-38,48,-2,32,-48,-46,90,-54,-18,28,72,86,0,-2,-74,12,-58,90,-30,10,-88,2,-14,82,-82,-46,2,-74}); param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{45,51,26,36,10,62,62,56,61,67,86,97,31,93,32,1,14,25,24,30,1,44,7,98,56,68,53,59,30,90,79,22}); param0.add(new int[]{-88,-72,-64,-46,-40,-16,-8,0,22,34,44}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,1,0,0,1,1,1,1,0}); param0.add(new int[]{8,17,20,23,31,32,37,37,44,45,48,64,64,67,69,71,75,77,78,81,83,87,89,92,94}); param0.add(new int[]{-8,-88,-68,48,8,50,30,-88,74,-16,6,74,36,32,22,96,-2,70,40,-46,98,34,2,94}); param0.add(new int[]{0,0,0,0,1,1,1,1,1}); param0.add(new int[]{80,14,35,25,60,86,45,95,32,29,94,6,63,66,38}); List<Integer> param1 = new ArrayList<>(); param1.add(0); param1.add(27); param1.add(7); param1.add(23); param1.add(6); param1.add(23); param1.add(21); param1.add(23); param1.add(5); param1.add(9); List<Integer> param2 = new ArrayList<>(); param2.add(0); param2.add(17); param2.add(7); param2.add(24); param2.add(6); param2.add(30); param2.add(20); param2.add(13); param2.add(8); param2.add(7); List<int [ ]> filled_function_param0 = new ArrayList<>(); filled_function_param0.add(new int[]{75}); filled_function_param0.add(new int[]{-58,-60,-38,48,-2,32,-48,-46,90,-54,-18,28,72,86,0,-2,-74,12,-58,90,-30,10,-88,2,-14,82,-82,-46,2,-74}); filled_function_param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1}); filled_function_param0.add(new int[]{45,51,26,36,10,62,62,56,61,67,86,97,31,93,32,1,14,25,24,30,1,44,7,98,56,68,53,59,30,90,79,22}); filled_function_param0.add(new int[]{-88,-72,-64,-46,-40,-16,-8,0,22,34,44}); filled_function_param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,1,0,0,1,1,1,1,0}); filled_function_param0.add(new int[]{8,17,20,23,31,32,37,37,44,45,48,64,64,67,69,71,75,77,78,81,83,87,89,92,94}); filled_function_param0.add(new int[]{-8,-88,-68,48,8,50,30,-88,74,-16,6,74,36,32,22,96,-2,70,40,-46,98,34,2,94}); filled_function_param0.add(new int[]{0,0,0,0,1,1,1,1,1}); filled_function_param0.add(new int[]{80,14,35,25,60,86,45,95,32,29,94,6,63,66,38}); List<Integer> filled_function_param1 = new ArrayList<>(); filled_function_param1.add(0); filled_function_param1.add(27); filled_function_param1.add(7); filled_function_param1.add(23); filled_function_param1.add(6); filled_function_param1.add(23); filled_function_param1.add(21); filled_function_param1.add(23); filled_function_param1.add(5); filled_function_param1.add(9); List<Integer> filled_function_param2 = new ArrayList<>(); filled_function_param2.add(0); filled_function_param2.add(17); filled_function_param2.add(7); filled_function_param2.add(24); filled_function_param2.add(6); filled_function_param2.add(30); filled_function_param2.add(20); filled_function_param2.add(13); filled_function_param2.add(8); filled_function_param2.add(7); for(int i = 0; i < param0.size(); ++i) { f_filled(filled_function_param0.get(i),filled_function_param1.get(i),filled_function_param2.get(i)); f_gold(param0.get(i),param1.get(i),param2.get(i)); if(Arrays.equals(param0.get(i), filled_function_param0.get(i)) && param1.get(i) == filled_function_param1.get(i) && param2.get(i) == filled_function_param2.get(i)) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([6, 6, 6, 10, 15, 21, 38, 50, 51, 72, 79, 81, 82, 84, 85, 86, 87],15,), ([82, -36, 18, -88, -24, 20, 26, -52, 28, 2],7,), ([0, 0, 0, 1, 1, 1],3,), ([81, 47, 38, 70, 35, 43, 94, 30, 57, 55, 78, 97, 72, 1],8,), ([-80, -78, -72, -46, -26, -24, -20, 8, 16, 26, 38, 44, 54, 68, 68, 78, 86, 92],11,), ([0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0],21,), ([3, 4, 9, 12, 20, 30, 33, 34, 37, 38, 50, 51, 52, 54, 60, 69, 73, 74, 92, 93, 94, 97, 98],13,), ([86, -32, 64, -36, -36, -30, -66, -60, -76, -56, -60, -16, -60, -98, -18, 72, -14],10,), ([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],29,), ([61, 11, 46, 40, 82, 35, 37, 41, 52, 76, 13, 53, 53, 3, 40, 29, 7, 51, 20, 51, 87, 1, 80, 73, 89, 93, 1, 71, 33, 50, 62, 85, 46, 1, 71, 54, 81, 85],36,) ] filled_function_param = [ ([6, 6, 6, 10, 15, 21, 38, 50, 51, 72, 79, 81, 82, 84, 85, 86, 87],15,), ([82, -36, 18, -88, -24, 20, 26, -52, 28, 2],7,), ([0, 0, 0, 1, 1, 1],3,), ([81, 47, 38, 70, 35, 43, 94, 30, 57, 55, 78, 97, 72, 1],8,), ([-80, -78, -72, -46, -26, -24, -20, 8, 16, 26, 38, 44, 54, 68, 68, 78, 86, 92],11,), ([0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0],21,), ([3, 4, 9, 12, 20, 30, 33, 34, 37, 38, 50, 51, 52, 54, 60, 69, 73, 74, 92, 93, 94, 97, 98],13,), ([86, -32, 64, -36, -36, -30, -66, -60, -76, -56, -60, -16, -60, -98, -18, 72, -14],10,), ([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],29,), ([61, 11, 46, 40, 82, 35, 37, 41, 52, 76, 13, 53, 53, 3, 40, 29, 7, 51, 20, 51, 87, 1, 80, 73, 89, 93, 1, 71, 33, 50, 62, 85, 46, 1, 71, 54, 81, 85],36,) ] n_success = 0 for i, parameters_set in enumerate(param): f_filled(*(filled_function_param[i])) f_gold(*parameters_set) if parameters_set == filled_function_param[i]: n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{6,6,6,10,15,21,38,50,51,72,79,81,82,84,85,86,87},{82,-36,18,-88,-24,20,26,-52,28,2},{0,0,0,1,1,1},{81,47,38,70,35,43,94,30,57,55,78,97,72,1},{-80,-78,-72,-46,-26,-24,-20,8,16,26,38,44,54,68,68,78,86,92},{0,0,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,0,0,1,0,1,1,1,1,1,0,0,0},{3,4,9,12,20,30,33,34,37,38,50,51,52,54,60,69,73,74,92,93,94,97,98},{86,-32,64,-36,-36,-30,-66,-60,-76,-56,-60,-16,-60,-98,-18,72,-14},{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},{61,11,46,40,82,35,37,41,52,76,13,53,53,3,40,29,7,51,20,51,87,1,80,73,89,93,1,71,33,50,62,85,46,1,71,54,81,85}}; vector<int> param1 {15,7,3,8,11,21,13,10,29,36}; vector<vector<int>> filled_function_param0 {{6,6,6,10,15,21,38,50,51,72,79,81,82,84,85,86,87},{82,-36,18,-88,-24,20,26,-52,28,2},{0,0,0,1,1,1},{81,47,38,70,35,43,94,30,57,55,78,97,72,1},{-80,-78,-72,-46,-26,-24,-20,8,16,26,38,44,54,68,68,78,86,92},{0,0,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,0,0,1,0,1,1,1,1,1,0,0,0},{3,4,9,12,20,30,33,34,37,38,50,51,52,54,60,69,73,74,92,93,94,97,98},{86,-32,64,-36,-36,-30,-66,-60,-76,-56,-60,-16,-60,-98,-18,72,-14},{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},{61,11,46,40,82,35,37,41,52,76,13,53,53,3,40,29,7,51,20,51,87,1,80,73,89,93,1,71,33,50,62,85,46,1,71,54,81,85}}; vector<int> filled_function_param1 {15,7,3,8,11,21,13,10,29,36}; for(int i = 0; i < param0.size(); ++i) { f_filled(&filled_function_param0[i].front(),filled_function_param1[i]); f_gold(&param0[i].front(),param1[i]); if(equal(begin(param0[i]), end(param0[i]), begin(filled_function_param0[i])) && param1[i] == filled_function_param1[i]) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CHECK_IF_A_NUMBER_IS_POWER_OF_ANOTHER_NUMBER_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_IF_A_NUMBER_IS_POWER_OF_ANOTHER_NUMBER_1{ static boolean f_gold ( int x , int y ) { int res1 = ( int ) Math . log ( y ) / ( int ) Math . log ( x ) ; double res2 = Math . log ( y ) / Math . log ( x ) ; return ( res1 == res2 ) ; }
import math def f_gold ( x , y ) : res1 = math.log ( y ) / math.log ( x ) ; res2 = math.log ( y ) / math.log ( x ) ; return 1 if ( res1 == res2 ) else 0 ;
using namespace std; bool f_gold ( int x, int y ) { int res1 = log ( y ) / log ( x ); double res2 = log ( y ) / log ( x ); return ( res1 == res2 ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(57); param0.add(3); param0.add(10); param0.add(10); param0.add(6); param0.add(2); param0.add(2); param0.add(20); param0.add(96); param0.add(25); List<Integer> param1 = new ArrayList<>(); param1.add(1); param1.add(9); param1.add(101); param1.add(10000); param1.add(46656); param1.add(2048); param1.add(40); param1.add(79); param1.add(98); param1.add(5); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (57,1,), (3,9,), (10,101,), (10,10000,), (6,46656,), (2,2048,), (2,40,), (20,79,), (96,98,), (25,5,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {57,3,10,10,6,2,2,20,96,25}; vector<int> param1 {1,9,101,10000,46656,2048,40,79,98,5}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
POLICEMEN_CATCH_THIEVES
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class POLICEMEN_CATCH_THIEVES{ static int f_gold ( char arr [ ] , int n , int k ) { int res = 0 ; ArrayList < Integer > thi = new ArrayList < Integer > ( ) ; ArrayList < Integer > pol = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == 'P' ) pol . add ( i ) ; else if ( arr [ i ] == 'T' ) thi . add ( i ) ; } int l = 0 , r = 0 ; while ( l < thi . size ( ) && r < pol . size ( ) ) { if ( Math . abs ( thi . get ( l ) - pol . get ( r ) ) <= k ) { res ++ ; l ++ ; r ++ ; } else if ( thi . get ( l ) < pol . get ( r ) ) l ++ ; else r ++ ; } return res ; }
def f_gold ( arr , n , k ) : i = 0 l = 0 r = 0 res = 0 thi = [ ] pol = [ ] while i < n : if arr [ i ] == 'P' : pol.append ( i ) elif arr [ i ] == 'T' : thi.append ( i ) i += 1 while l < len ( thi ) and r < len ( pol ) : if ( abs ( thi [ l ] - pol [ r ] ) <= k ) : res += 1 l += 1 r += 1 elif thi [ l ] < pol [ r ] : l += 1 else : r += 1 return res
using namespace std; int f_gold ( char arr [ ], int n, int k ) { int res = 0; vector < int > thi; vector < int > pol; for ( int i = 0; i < n; i ++ ) { if ( arr [ i ] == 'P' ) pol . push_back ( i ); else if ( arr [ i ] == 'T' ) thi . push_back ( i ); } int l = 0, r = 0; while ( l < thi . size ( ) && r < pol . size ( ) ) { if ( abs ( thi [ l ] - pol [ r ] ) <= k ) { res ++; l ++; r ++; } else if ( thi [ l ] < pol [ r ] ) l ++; else r ++; } return res; }
public static void main(String args[]) { int n_success = 0; List<char [ ]> param0 = new ArrayList<>(); param0.add(new char[]{'A','B','B','D','E','E','F','G','G','G','I','J','O','P','Q','Q','Q','Q','R','R','S','U','X','Y','Y','c','d','h','i','i','i','i','k','k','l','l','l','l','m','p','r','r','s','t','t','u','x','z'}); param0.add(new char[]{'7','6','0','1','0','1'}); param0.add(new char[]{'0','0','0','0','0','0','0','0','0','1','1','1','1','1','1','1','1','1'}); param0.add(new char[]{'y','k','S','i','s','r','i','z','y','f','E','U','y','G','f','f','s','v','v','D','v','V','S','D','K','S','f','V','g','I','J','p','j','k','R','n','m','O','L','X','y','U','y','k','w'}); param0.add(new char[]{'1','1','5','8','8'}); param0.add(new char[]{'0','1','0','0','1','1','1','0','0','0','1','0','1','0','1','0','0','0','0','0','1','0','0','0','0','1','1','1','0','0','0','0','0','0'}); param0.add(new char[]{'A','I','K','Q','Q','X','Z','f','g'}); param0.add(new char[]{'7','0','6','9','7','5','1','3','9','8','0','0','1','3','9','2','5','5','2','7','9','3','3','9','3','8','5','5','0','4','6','2','7','4','0','4','6','4','2','3'}); param0.add(new char[]{'0','0','0','1','1','1','1','1','1','1','1'}); param0.add(new char[]{'D','C','P','H','G','o','u','P','T','G','E','U','n','E','U'}); List<Integer> param1 = new ArrayList<>(); param1.add(33); param1.add(3); param1.add(9); param1.add(24); param1.add(2); param1.add(23); param1.add(5); param1.add(35); param1.add(8); param1.add(11); List<Integer> param2 = new ArrayList<>(); param2.add(45); param2.add(3); param2.add(10); param2.add(44); param2.add(2); param2.add(18); param2.add(8); param2.add(28); param2.add(10); param2.add(12); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (['A', 'B', 'B', 'D', 'E', 'E', 'F', 'G', 'G', 'G', 'I', 'J', 'O', 'P', 'Q', 'Q', 'Q', 'Q', 'R', 'R', 'S', 'U', 'X', 'Y', 'Y', 'c', 'd', 'h', 'i', 'i', 'i', 'i', 'k', 'k', 'l', 'l', 'l', 'l', 'm', 'p', 'r', 'r', 's', 't', 't', 'u', 'x', 'z'],33,45,), (['7', '6', '0', '1', '0', '1'],3,3,), (['0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1'],9,10,), (['y', 'k', 'S', 'i', 's', 'r', 'i', 'z', 'y', 'f', 'E', 'U', 'y', 'G', 'f', 'f', 's', 'v', 'v', 'D', 'v', 'V', 'S', 'D', 'K', 'S', 'f', 'V', 'g', 'I', 'J', 'p', 'j', 'k', 'R', 'n', 'm', 'O', 'L', 'X', 'y', 'U', 'y', 'k', 'w'],24,44,), (['1', '1', '5', '8', '8'],2,2,), (['0', '1', '0', '0', '1', '1', '1', '0', '0', '0', '1', '0', '1', '0', '1', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '1', '1', '1', '0', '0', '0', '0', '0', '0'],23,18,), (['A', 'I', 'K', 'Q', 'Q', 'X', 'Z', 'f', 'g'],5,8,), (['7', '0', '6', '9', '7', '5', '1', '3', '9', '8', '0', '0', '1', '3', '9', '2', '5', '5', '2', '7', '9', '3', '3', '9', '3', '8', '5', '5', '0', '4', '6', '2', '7', '4', '0', '4', '6', '4', '2', '3'],35,28,), (['0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1'],8,10,), (['D', 'C', 'P', 'H', 'G', 'o', 'u', 'P', 'T', 'G', 'E', 'U', 'n', 'E', 'U'],11,12,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<char>> param0 {{'A','B','B','D','E','E','F','G','G','G','I','J','O','P','Q','Q','Q','Q','R','R','S','U','X','Y','Y','c','d','h','i','i','i','i','k','k','l','l','l','l','m','p','r','r','s','t','t','u','x','z'},{'7','6','0','1','0','1'},{'0','0','0','0','0','0','0','0','0','1','1','1','1','1','1','1','1','1'},{'y','k','S','i','s','r','i','z','y','f','E','U','y','G','f','f','s','v','v','D','v','V','S','D','K','S','f','V','g','I','J','p','j','k','R','n','m','O','L','X','y','U','y','k','w'},{'1','1','5','8','8'},{'0','1','0','0','1','1','1','0','0','0','1','0','1','0','1','0','0','0','0','0','1','0','0','0','0','1','1','1','0','0','0','0','0','0'},{'A','I','K','Q','Q','X','Z','f','g'},{'7','0','6','9','7','5','1','3','9','8','0','0','1','3','9','2','5','5','2','7','9','3','3','9','3','8','5','5','0','4','6','2','7','4','0','4','6','4','2','3'},{'0','0','0','1','1','1','1','1','1','1','1'},{'D','C','P','H','G','o','u','P','T','G','E','U','n','E','U'}}; vector<int> param1 {33,3,9,24,2,23,5,35,8,11}; vector<int> param2 {45,3,10,44,2,18,8,28,10,12}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i],param2[i]) == f_gold(&param0[i].front(),param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
DYNAMIC_PROGRAMMING_SET_36_CUT_A_ROPE_TO_MAXIMIZE_PRODUCT_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DYNAMIC_PROGRAMMING_SET_36_CUT_A_ROPE_TO_MAXIMIZE_PRODUCT_1{ static int f_gold ( int n ) { if ( n == 2 || n == 3 ) return ( n - 1 ) ; int res = 1 ; while ( n > 4 ) { n -= 3 ; res *= 3 ; } return ( n * res ) ; }
def f_gold(n): if (n == 2 or n == 3): return (n - 1) res = 1 while (n > 4): n -= 3 res *= 3 return (n * res)
using namespace std; int f_gold ( int n ) { if ( n == 2 || n == 3 ) return ( n - 1 ); int res = 1; while ( n > 4 ) { n -= 3; res *= 3; } return ( n * res ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(62); param0.add(53); param0.add(8); param0.add(6); param0.add(35); param0.add(35); param0.add(46); param0.add(74); param0.add(69); param0.add(3); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (62,), (53,), (8,), (6,), (35,), (35,), (46,), (74,), (69,), (3,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success += 1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {62,53,8,6,35,35,46,74,69,3}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING{ static char f_gold ( String str ) { int len = str . length ( ) ; int count = 0 ; char res = str . charAt ( 0 ) ; for ( int i = 0 ; i < len ; i ++ ) { int cur_count = 1 ; for ( int j = i + 1 ; j < len ; j ++ ) { if ( str . charAt ( i ) != str . charAt ( j ) ) break ; cur_count ++ ; } if ( cur_count > count ) { count = cur_count ; res = str . charAt ( i ) ; } } return res ; }
def f_gold ( str ) : l = len ( str ) count = 0 res = str [ 0 ] for i in range ( l ) : cur_count = 1 for j in range ( i + 1 , l ) : if ( str [ i ] != str [ j ] ) : break cur_count += 1 if cur_count > count : count = cur_count res = str [ i ] return res
using namespace std; char f_gold ( string str ) { int len = str . length ( ); int count = 0; char res = str [ 0 ]; for ( int i = 0; i < len; i ++ ) { int cur_count = 1; for ( int j = i + 1; j < len; j ++ ) { if ( str [ i ] != str [ j ] ) break; cur_count ++; } if ( cur_count > count ) { count = cur_count; res = str [ i ]; } } return res; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("geeekk"); param0.add("3786868"); param0.add("110"); param0.add("aaaabbcbbb"); param0.add("11"); param0.add("011101"); param0.add("WoHNyJYLC"); param0.add("3141711779"); param0.add("10111101101"); param0.add("aabbabababcc"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('geeekk',), ('3786868',), ('110',), ('aaaabbcbbb',), ('11',), ('011101',), ('WoHNyJYLC',), ('3141711779',), ('10111101101',), ('aabbabababcc',) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 {"geeekk","3786868","110","aaaabbcbbb","11","011101","WoHNyJYLC","3141711779","10111101101","aabbabababcc"}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
COUNT_NEGATIVE_NUMBERS_IN_A_COLUMN_WISE_ROW_WISE_SORTED_MATRIX
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_NEGATIVE_NUMBERS_IN_A_COLUMN_WISE_ROW_WISE_SORTED_MATRIX{ static int f_gold ( int M [ ] [ ] , int n , int m ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { if ( M [ i ] [ j ] < 0 ) count += 1 ; else break ; } } return count ; }
def f_gold ( M , n , m ) : count = 0 for i in range ( n ) : for j in range ( m ) : if M [ i ] [ j ] < 0 : count += 1 else : break return count
null
public static void main(String args[]) { int n_success = 0; List<int [ ] [ ]> param0 = new ArrayList<>(); param0.add(new int[][]{new int[]{31,92,57,28,79,84,92,19,31,71,91,46,60,79,82,4,70,82,41,79,80,29,26,76,92,18,94,55,46,69,67,60,85,25,11},new int[]{58,69,14,55,6,69,81,60,38,52,81,80,1,47,42,82,2,70,68,71,50,98,84,1,45,24,49,33,56,4,60,42,14,45,13},new int[]{28,92,91,71,75,97,30,9,76,94,55,84,76,38,32,7,73,49,37,76,41,3,89,56,71,99,71,25,94,37,43,9,89,55,55},new int[]{77,31,94,14,2,88,64,71,57,18,81,51,66,82,16,46,15,28,48,54,49,34,80,12,26,64,41,46,32,87,18,12,38,28,88},new int[]{84,93,86,10,92,89,62,65,33,66,92,52,28,49,98,37,49,91,42,64,43,12,83,61,51,11,80,35,28,50,35,1,31,81,77},new int[]{22,30,43,76,37,59,48,82,40,2,66,58,7,13,38,73,14,28,55,52,28,10,98,93,97,27,1,50,80,83,11,82,80,7,38},new int[]{54,30,50,31,57,2,73,56,24,35,85,99,28,51,83,86,82,30,72,98,40,81,15,5,18,76,62,5,50,37,99,46,31,16,66},new int[]{52,62,92,37,29,66,66,98,1,56,60,85,43,98,46,34,21,71,28,84,92,93,58,79,3,37,76,14,63,33,46,8,2,56,31},new int[]{70,69,43,26,58,80,60,28,24,79,42,80,16,52,17,93,25,16,77,35,39,16,77,19,45,27,96,44,30,88,76,6,18,2,33},new int[]{1,6,28,49,25,25,14,31,5,60,78,45,20,88,9,80,72,46,75,90,26,11,25,77,22,39,83,65,95,64,78,86,23,48,20},new int[]{98,5,39,62,57,87,52,68,32,98,90,99,67,81,94,96,15,44,13,17,47,35,84,14,23,69,5,96,42,42,65,60,10,10,88},new int[]{4,91,15,32,39,40,39,26,25,26,35,22,5,46,72,27,44,23,49,67,9,17,64,74,68,84,94,76,22,22,30,29,26,63,51},new int[]{10,53,32,7,39,74,91,85,79,47,47,11,54,51,43,75,19,74,33,27,15,29,96,96,87,83,62,32,79,62,43,62,97,87,16},new int[]{11,15,6,98,56,59,40,13,99,53,48,46,99,16,59,58,21,57,89,63,67,50,71,98,10,49,78,39,5,64,9,7,60,86,83},new int[]{94,9,64,64,80,70,1,77,15,64,69,43,40,56,82,28,15,92,40,38,61,74,32,1,95,30,5,43,1,8,57,5,5,97,54},new int[]{79,58,95,22,97,60,97,87,35,14,58,59,86,89,57,33,1,71,16,48,77,69,6,99,74,96,79,98,65,86,32,45,61,49,36},new int[]{19,37,45,27,48,21,83,82,96,85,83,54,37,22,38,43,45,28,84,91,38,16,58,46,48,20,61,8,90,66,42,47,65,60,15},new int[]{48,19,73,34,64,86,86,4,50,81,67,14,28,49,83,56,97,24,38,84,39,82,1,14,7,32,90,7,7,47,85,55,96,87,83},new int[]{70,68,59,18,72,95,7,62,53,22,82,64,72,3,24,52,26,41,30,19,47,55,13,10,69,54,93,42,44,49,72,18,29,70,85},new int[]{96,40,94,49,87,60,26,23,86,18,72,90,32,11,48,47,94,96,98,59,11,19,27,49,62,29,23,22,1,88,54,41,39,76,44},new int[]{45,99,44,67,5,80,36,33,89,52,2,49,74,36,7,14,57,67,62,97,22,92,44,2,65,67,58,91,56,84,53,49,11,13,24},new int[]{69,81,60,52,34,72,33,56,28,17,3,62,7,78,40,19,95,42,49,77,90,42,22,1,60,92,65,28,11,83,19,59,52,45,26},new int[]{23,17,21,54,31,32,81,15,13,65,62,16,21,70,6,84,5,91,37,20,89,73,3,65,86,24,27,11,98,92,54,23,9,1,90},new int[]{53,67,14,42,52,55,52,86,99,43,74,48,71,55,85,87,73,41,55,52,83,67,78,14,15,27,83,28,65,35,45,33,59,13,34},new int[]{29,4,17,82,11,18,95,71,10,34,79,43,45,58,9,26,84,9,49,6,63,41,43,75,35,54,55,18,81,55,2,53,1,67,87},new int[]{98,3,18,56,33,97,20,90,38,80,83,80,18,94,11,43,60,85,30,2,89,85,32,35,62,32,93,71,62,93,24,33,86,21,32},new int[]{38,45,16,40,18,67,71,49,46,98,64,83,35,78,40,86,28,66,77,24,31,10,82,1,31,9,47,39,84,51,1,6,32,4,63},new int[]{85,48,64,11,29,77,59,1,99,17,17,38,49,78,82,50,87,75,18,75,73,98,17,27,51,4,98,96,6,74,5,47,52,47,75},new int[]{36,68,16,99,38,84,45,71,71,36,3,97,69,15,48,77,6,4,33,36,67,65,52,55,37,35,76,69,98,84,62,5,80,15,36},new int[]{67,84,38,44,5,66,58,57,67,75,61,66,60,2,66,50,6,83,91,86,67,99,1,32,71,91,52,29,51,73,23,32,4,75,25},new int[]{24,94,50,60,28,73,99,1,10,37,54,96,56,46,19,9,57,78,19,70,76,25,14,87,13,22,63,73,97,3,19,39,16,36,22},new int[]{92,41,48,68,30,72,1,76,98,58,57,61,32,11,58,29,80,86,22,94,50,66,78,22,91,56,91,82,61,67,12,18,46,99,69},new int[]{49,64,35,55,67,78,11,71,12,98,10,9,82,35,61,40,29,10,83,11,63,16,97,97,96,91,30,97,21,91,32,61,27,33,35},new int[]{29,58,88,23,96,94,1,55,79,30,87,83,5,70,25,62,14,67,29,22,84,2,25,75,11,57,89,65,80,82,36,28,45,44,4},new int[]{70,94,49,13,26,24,42,24,58,83,41,6,50,78,22,12,21,84,70,28,44,51,78,75,9,70,37,23,60,25,68,97,49,17,27}}); param0.add(new int[][]{new int[]{22,49,27,1,69,48,44,18,89,36,93,10,67,18,7,62,55,3,84,76,49,57},new int[]{59,6,37,2,33,16,20,60,69,98,92,2,70,12,99,57,32,92,64,92,68,62},new int[]{41,89,70,69,62,88,52,23,8,37,77,87,54,44,87,32,53,29,38,80,68,32},new int[]{63,77,82,97,7,56,2,68,44,52,40,8,71,50,26,62,18,61,12,20,1,76},new int[]{44,47,86,67,53,27,80,57,53,74,7,11,86,58,7,55,30,57,23,97,38,33},new int[]{48,84,9,77,60,53,41,15,99,30,90,36,89,64,78,63,51,51,22,17,72,50},new int[]{14,56,77,30,59,64,26,22,86,92,80,88,63,46,81,3,81,64,14,72,14,77},new int[]{36,48,97,59,34,64,11,24,41,30,37,66,33,98,60,27,76,90,48,10,90,41},new int[]{76,54,4,86,40,31,85,51,38,72,28,12,35,99,78,12,13,49,34,33,21,83},new int[]{37,15,61,52,17,81,90,44,16,13,2,92,88,84,18,99,10,71,82,33,75,44},new int[]{40,49,88,11,67,52,39,2,92,49,52,31,77,97,51,31,66,98,66,37,25,62},new int[]{99,9,6,66,15,61,15,58,33,62,80,65,59,1,79,54,78,51,97,19,83,59},new int[]{3,76,87,47,71,66,86,18,79,62,44,67,5,82,94,27,48,2,88,34,55,46},new int[]{38,66,48,93,40,7,6,14,82,56,83,2,8,58,21,26,90,10,85,3,8,78},new int[]{54,43,93,86,42,41,87,70,67,60,90,78,66,42,30,57,76,2,30,24,12,49},new int[]{12,5,75,55,17,62,87,21,91,88,10,20,49,46,79,51,33,94,59,48,97,70},new int[]{49,75,21,53,2,92,14,80,92,40,84,67,39,48,53,49,68,57,14,58,97,9},new int[]{45,23,2,43,89,62,28,46,74,38,70,84,67,22,62,86,72,24,39,5,64,43},new int[]{28,93,44,61,47,23,52,97,62,31,98,1,63,7,86,46,66,61,24,14,15,62},new int[]{60,58,17,60,19,91,78,22,56,84,99,91,42,55,30,83,84,42,86,73,76,53},new int[]{95,93,92,53,56,72,31,67,4,61,39,88,64,94,48,88,23,54,37,10,18,67},new int[]{97,70,9,43,34,94,43,71,13,81,56,73,85,54,35,89,45,18,8,54,70,36}}); param0.add(new int[][]{new int[]{54,62,19,8,61,82,54,69,91,14,56,78,22,81,38,47},new int[]{22,25,33,85,89,78,7,42,24,24,24,74,89,83,23,1},new int[]{79,9,51,67,71,49,87,45,81,2,4,50,16,71,91,44},new int[]{77,99,85,40,90,45,3,54,39,69,40,88,81,41,84,24},new int[]{84,24,42,18,51,45,16,97,97,64,56,35,9,33,37,97},new int[]{61,55,53,21,5,1,71,23,87,71,59,83,27,77,9,9},new int[]{60,42,94,10,69,95,98,38,54,64,17,71,83,38,60,38},new int[]{2,45,33,60,92,31,55,48,31,19,79,9,81,47,4,38},new int[]{68,16,10,37,43,45,10,93,47,99,74,88,79,85,2,27},new int[]{69,72,66,74,32,60,90,70,88,68,15,72,65,35,87,75},new int[]{49,36,73,88,81,8,78,65,98,35,5,5,46,53,39,92},new int[]{5,39,16,95,34,59,36,19,80,5,69,39,26,45,15,11},new int[]{14,95,52,74,90,61,75,19,71,69,37,45,8,71,49,26},new int[]{71,95,22,95,95,48,53,75,96,68,82,99,9,15,4,54},new int[]{26,94,94,81,47,4,22,74,41,98,98,11,89,77,7,65},new int[]{47,37,49,52,68,83,51,70,32,47,60,93,61,10,21,42}}); param0.add(new int[][]{new int[]{39,79,41,68,91,31,87,47,16,92,42,68,79,59,17,45,68,78,99,19,51},new int[]{43,46,81,76,18,20,62,54,42,52,8,66,3,79,60,12,50,87,88,70,11},new int[]{49,2,91,98,51,74,47,72,32,42,92,52,98,89,9,91,86,38,78,89,42},new int[]{45,76,87,45,3,88,56,16,16,59,78,40,9,7,55,69,58,39,64,2,32},new int[]{65,45,40,81,13,71,33,46,27,47,92,5,9,75,80,2,90,50,40,4,1},new int[]{99,5,44,17,65,99,27,27,5,1,87,95,78,27,4,40,57,79,82,46,33},new int[]{99,3,6,49,52,24,66,91,66,84,92,96,48,24,81,69,46,58,16,49,83},new int[]{2,42,95,3,17,63,45,82,69,10,86,44,64,55,2,44,93,16,98,3,41},new int[]{27,2,95,31,58,64,21,14,90,14,86,42,84,47,4,82,70,47,97,1,49},new int[]{59,74,19,7,3,89,77,72,52,57,86,31,70,55,89,25,43,52,24,50,30},new int[]{89,57,9,45,89,74,76,89,23,90,57,77,38,25,49,3,85,90,90,26,47},new int[]{55,39,1,53,31,10,76,47,77,33,6,22,29,95,29,14,32,28,27,11,93},new int[]{95,75,56,23,21,30,76,98,25,79,41,3,63,87,96,53,92,40,74,22,8},new int[]{91,35,88,59,74,92,5,6,56,42,97,80,14,45,12,61,63,79,73,52,81},new int[]{73,86,4,14,11,1,47,35,12,99,37,31,61,86,60,17,28,82,3,18,20},new int[]{46,85,58,67,3,32,53,13,86,7,78,12,29,48,58,37,77,43,75,14,42},new int[]{38,93,44,22,94,76,29,63,20,19,51,57,53,11,9,63,24,43,51,11,37},new int[]{19,71,53,61,91,91,20,99,7,81,88,37,29,9,23,10,22,38,55,89,29},new int[]{62,33,81,98,9,79,80,50,63,67,64,95,69,84,22,4,98,71,1,81,77},new int[]{97,1,28,52,20,16,45,31,69,9,98,60,55,97,5,3,95,77,65,54,32},new int[]{71,97,30,68,74,7,15,99,62,39,20,55,30,22,20,31,54,31,93,10,80}}); param0.add(new int[][]{new int[]{48,19,66,15,8,54,8,66,22,72,93,33,96,26,89,57,86,16,99,75,9,20,36,26},new int[]{67,60,72,35,68,26,18,53,54,82,23,15,89,43,82,1,33,46,61,87,93,27,33,21},new int[]{7,78,68,44,49,95,1,16,16,7,1,92,3,44,47,52,31,61,41,28,95,28,51,46},new int[]{98,90,93,45,10,2,88,20,1,67,2,75,27,31,68,59,11,50,4,40,5,61,34,24},new int[]{41,37,20,59,32,13,84,27,58,17,40,54,43,7,30,97,90,6,40,68,95,99,2,81},new int[]{83,50,27,89,94,39,35,9,45,45,9,20,25,12,36,18,74,75,69,66,37,82,16,25},new int[]{84,20,8,12,15,79,41,13,81,39,48,76,65,89,70,85,93,48,51,16,87,37,30,96},new int[]{29,45,15,54,15,54,4,36,9,81,22,74,25,17,61,80,78,70,39,46,14,16,69,43},new int[]{32,81,24,3,19,56,37,2,42,2,87,90,14,41,50,66,5,32,83,72,62,16,87,46},new int[]{17,7,38,46,97,72,9,17,32,80,47,15,20,21,61,28,11,12,34,86,11,50,98,66},new int[]{32,52,6,16,31,72,58,64,21,10,33,37,34,32,34,21,44,82,82,66,70,99,50,6},new int[]{90,84,81,74,86,24,34,66,16,89,58,92,98,12,71,74,6,9,35,41,32,78,1,42},new int[]{1,24,27,69,79,52,11,85,7,66,11,24,90,72,98,15,37,33,36,68,16,69,66,62},new int[]{25,97,59,93,94,2,46,61,60,24,19,21,7,91,93,19,1,84,70,46,19,36,44,31},new int[]{97,67,2,88,1,15,75,35,48,69,72,53,90,75,74,59,8,53,39,29,4,44,92,24},new int[]{87,84,38,81,81,71,32,87,72,23,34,6,88,33,56,25,31,28,89,50,14,55,1,7},new int[]{85,64,80,66,71,99,62,53,87,71,86,59,74,85,68,31,38,34,36,14,13,95,81,47},new int[]{25,70,61,78,68,26,23,57,84,61,14,22,40,83,68,29,75,21,54,92,47,29,47,64},new int[]{43,12,8,16,12,80,76,31,22,96,74,64,30,54,39,60,13,8,44,80,56,45,58,28},new int[]{54,12,30,68,79,24,78,79,64,33,40,44,74,50,31,94,44,42,57,4,82,66,27,77},new int[]{80,2,92,92,97,18,55,73,34,26,1,11,3,3,51,13,49,65,70,8,33,88,93,97},new int[]{34,96,94,8,28,58,22,8,60,57,86,16,84,63,21,84,59,83,75,46,95,54,52,16},new int[]{81,18,98,77,20,14,13,18,2,86,46,48,49,26,69,54,63,76,97,11,39,58,75,87},new int[]{36,48,94,97,96,39,34,90,17,48,72,39,85,40,63,85,41,55,23,76,39,21,52,27}}); param0.add(new int[][]{new int[]{45,42,10,70,41,89,22,51,39,46,25,16,53,79,40,94,32,42,36,72,38,23,87,9,24},new int[]{76,21,4,75,31,69,97,57,38,25,98,78,51,37,19,29,73,57,81,83,82,19,25,93,80},new int[]{72,9,91,68,96,53,68,30,52,70,80,60,61,53,25,30,10,36,92,15,19,75,83,54,57},new int[]{6,31,21,12,97,20,53,80,76,41,42,1,9,89,35,3,68,29,20,29,18,86,67,21,83},new int[]{45,46,53,3,55,32,40,51,40,54,89,93,81,5,93,28,7,19,84,62,21,53,55,16,25},new int[]{55,37,70,58,26,71,89,81,11,29,66,99,82,2,86,91,47,90,30,45,70,62,10,13,77},new int[]{48,68,68,43,69,27,80,39,88,28,70,36,19,79,86,11,53,74,99,77,37,88,97,66,7},new int[]{58,69,76,76,50,29,40,47,2,67,12,42,27,27,57,48,77,49,93,24,83,27,81,1,58},new int[]{78,82,51,58,67,53,97,94,77,33,98,18,66,87,96,50,77,8,62,21,71,87,83,56,54},new int[]{95,45,29,19,52,65,12,58,38,50,80,27,80,31,66,35,68,51,47,96,62,94,22,66,21},new int[]{23,29,38,27,67,30,52,15,90,85,25,67,51,91,92,71,81,17,79,50,23,80,29,64,74},new int[]{7,79,94,85,6,82,98,69,37,93,82,93,76,94,87,93,84,7,67,18,27,70,98,25,62},new int[]{64,31,65,86,15,8,13,23,35,54,57,62,45,50,20,81,58,34,69,35,94,13,44,78,48},new int[]{98,25,26,89,53,89,20,20,51,54,76,28,55,45,75,86,90,29,41,19,1,63,17,51,5},new int[]{26,68,55,36,33,15,92,63,9,53,97,63,9,63,95,8,28,74,58,57,35,66,56,17,40},new int[]{40,73,83,78,5,28,71,97,66,84,47,47,13,92,99,71,15,17,86,19,74,33,17,63,20},new int[]{59,14,65,17,39,59,61,95,62,32,33,39,88,49,87,11,17,32,19,11,61,95,75,50,5},new int[]{81,34,42,39,28,11,20,98,60,26,2,8,64,10,55,94,24,66,88,13,81,37,99,83,83},new int[]{92,18,41,52,83,78,53,87,26,47,14,97,91,45,77,37,39,22,1,46,52,42,8,99,17},new int[]{30,40,15,66,32,80,35,5,90,6,56,30,51,33,48,74,9,51,58,46,32,47,59,97,33},new int[]{60,14,19,5,98,49,4,94,66,59,44,28,35,60,12,80,80,6,42,99,7,35,72,76,60},new int[]{73,83,80,67,93,71,52,2,91,88,30,12,70,74,88,4,21,65,12,79,48,25,8,85,82},new int[]{20,75,62,20,10,71,60,52,34,17,58,88,64,3,37,52,35,20,9,20,80,36,15,94,88},new int[]{19,47,94,21,5,37,13,40,74,87,17,48,9,65,96,33,68,25,72,43,85,50,70,82,80},new int[]{21,88,58,48,84,38,37,33,92,56,16,71,9,50,45,66,61,61,93,37,97,36,38,3,2}}); param0.add(new int[][]{new int[]{67,61,32,22,31,43,25,63,3,92,10,14,64,23,61,58,67,98,19,25,98,71,41,23,17,63,20,17,59,89,92,20,28,94,38,41,20,63,67,88,68,90,50,64},new int[]{64,48,46,95,50,42,25,50,77,30,3,62,81,31,11,99,52,24,70,86,98,27,53,71,24,84,1,34,70,51,75,57,37,14,83,21,82,88,4,56,88,66,31,88},new int[]{48,68,58,58,7,23,44,49,84,87,89,22,42,4,57,60,36,54,69,3,61,82,14,41,37,69,76,30,78,74,93,79,82,44,6,66,37,80,98,20,32,13,99,73},new int[]{58,86,91,80,4,35,46,27,79,87,94,34,24,22,21,94,16,72,91,70,53,66,64,42,71,31,36,77,70,65,39,22,43,41,23,85,20,32,77,9,16,11,88,71},new int[]{6,33,85,2,73,8,3,3,48,45,21,63,77,46,71,47,54,93,40,56,95,77,13,51,43,58,18,26,96,63,62,69,60,72,47,74,44,77,17,9,7,69,5,90},new int[]{25,49,72,10,59,4,11,43,79,15,66,50,59,42,72,57,13,65,74,93,90,52,34,26,12,43,34,6,63,27,47,45,4,96,51,21,74,91,12,21,34,94,55,75},new int[]{72,45,43,54,9,93,57,13,59,90,47,16,78,82,98,94,7,98,40,70,57,83,42,6,36,60,96,11,38,36,79,5,24,84,35,70,61,3,54,64,58,65,54,80},new int[]{91,61,97,86,81,18,9,66,58,55,73,86,13,95,10,49,12,98,97,85,47,37,67,62,12,25,51,69,77,47,91,66,85,74,69,10,96,66,41,30,95,43,66,31},new int[]{57,50,96,40,96,8,25,10,88,47,54,54,55,72,77,60,97,87,5,30,24,1,96,95,81,89,42,65,69,34,88,37,4,48,10,74,44,55,84,76,72,17,97,38},new int[]{93,52,95,81,54,74,7,40,98,99,79,39,14,58,72,9,66,11,67,77,74,83,75,31,82,67,80,80,18,26,84,61,36,3,13,22,16,87,55,13,42,19,95,3},new int[]{83,10,52,84,97,72,53,18,85,10,1,53,96,7,57,14,27,77,15,86,12,46,59,23,30,58,63,68,19,94,4,57,25,33,17,97,88,80,10,24,13,55,71,6},new int[]{97,7,58,88,38,52,32,12,93,50,58,97,24,85,77,91,52,10,56,18,61,85,58,7,7,64,22,81,94,60,42,68,84,76,83,50,28,82,89,27,96,43,28,39},new int[]{86,3,88,2,33,97,8,15,40,94,84,9,62,6,39,47,9,10,29,6,52,78,87,4,64,20,85,7,89,8,50,83,4,49,72,44,24,49,21,72,64,84,39,51},new int[]{88,80,76,94,47,13,29,30,85,20,85,92,78,2,59,7,87,24,86,83,25,8,26,22,93,56,74,19,9,7,71,65,79,25,76,63,87,93,44,16,76,92,98,85},new int[]{67,42,81,11,30,32,64,67,30,8,22,70,35,47,5,35,89,82,31,98,42,50,87,99,18,24,35,81,40,11,83,52,16,69,53,97,73,16,37,2,32,60,86,89},new int[]{39,47,27,27,81,67,65,76,8,75,27,21,44,48,61,94,42,22,46,15,95,97,57,9,61,78,74,13,48,48,89,91,37,2,8,85,19,56,27,22,26,19,49,94},new int[]{87,67,37,46,62,40,85,22,73,99,51,36,99,47,43,13,37,91,58,71,90,93,73,15,92,84,1,59,3,84,36,66,8,23,16,88,79,43,52,10,15,69,24,23},new int[]{19,47,92,46,24,53,91,58,15,30,46,82,43,65,88,68,18,90,24,35,41,69,48,53,48,86,65,75,2,87,89,40,26,3,95,2,24,32,37,57,85,94,77,81},new int[]{24,26,2,36,32,10,44,77,59,11,15,98,12,47,70,44,18,7,6,16,67,23,3,51,51,82,86,6,18,53,49,25,22,42,99,83,90,85,66,22,22,26,15,24},new int[]{84,24,11,3,88,47,6,60,25,92,84,11,42,25,81,18,81,43,8,85,79,27,99,5,16,66,79,14,73,78,29,74,15,95,13,79,39,36,79,60,6,85,36,81},new int[]{6,20,9,7,85,83,50,31,90,91,7,38,20,26,15,14,53,49,7,9,15,17,94,18,88,63,22,34,26,66,54,30,9,19,53,11,13,5,32,51,35,48,82,63},new int[]{80,96,47,59,1,91,84,75,95,31,43,32,70,34,95,54,13,49,27,73,50,69,29,75,17,50,88,42,76,95,51,19,87,34,91,20,90,5,64,2,34,54,76,46},new int[]{85,70,55,7,39,24,41,60,89,74,2,18,50,75,96,84,1,97,18,1,42,23,17,59,98,44,49,83,50,50,77,37,12,56,32,67,72,6,32,65,7,76,52,54},new int[]{46,45,14,49,65,22,4,3,28,21,43,19,1,35,31,50,67,46,65,44,74,3,76,27,84,74,66,97,14,21,32,93,45,27,57,51,9,72,27,50,44,45,11,69},new int[]{25,24,88,33,90,89,56,49,69,69,2,85,95,78,79,51,46,26,20,99,3,99,2,27,82,59,24,57,68,94,17,26,10,19,86,24,50,44,28,5,69,23,68,9},new int[]{29,5,31,57,47,89,65,37,32,54,64,70,48,19,50,88,88,84,33,84,1,42,43,83,90,64,72,8,58,80,33,96,4,53,84,58,29,70,24,96,36,37,58,97},new int[]{73,47,38,22,77,37,38,22,3,57,14,27,59,24,68,68,87,94,5,32,97,26,52,90,46,65,69,14,33,66,63,70,57,80,82,89,77,15,79,91,75,67,4,53},new int[]{88,3,45,71,71,2,27,68,22,59,58,47,89,82,74,10,32,24,74,68,36,20,98,83,34,6,75,36,26,7,74,98,19,61,86,16,86,51,46,46,81,59,39,79},new int[]{84,11,50,52,59,41,98,62,3,23,91,15,83,4,37,36,77,97,66,19,37,92,79,32,18,50,53,1,71,28,95,7,12,11,80,78,81,11,98,92,28,5,23,49},new int[]{37,57,14,93,49,66,35,63,83,84,19,20,17,16,83,21,28,29,7,10,70,55,54,24,86,85,8,83,27,87,63,46,45,39,8,18,78,75,6,2,67,33,2,58},new int[]{9,52,26,95,57,4,49,80,60,90,39,83,14,49,22,99,7,72,62,11,76,99,33,93,90,53,20,47,23,89,5,22,16,89,40,89,54,22,74,51,11,21,79,80},new int[]{66,12,85,75,41,2,23,46,57,90,45,32,77,74,90,73,75,22,3,13,94,89,2,12,64,4,45,21,35,45,33,44,86,86,44,40,97,51,30,46,76,20,76,5},new int[]{35,15,99,54,22,51,23,42,37,47,90,34,11,50,32,78,42,54,28,28,36,5,51,45,44,47,83,48,5,38,98,73,97,72,81,45,40,94,51,1,35,63,69,48},new int[]{53,69,64,24,50,8,77,80,54,15,52,5,17,55,80,35,7,80,14,91,34,30,61,99,59,39,32,18,39,1,26,75,2,8,46,63,24,99,97,23,86,58,77,61},new int[]{79,15,11,8,31,31,21,37,12,64,24,38,23,39,91,48,23,67,55,62,56,10,62,3,96,60,54,42,63,18,5,74,32,19,49,7,47,13,9,66,50,89,49,17},new int[]{9,14,44,11,27,85,41,71,76,60,29,15,82,35,91,54,31,26,34,47,8,46,85,99,61,50,15,25,66,7,16,69,11,72,90,17,6,94,12,34,47,62,88,96},new int[]{7,41,81,66,10,11,72,78,94,4,11,45,73,25,88,38,25,50,2,14,98,86,3,84,7,84,29,7,7,97,15,23,70,10,19,14,25,96,64,64,33,8,15,97},new int[]{31,90,82,65,98,19,90,90,7,1,20,19,39,39,56,30,94,65,43,74,12,89,81,28,16,88,54,74,31,91,44,52,80,13,95,62,10,10,79,91,71,31,66,92},new int[]{87,2,17,28,71,7,17,37,37,72,2,25,25,35,64,95,66,69,90,63,34,16,80,77,41,78,25,9,99,3,62,17,2,79,16,82,83,67,97,49,76,32,25,32},new int[]{22,53,6,71,49,38,44,43,77,95,28,19,76,12,82,48,91,25,66,50,78,28,44,69,26,83,25,15,96,20,77,1,33,88,8,38,28,79,34,34,29,78,9,52},new int[]{44,10,43,22,19,24,34,3,14,37,37,30,87,48,75,99,84,99,18,65,52,93,64,90,73,91,11,23,40,72,7,61,98,11,8,42,32,86,40,21,19,90,95,52},new int[]{12,51,98,82,51,4,86,40,74,1,82,26,56,54,89,81,38,73,25,18,3,95,8,86,38,6,55,56,65,40,88,40,68,41,84,40,93,7,16,79,5,52,20,71},new int[]{56,34,12,72,32,49,62,57,25,69,16,51,76,23,40,41,15,39,77,63,63,22,95,86,73,26,28,44,35,92,42,52,7,23,71,88,92,99,44,4,81,78,51,69},new int[]{29,17,82,37,10,15,25,54,37,30,60,73,16,85,56,98,42,99,14,46,78,50,72,61,72,4,39,99,71,55,50,46,80,21,96,49,47,10,70,29,60,16,24,60}}); param0.add(new int[][]{new int[]{10,67,53,58,73,24,62,89,36,84,54,60,46,96,96,92,26,82,97,63},new int[]{48,41,1,86,53,43,18,90,36,96,15,29,95,85,70,25,86,25,26,76},new int[]{62,70,29,37,26,52,66,37,64,30,55,90,77,26,1,91,73,37,75,10},new int[]{37,25,56,27,77,68,12,12,31,9,54,8,6,38,8,59,80,17,35,10},new int[]{84,63,29,21,63,58,6,76,14,43,20,88,95,82,81,30,36,53,41,35},new int[]{12,20,52,81,63,57,16,97,91,89,19,62,95,56,54,13,6,61,67,86},new int[]{88,77,55,5,57,19,14,94,46,2,65,49,64,86,45,54,89,67,3,90},new int[]{46,18,40,16,53,95,61,90,34,18,86,6,99,4,42,20,33,87,51,81},new int[]{91,94,23,19,60,94,94,16,43,45,94,78,23,79,86,82,70,15,79,60},new int[]{43,54,93,45,56,71,75,98,99,22,35,76,48,98,67,29,12,97,37,77},new int[]{33,63,58,43,8,94,28,18,4,11,80,38,35,67,48,41,4,21,62,17},new int[]{48,23,50,36,84,41,78,91,78,38,72,52,41,21,14,53,32,43,1,65},new int[]{22,5,5,11,55,80,64,98,49,41,77,61,75,48,65,51,4,2,54,55},new int[]{36,33,97,47,39,18,23,11,93,47,58,76,33,76,18,21,22,53,87,72},new int[]{77,9,31,43,61,78,92,74,94,66,63,54,94,39,5,91,5,36,7,87},new int[]{10,50,16,13,94,93,26,48,80,23,56,93,85,46,16,37,73,86,50,41},new int[]{1,49,47,8,53,12,8,62,90,60,29,61,87,81,87,76,59,44,72,79},new int[]{9,63,35,78,26,57,4,37,95,93,13,52,40,76,28,9,94,80,76,96},new int[]{48,39,62,36,11,9,59,79,23,73,62,64,5,77,9,1,51,66,91,53},new int[]{38,84,93,19,79,34,77,87,14,83,86,10,36,65,98,5,78,15,66,87}}); param0.add(new int[][]{new int[]{77,56,21,16,3,4,66,99,72,94,34,33,76,11,85,89,9,74},new int[]{19,31,23,11,31,52,97,53,56,6,28,4,68,74,92,14,90,64},new int[]{61,79,82,4,63,17,35,22,53,84,18,49,57,77,67,52,63,50},new int[]{15,14,6,59,1,21,5,46,43,70,54,51,90,94,92,97,91,53},new int[]{91,42,70,95,16,16,29,89,52,60,1,60,39,54,48,71,94,69},new int[]{4,86,36,45,15,74,86,35,5,55,14,51,81,76,76,67,32,1},new int[]{79,1,94,83,6,91,26,32,55,77,17,90,37,99,68,40,44,87},new int[]{63,57,15,2,26,35,92,15,16,53,14,4,49,99,18,47,35,85},new int[]{72,52,11,94,54,45,98,39,94,4,68,72,6,18,94,33,61,22},new int[]{20,62,47,73,41,88,83,88,96,73,4,67,28,91,11,56,95,15},new int[]{32,29,44,46,61,48,51,64,59,47,49,17,30,75,30,10,58,76},new int[]{96,46,69,13,88,44,82,58,93,96,43,51,91,86,68,72,6,83},new int[]{84,40,99,55,58,57,32,5,30,83,30,27,50,42,56,11,18,88},new int[]{3,94,46,14,38,91,36,62,80,54,62,60,83,93,97,4,38,36},new int[]{70,84,86,57,43,23,7,59,5,24,12,37,49,10,82,83,45,71},new int[]{25,75,55,79,31,96,47,61,25,1,66,12,16,46,84,52,57,50},new int[]{86,98,54,8,35,6,85,99,58,48,49,76,29,36,82,77,72,68},new int[]{95,53,87,51,41,30,56,16,31,33,48,91,17,90,47,59,75,7}}); param0.add(new int[][]{new int[]{34,1,55,60,18,68,91,6,94,26,74,59,4,58,39,76,49,81,16,6,76,4,89,24,75,14,42,58,50,97,13,37,17,12,49,87,66,41,35,8,92,76,97,76,87,34,31,98},new int[]{90,60,31,75,59,62,78,99,32,64,98,14,13,54,62,66,71,90,8,14,79,19,22,89,55,57,14,64,90,48,26,49,5,1,92,2,25,59,49,62,56,24,79,60,70,18,93,11},new int[]{27,45,53,94,75,27,40,42,87,55,73,75,86,13,77,16,41,8,30,71,34,11,70,90,59,4,86,38,9,17,5,44,39,49,47,16,80,5,84,77,73,65,33,67,90,10,6,91},new int[]{86,24,6,58,22,53,14,6,38,5,94,58,77,96,52,88,57,76,19,80,52,61,41,25,6,42,34,25,77,58,12,1,45,42,67,9,8,53,79,53,54,34,69,21,68,49,86,9},new int[]{71,11,83,90,39,31,56,64,69,40,91,57,59,4,97,70,27,33,85,21,17,82,10,16,12,99,89,82,34,40,70,53,88,77,18,15,99,93,62,25,3,98,9,43,46,16,16,88},new int[]{43,71,10,81,76,35,37,17,59,7,86,34,53,27,4,49,61,89,73,14,38,7,63,73,8,78,29,28,62,72,25,54,89,86,99,15,59,29,57,67,67,18,72,85,51,76,69,43},new int[]{19,57,50,26,95,65,89,97,97,20,48,74,57,29,79,66,4,42,67,73,55,90,58,46,34,44,78,6,28,68,61,76,22,1,25,9,81,17,79,54,83,80,43,39,13,31,75,52},new int[]{46,21,43,57,20,54,26,30,88,15,65,17,37,49,52,84,81,57,72,89,46,79,89,42,20,8,76,45,34,18,90,24,36,70,80,18,22,58,93,92,95,72,95,46,36,65,5,16},new int[]{7,96,69,10,42,76,23,25,73,93,61,72,85,70,34,77,36,83,88,75,23,33,71,63,69,60,54,89,68,56,30,47,99,22,17,95,68,42,67,96,39,90,3,71,75,5,19,43},new int[]{23,91,35,60,60,78,49,80,78,42,86,42,3,2,7,45,57,84,49,35,91,16,39,51,34,1,99,57,36,18,34,44,62,84,41,15,78,78,46,33,39,2,75,79,7,90,99,34},new int[]{70,61,64,66,92,86,11,85,26,99,11,10,32,72,3,52,21,2,52,25,17,69,22,9,97,65,79,90,93,46,84,33,33,84,3,52,70,18,15,3,90,70,7,77,78,90,41,95},new int[]{20,62,11,12,16,66,64,45,10,33,79,52,34,17,57,47,24,37,57,89,74,63,38,59,50,90,27,60,63,72,89,24,76,42,82,30,69,30,22,49,83,29,26,70,57,48,54,40},new int[]{81,50,53,62,11,44,96,77,7,23,22,15,77,77,46,22,86,98,62,44,30,3,55,64,92,18,22,78,1,64,39,45,25,91,23,92,37,47,66,54,43,68,4,61,21,21,3,73},new int[]{94,88,19,88,94,42,38,60,83,36,92,52,72,89,53,52,25,28,49,77,42,75,80,46,15,80,40,51,58,89,4,19,54,66,39,40,12,13,5,92,86,37,85,72,6,60,55,36},new int[]{18,28,83,83,52,63,61,28,18,14,98,53,76,8,4,98,33,29,61,12,29,99,51,31,1,74,14,37,22,77,69,41,77,87,8,46,25,20,60,8,54,69,88,52,70,89,45,69},new int[]{98,51,93,91,42,33,87,62,1,31,5,12,37,87,29,40,59,11,1,46,78,82,90,6,23,98,90,79,36,87,83,25,61,89,11,63,3,11,96,98,23,81,62,83,79,4,43,54},new int[]{61,26,32,69,69,62,95,36,41,46,32,98,62,43,49,22,33,88,36,29,15,9,30,74,96,77,41,13,86,43,96,50,91,46,29,26,84,89,49,52,10,27,8,57,55,36,54,82},new int[]{89,6,53,46,51,50,49,69,7,38,53,96,84,23,13,62,40,35,12,41,38,72,72,40,83,57,2,58,18,42,20,51,71,11,71,93,53,16,35,17,8,99,57,39,99,14,22,7},new int[]{98,11,25,47,36,80,96,77,93,84,52,25,14,19,13,98,75,70,94,27,87,53,8,31,1,41,31,75,51,36,69,43,2,12,19,77,7,89,61,96,99,5,10,99,78,67,98,94},new int[]{61,48,23,56,86,87,32,87,39,93,86,41,48,32,8,80,31,54,77,48,8,28,31,73,48,84,32,4,45,7,19,34,91,36,13,9,50,83,9,50,90,79,78,15,37,80,52,99},new int[]{27,5,64,47,73,88,29,61,88,91,99,44,25,93,77,80,76,95,27,59,98,97,69,99,5,58,7,16,74,43,48,59,4,33,36,75,10,73,60,48,85,35,77,61,26,61,65,30},new int[]{39,84,58,47,4,37,53,41,54,75,98,50,98,36,16,95,85,32,63,45,70,40,92,81,30,76,41,21,86,71,13,56,48,13,36,5,39,5,21,44,87,31,26,28,34,65,75,8},new int[]{8,89,99,81,99,51,90,59,75,96,23,49,29,63,15,86,50,26,51,55,45,89,88,49,62,92,52,78,58,53,63,84,45,43,52,3,12,42,4,87,81,32,52,44,79,1,62,63},new int[]{77,11,44,2,2,81,31,15,15,58,6,90,84,99,95,64,67,21,92,22,97,35,13,77,37,46,9,92,10,26,90,94,25,57,4,36,61,97,1,18,86,32,8,67,81,70,48,90},new int[]{17,69,7,39,49,60,41,58,75,85,89,62,11,55,85,37,20,24,80,36,68,75,94,3,11,42,5,43,75,76,16,78,79,61,67,78,79,61,8,24,66,31,97,35,91,33,31,60},new int[]{25,42,49,77,52,3,53,62,34,91,21,85,24,73,60,10,55,97,7,73,41,39,86,40,58,76,9,12,7,91,32,43,48,95,55,71,39,41,26,61,30,98,89,39,14,40,6,76},new int[]{64,99,34,93,26,89,72,1,31,68,93,46,44,96,88,92,6,70,68,33,83,39,15,42,70,86,53,78,23,9,15,10,17,71,96,22,8,40,90,94,32,95,90,7,13,49,4,97},new int[]{53,17,23,66,81,12,48,28,48,71,54,35,93,21,87,34,50,17,17,1,14,27,15,35,23,32,21,56,52,43,45,38,74,52,28,40,51,99,72,47,82,78,9,16,44,94,38,90},new int[]{52,48,12,76,55,89,94,97,52,99,1,29,41,1,78,43,86,16,93,29,25,83,83,78,71,57,98,19,19,25,13,55,52,95,75,14,28,38,93,88,69,53,20,44,67,57,94,7},new int[]{34,46,56,14,19,41,73,18,96,99,45,82,1,93,51,80,5,20,14,29,96,16,92,18,17,12,87,77,65,70,46,90,32,53,56,69,50,50,92,52,84,42,58,11,90,80,55,66},new int[]{2,35,27,4,13,85,68,1,21,62,1,95,16,32,19,80,37,81,6,97,44,95,55,88,35,16,75,35,57,81,89,9,41,68,53,58,80,86,84,43,65,69,23,32,13,36,52,5},new int[]{11,74,57,15,92,66,10,83,98,58,32,95,13,66,39,33,23,18,86,90,85,5,96,2,40,17,19,7,39,32,70,90,39,2,69,57,20,47,81,20,52,81,17,91,72,17,20,98},new int[]{96,37,13,9,80,60,58,46,62,79,36,48,34,6,44,30,56,94,34,79,76,89,60,3,18,8,45,95,68,5,9,82,8,34,20,27,34,34,12,15,58,59,80,76,10,65,36,39},new int[]{20,10,39,70,21,21,80,89,99,42,40,67,73,18,16,74,33,92,22,28,13,19,81,38,52,70,41,39,13,87,53,61,48,43,31,14,22,19,39,95,61,49,6,36,61,15,81,53},new int[]{68,26,46,53,96,87,73,7,35,56,89,41,58,24,14,4,24,77,76,47,19,60,85,1,87,60,89,88,20,60,57,56,11,54,90,85,79,63,37,33,11,6,12,9,16,41,68,52},new int[]{44,20,66,30,16,72,15,3,31,32,69,93,77,43,50,63,72,42,98,28,49,9,34,49,65,89,80,31,67,12,75,27,60,65,36,96,86,70,2,39,63,46,95,40,10,99,27,22},new int[]{67,2,94,6,87,53,8,87,36,39,72,59,85,60,19,36,71,71,16,48,68,35,3,99,81,31,40,45,49,33,54,69,75,78,7,60,5,5,42,57,94,75,9,32,83,1,49,15},new int[]{23,31,16,78,68,20,21,55,59,71,90,72,43,2,79,11,93,64,19,21,84,89,93,1,20,5,39,77,81,82,19,44,59,71,7,63,79,94,37,63,89,52,52,30,61,22,33,3},new int[]{98,99,44,46,75,2,87,79,39,85,80,76,21,22,67,46,88,94,32,43,27,41,31,99,15,25,99,66,55,92,11,18,14,36,43,12,9,50,43,97,25,60,9,70,12,43,95,87},new int[]{51,61,10,97,97,32,40,18,14,90,39,1,57,62,52,51,35,94,48,63,72,16,85,24,1,66,61,7,17,50,82,31,72,83,95,15,57,99,65,51,18,73,76,94,35,73,36,84},new int[]{22,73,81,80,43,73,95,3,24,5,42,31,49,54,97,53,69,25,48,67,39,98,83,83,55,74,45,83,78,15,95,56,94,80,42,38,95,71,49,94,7,7,47,13,45,25,50,64},new int[]{88,80,68,97,95,56,44,59,2,30,62,54,47,2,56,68,22,87,81,71,73,80,64,87,34,29,71,98,22,64,78,29,90,15,25,66,39,92,91,75,79,11,35,57,95,74,13,27},new int[]{23,99,14,62,52,33,98,58,62,13,77,21,34,36,81,40,1,1,71,59,2,85,35,50,48,62,24,24,79,26,14,52,93,76,88,98,10,34,45,73,51,31,22,19,64,95,6,8},new int[]{20,88,73,46,27,35,76,10,38,80,58,26,3,72,29,45,46,12,91,23,9,15,33,15,24,14,40,73,14,4,89,78,40,11,59,76,77,80,33,3,61,1,54,65,89,53,54,38},new int[]{22,73,56,45,75,2,10,5,88,72,42,34,24,12,52,23,48,69,19,77,35,8,76,85,49,92,76,5,13,54,49,58,15,45,96,72,81,64,54,82,87,4,60,23,8,95,40,13},new int[]{95,49,45,39,82,36,91,66,26,2,33,80,4,55,32,81,61,7,79,83,56,67,67,5,49,20,3,61,23,16,10,64,62,36,79,74,49,67,64,14,84,29,68,52,62,39,54,50},new int[]{75,71,26,55,45,54,26,94,10,44,68,30,12,87,47,72,92,85,25,78,33,42,90,33,45,50,61,14,82,61,26,81,58,4,88,69,5,91,3,24,90,88,42,52,96,54,6,49},new int[]{56,17,62,40,7,94,96,82,92,15,68,71,56,47,5,7,63,28,76,93,25,71,47,20,77,48,95,3,69,77,77,50,60,66,91,75,1,11,13,39,30,7,89,19,80,22,75,68}}); List<Integer> param1 = new ArrayList<>(); param1.add(22); param1.add(12); param1.add(12); param1.add(18); param1.add(20); param1.add(24); param1.add(30); param1.add(15); param1.add(16); param1.add(35); List<Integer> param2 = new ArrayList<>(); param2.add(27); param2.add(18); param2.add(8); param2.add(12); param2.add(18); param2.add(15); param2.add(36); param2.add(14); param2.add(10); param2.add(31); for(int i =0; i < param0.size(); ++i ){ for(int j =0; j < param0.get(i).length; ++j ){ Arrays.sort(param0.get(i)[j]); for(int k =0; k < param0.get(i)[j].length; ++k){ param0.get(i)[j][k]-=50; } } } for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([[31, 92, 57, 28, 79, 84, 92, 19, 31, 71, 91, 46, 60, 79, 82, 4, 70, 82, 41, 79, 80, 29, 26, 76, 92, 18, 94, 55, 46, 69, 67, 60, 85, 25, 11], [58, 69, 14, 55, 6, 69, 81, 60, 38, 52, 81, 80, 1, 47, 42, 82, 2, 70, 68, 71, 50, 98, 84, 1, 45, 24, 49, 33, 56, 4, 60, 42, 14, 45, 13], [28, 92, 91, 71, 75, 97, 30, 9, 76, 94, 55, 84, 76, 38, 32, 7, 73, 49, 37, 76, 41, 3, 89, 56, 71, 99, 71, 25, 94, 37, 43, 9, 89, 55, 55], [77, 31, 94, 14, 2, 88, 64, 71, 57, 18, 81, 51, 66, 82, 16, 46, 15, 28, 48, 54, 49, 34, 80, 12, 26, 64, 41, 46, 32, 87, 18, 12, 38, 28, 88], [84, 93, 86, 10, 92, 89, 62, 65, 33, 66, 92, 52, 28, 49, 98, 37, 49, 91, 42, 64, 43, 12, 83, 61, 51, 11, 80, 35, 28, 50, 35, 1, 31, 81, 77], [22, 30, 43, 76, 37, 59, 48, 82, 40, 2, 66, 58, 7, 13, 38, 73, 14, 28, 55, 52, 28, 10, 98, 93, 97, 27, 1, 50, 80, 83, 11, 82, 80, 7, 38], [54, 30, 50, 31, 57, 2, 73, 56, 24, 35, 85, 99, 28, 51, 83, 86, 82, 30, 72, 98, 40, 81, 15, 5, 18, 76, 62, 5, 50, 37, 99, 46, 31, 16, 66], [52, 62, 92, 37, 29, 66, 66, 98, 1, 56, 60, 85, 43, 98, 46, 34, 21, 71, 28, 84, 92, 93, 58, 79, 3, 37, 76, 14, 63, 33, 46, 8, 2, 56, 31], [70, 69, 43, 26, 58, 80, 60, 28, 24, 79, 42, 80, 16, 52, 17, 93, 25, 16, 77, 35, 39, 16, 77, 19, 45, 27, 96, 44, 30, 88, 76, 6, 18, 2, 33], [1, 6, 28, 49, 25, 25, 14, 31, 5, 60, 78, 45, 20, 88, 9, 80, 72, 46, 75, 90, 26, 11, 25, 77, 22, 39, 83, 65, 95, 64, 78, 86, 23, 48, 20], [98, 5, 39, 62, 57, 87, 52, 68, 32, 98, 90, 99, 67, 81, 94, 96, 15, 44, 13, 17, 47, 35, 84, 14, 23, 69, 5, 96, 42, 42, 65, 60, 10, 10, 88], [4, 91, 15, 32, 39, 40, 39, 26, 25, 26, 35, 22, 5, 46, 72, 27, 44, 23, 49, 67, 9, 17, 64, 74, 68, 84, 94, 76, 22, 22, 30, 29, 26, 63, 51], [10, 53, 32, 7, 39, 74, 91, 85, 79, 47, 47, 11, 54, 51, 43, 75, 19, 74, 33, 27, 15, 29, 96, 96, 87, 83, 62, 32, 79, 62, 43, 62, 97, 87, 16], [11, 15, 6, 98, 56, 59, 40, 13, 99, 53, 48, 46, 99, 16, 59, 58, 21, 57, 89, 63, 67, 50, 71, 98, 10, 49, 78, 39, 5, 64, 9, 7, 60, 86, 83], [94, 9, 64, 64, 80, 70, 1, 77, 15, 64, 69, 43, 40, 56, 82, 28, 15, 92, 40, 38, 61, 74, 32, 1, 95, 30, 5, 43, 1, 8, 57, 5, 5, 97, 54], [79, 58, 95, 22, 97, 60, 97, 87, 35, 14, 58, 59, 86, 89, 57, 33, 1, 71, 16, 48, 77, 69, 6, 99, 74, 96, 79, 98, 65, 86, 32, 45, 61, 49, 36], [19, 37, 45, 27, 48, 21, 83, 82, 96, 85, 83, 54, 37, 22, 38, 43, 45, 28, 84, 91, 38, 16, 58, 46, 48, 20, 61, 8, 90, 66, 42, 47, 65, 60, 15], [48, 19, 73, 34, 64, 86, 86, 4, 50, 81, 67, 14, 28, 49, 83, 56, 97, 24, 38, 84, 39, 82, 1, 14, 7, 32, 90, 7, 7, 47, 85, 55, 96, 87, 83], [70, 68, 59, 18, 72, 95, 7, 62, 53, 22, 82, 64, 72, 3, 24, 52, 26, 41, 30, 19, 47, 55, 13, 10, 69, 54, 93, 42, 44, 49, 72, 18, 29, 70, 85], [96, 40, 94, 49, 87, 60, 26, 23, 86, 18, 72, 90, 32, 11, 48, 47, 94, 96, 98, 59, 11, 19, 27, 49, 62, 29, 23, 22, 1, 88, 54, 41, 39, 76, 44], [45, 99, 44, 67, 5, 80, 36, 33, 89, 52, 2, 49, 74, 36, 7, 14, 57, 67, 62, 97, 22, 92, 44, 2, 65, 67, 58, 91, 56, 84, 53, 49, 11, 13, 24], [69, 81, 60, 52, 34, 72, 33, 56, 28, 17, 3, 62, 7, 78, 40, 19, 95, 42, 49, 77, 90, 42, 22, 1, 60, 92, 65, 28, 11, 83, 19, 59, 52, 45, 26], [23, 17, 21, 54, 31, 32, 81, 15, 13, 65, 62, 16, 21, 70, 6, 84, 5, 91, 37, 20, 89, 73, 3, 65, 86, 24, 27, 11, 98, 92, 54, 23, 9, 1, 90], [53, 67, 14, 42, 52, 55, 52, 86, 99, 43, 74, 48, 71, 55, 85, 87, 73, 41, 55, 52, 83, 67, 78, 14, 15, 27, 83, 28, 65, 35, 45, 33, 59, 13, 34], [29, 4, 17, 82, 11, 18, 95, 71, 10, 34, 79, 43, 45, 58, 9, 26, 84, 9, 49, 6, 63, 41, 43, 75, 35, 54, 55, 18, 81, 55, 2, 53, 1, 67, 87], [98, 3, 18, 56, 33, 97, 20, 90, 38, 80, 83, 80, 18, 94, 11, 43, 60, 85, 30, 2, 89, 85, 32, 35, 62, 32, 93, 71, 62, 93, 24, 33, 86, 21, 32], [38, 45, 16, 40, 18, 67, 71, 49, 46, 98, 64, 83, 35, 78, 40, 86, 28, 66, 77, 24, 31, 10, 82, 1, 31, 9, 47, 39, 84, 51, 1, 6, 32, 4, 63], [85, 48, 64, 11, 29, 77, 59, 1, 99, 17, 17, 38, 49, 78, 82, 50, 87, 75, 18, 75, 73, 98, 17, 27, 51, 4, 98, 96, 6, 74, 5, 47, 52, 47, 75], [36, 68, 16, 99, 38, 84, 45, 71, 71, 36, 3, 97, 69, 15, 48, 77, 6, 4, 33, 36, 67, 65, 52, 55, 37, 35, 76, 69, 98, 84, 62, 5, 80, 15, 36], [67, 84, 38, 44, 5, 66, 58, 57, 67, 75, 61, 66, 60, 2, 66, 50, 6, 83, 91, 86, 67, 99, 1, 32, 71, 91, 52, 29, 51, 73, 23, 32, 4, 75, 25], [24, 94, 50, 60, 28, 73, 99, 1, 10, 37, 54, 96, 56, 46, 19, 9, 57, 78, 19, 70, 76, 25, 14, 87, 13, 22, 63, 73, 97, 3, 19, 39, 16, 36, 22], [92, 41, 48, 68, 30, 72, 1, 76, 98, 58, 57, 61, 32, 11, 58, 29, 80, 86, 22, 94, 50, 66, 78, 22, 91, 56, 91, 82, 61, 67, 12, 18, 46, 99, 69], [49, 64, 35, 55, 67, 78, 11, 71, 12, 98, 10, 9, 82, 35, 61, 40, 29, 10, 83, 11, 63, 16, 97, 97, 96, 91, 30, 97, 21, 91, 32, 61, 27, 33, 35], [29, 58, 88, 23, 96, 94, 1, 55, 79, 30, 87, 83, 5, 70, 25, 62, 14, 67, 29, 22, 84, 2, 25, 75, 11, 57, 89, 65, 80, 82, 36, 28, 45, 44, 4], [70, 94, 49, 13, 26, 24, 42, 24, 58, 83, 41, 6, 50, 78, 22, 12, 21, 84, 70, 28, 44, 51, 78, 75, 9, 70, 37, 23, 60, 25, 68, 97, 49, 17, 27]],22,27,), ([[22, 49, 27, 1, 69, 48, 44, 18, 89, 36, 93, 10, 67, 18, 7, 62, 55, 3, 84, 76, 49, 57], [59, 6, 37, 2, 33, 16, 20, 60, 69, 98, 92, 2, 70, 12, 99, 57, 32, 92, 64, 92, 68, 62], [41, 89, 70, 69, 62, 88, 52, 23, 8, 37, 77, 87, 54, 44, 87, 32, 53, 29, 38, 80, 68, 32], [63, 77, 82, 97, 7, 56, 2, 68, 44, 52, 40, 8, 71, 50, 26, 62, 18, 61, 12, 20, 1, 76], [44, 47, 86, 67, 53, 27, 80, 57, 53, 74, 7, 11, 86, 58, 7, 55, 30, 57, 23, 97, 38, 33], [48, 84, 9, 77, 60, 53, 41, 15, 99, 30, 90, 36, 89, 64, 78, 63, 51, 51, 22, 17, 72, 50], [14, 56, 77, 30, 59, 64, 26, 22, 86, 92, 80, 88, 63, 46, 81, 3, 81, 64, 14, 72, 14, 77], [36, 48, 97, 59, 34, 64, 11, 24, 41, 30, 37, 66, 33, 98, 60, 27, 76, 90, 48, 10, 90, 41], [76, 54, 4, 86, 40, 31, 85, 51, 38, 72, 28, 12, 35, 99, 78, 12, 13, 49, 34, 33, 21, 83], [37, 15, 61, 52, 17, 81, 90, 44, 16, 13, 2, 92, 88, 84, 18, 99, 10, 71, 82, 33, 75, 44], [40, 49, 88, 11, 67, 52, 39, 2, 92, 49, 52, 31, 77, 97, 51, 31, 66, 98, 66, 37, 25, 62], [99, 9, 6, 66, 15, 61, 15, 58, 33, 62, 80, 65, 59, 1, 79, 54, 78, 51, 97, 19, 83, 59], [3, 76, 87, 47, 71, 66, 86, 18, 79, 62, 44, 67, 5, 82, 94, 27, 48, 2, 88, 34, 55, 46], [38, 66, 48, 93, 40, 7, 6, 14, 82, 56, 83, 2, 8, 58, 21, 26, 90, 10, 85, 3, 8, 78], [54, 43, 93, 86, 42, 41, 87, 70, 67, 60, 90, 78, 66, 42, 30, 57, 76, 2, 30, 24, 12, 49], [12, 5, 75, 55, 17, 62, 87, 21, 91, 88, 10, 20, 49, 46, 79, 51, 33, 94, 59, 48, 97, 70], [49, 75, 21, 53, 2, 92, 14, 80, 92, 40, 84, 67, 39, 48, 53, 49, 68, 57, 14, 58, 97, 9], [45, 23, 2, 43, 89, 62, 28, 46, 74, 38, 70, 84, 67, 22, 62, 86, 72, 24, 39, 5, 64, 43], [28, 93, 44, 61, 47, 23, 52, 97, 62, 31, 98, 1, 63, 7, 86, 46, 66, 61, 24, 14, 15, 62], [60, 58, 17, 60, 19, 91, 78, 22, 56, 84, 99, 91, 42, 55, 30, 83, 84, 42, 86, 73, 76, 53], [95, 93, 92, 53, 56, 72, 31, 67, 4, 61, 39, 88, 64, 94, 48, 88, 23, 54, 37, 10, 18, 67], [97, 70, 9, 43, 34, 94, 43, 71, 13, 81, 56, 73, 85, 54, 35, 89, 45, 18, 8, 54, 70, 36]],12,18,), ([[54, 62, 19, 8, 61, 82, 54, 69, 91, 14, 56, 78, 22, 81, 38, 47], [22, 25, 33, 85, 89, 78, 7, 42, 24, 24, 24, 74, 89, 83, 23, 1], [79, 9, 51, 67, 71, 49, 87, 45, 81, 2, 4, 50, 16, 71, 91, 44], [77, 99, 85, 40, 90, 45, 3, 54, 39, 69, 40, 88, 81, 41, 84, 24], [84, 24, 42, 18, 51, 45, 16, 97, 97, 64, 56, 35, 9, 33, 37, 97], [61, 55, 53, 21, 5, 1, 71, 23, 87, 71, 59, 83, 27, 77, 9, 9], [60, 42, 94, 10, 69, 95, 98, 38, 54, 64, 17, 71, 83, 38, 60, 38], [2, 45, 33, 60, 92, 31, 55, 48, 31, 19, 79, 9, 81, 47, 4, 38], [68, 16, 10, 37, 43, 45, 10, 93, 47, 99, 74, 88, 79, 85, 2, 27], [69, 72, 66, 74, 32, 60, 90, 70, 88, 68, 15, 72, 65, 35, 87, 75], [49, 36, 73, 88, 81, 8, 78, 65, 98, 35, 5, 5, 46, 53, 39, 92], [5, 39, 16, 95, 34, 59, 36, 19, 80, 5, 69, 39, 26, 45, 15, 11], [14, 95, 52, 74, 90, 61, 75, 19, 71, 69, 37, 45, 8, 71, 49, 26], [71, 95, 22, 95, 95, 48, 53, 75, 96, 68, 82, 99, 9, 15, 4, 54], [26, 94, 94, 81, 47, 4, 22, 74, 41, 98, 98, 11, 89, 77, 7, 65], [47, 37, 49, 52, 68, 83, 51, 70, 32, 47, 60, 93, 61, 10, 21, 42]],12,8,), ([[39, 79, 41, 68, 91, 31, 87, 47, 16, 92, 42, 68, 79, 59, 17, 45, 68, 78, 99, 19, 51], [43, 46, 81, 76, 18, 20, 62, 54, 42, 52, 8, 66, 3, 79, 60, 12, 50, 87, 88, 70, 11], [49, 2, 91, 98, 51, 74, 47, 72, 32, 42, 92, 52, 98, 89, 9, 91, 86, 38, 78, 89, 42], [45, 76, 87, 45, 3, 88, 56, 16, 16, 59, 78, 40, 9, 7, 55, 69, 58, 39, 64, 2, 32], [65, 45, 40, 81, 13, 71, 33, 46, 27, 47, 92, 5, 9, 75, 80, 2, 90, 50, 40, 4, 1], [99, 5, 44, 17, 65, 99, 27, 27, 5, 1, 87, 95, 78, 27, 4, 40, 57, 79, 82, 46, 33], [99, 3, 6, 49, 52, 24, 66, 91, 66, 84, 92, 96, 48, 24, 81, 69, 46, 58, 16, 49, 83], [2, 42, 95, 3, 17, 63, 45, 82, 69, 10, 86, 44, 64, 55, 2, 44, 93, 16, 98, 3, 41], [27, 2, 95, 31, 58, 64, 21, 14, 90, 14, 86, 42, 84, 47, 4, 82, 70, 47, 97, 1, 49], [59, 74, 19, 7, 3, 89, 77, 72, 52, 57, 86, 31, 70, 55, 89, 25, 43, 52, 24, 50, 30], [89, 57, 9, 45, 89, 74, 76, 89, 23, 90, 57, 77, 38, 25, 49, 3, 85, 90, 90, 26, 47], [55, 39, 1, 53, 31, 10, 76, 47, 77, 33, 6, 22, 29, 95, 29, 14, 32, 28, 27, 11, 93], [95, 75, 56, 23, 21, 30, 76, 98, 25, 79, 41, 3, 63, 87, 96, 53, 92, 40, 74, 22, 8], [91, 35, 88, 59, 74, 92, 5, 6, 56, 42, 97, 80, 14, 45, 12, 61, 63, 79, 73, 52, 81], [73, 86, 4, 14, 11, 1, 47, 35, 12, 99, 37, 31, 61, 86, 60, 17, 28, 82, 3, 18, 20], [46, 85, 58, 67, 3, 32, 53, 13, 86, 7, 78, 12, 29, 48, 58, 37, 77, 43, 75, 14, 42], [38, 93, 44, 22, 94, 76, 29, 63, 20, 19, 51, 57, 53, 11, 9, 63, 24, 43, 51, 11, 37], [19, 71, 53, 61, 91, 91, 20, 99, 7, 81, 88, 37, 29, 9, 23, 10, 22, 38, 55, 89, 29], [62, 33, 81, 98, 9, 79, 80, 50, 63, 67, 64, 95, 69, 84, 22, 4, 98, 71, 1, 81, 77], [97, 1, 28, 52, 20, 16, 45, 31, 69, 9, 98, 60, 55, 97, 5, 3, 95, 77, 65, 54, 32], [71, 97, 30, 68, 74, 7, 15, 99, 62, 39, 20, 55, 30, 22, 20, 31, 54, 31, 93, 10, 80]],18,12,), ([[48, 19, 66, 15, 8, 54, 8, 66, 22, 72, 93, 33, 96, 26, 89, 57, 86, 16, 99, 75, 9, 20, 36, 26], [67, 60, 72, 35, 68, 26, 18, 53, 54, 82, 23, 15, 89, 43, 82, 1, 33, 46, 61, 87, 93, 27, 33, 21], [7, 78, 68, 44, 49, 95, 1, 16, 16, 7, 1, 92, 3, 44, 47, 52, 31, 61, 41, 28, 95, 28, 51, 46], [98, 90, 93, 45, 10, 2, 88, 20, 1, 67, 2, 75, 27, 31, 68, 59, 11, 50, 4, 40, 5, 61, 34, 24], [41, 37, 20, 59, 32, 13, 84, 27, 58, 17, 40, 54, 43, 7, 30, 97, 90, 6, 40, 68, 95, 99, 2, 81], [83, 50, 27, 89, 94, 39, 35, 9, 45, 45, 9, 20, 25, 12, 36, 18, 74, 75, 69, 66, 37, 82, 16, 25], [84, 20, 8, 12, 15, 79, 41, 13, 81, 39, 48, 76, 65, 89, 70, 85, 93, 48, 51, 16, 87, 37, 30, 96], [29, 45, 15, 54, 15, 54, 4, 36, 9, 81, 22, 74, 25, 17, 61, 80, 78, 70, 39, 46, 14, 16, 69, 43], [32, 81, 24, 3, 19, 56, 37, 2, 42, 2, 87, 90, 14, 41, 50, 66, 5, 32, 83, 72, 62, 16, 87, 46], [17, 7, 38, 46, 97, 72, 9, 17, 32, 80, 47, 15, 20, 21, 61, 28, 11, 12, 34, 86, 11, 50, 98, 66], [32, 52, 6, 16, 31, 72, 58, 64, 21, 10, 33, 37, 34, 32, 34, 21, 44, 82, 82, 66, 70, 99, 50, 6], [90, 84, 81, 74, 86, 24, 34, 66, 16, 89, 58, 92, 98, 12, 71, 74, 6, 9, 35, 41, 32, 78, 1, 42], [1, 24, 27, 69, 79, 52, 11, 85, 7, 66, 11, 24, 90, 72, 98, 15, 37, 33, 36, 68, 16, 69, 66, 62], [25, 97, 59, 93, 94, 2, 46, 61, 60, 24, 19, 21, 7, 91, 93, 19, 1, 84, 70, 46, 19, 36, 44, 31], [97, 67, 2, 88, 1, 15, 75, 35, 48, 69, 72, 53, 90, 75, 74, 59, 8, 53, 39, 29, 4, 44, 92, 24], [87, 84, 38, 81, 81, 71, 32, 87, 72, 23, 34, 6, 88, 33, 56, 25, 31, 28, 89, 50, 14, 55, 1, 7], [85, 64, 80, 66, 71, 99, 62, 53, 87, 71, 86, 59, 74, 85, 68, 31, 38, 34, 36, 14, 13, 95, 81, 47], [25, 70, 61, 78, 68, 26, 23, 57, 84, 61, 14, 22, 40, 83, 68, 29, 75, 21, 54, 92, 47, 29, 47, 64], [43, 12, 8, 16, 12, 80, 76, 31, 22, 96, 74, 64, 30, 54, 39, 60, 13, 8, 44, 80, 56, 45, 58, 28], [54, 12, 30, 68, 79, 24, 78, 79, 64, 33, 40, 44, 74, 50, 31, 94, 44, 42, 57, 4, 82, 66, 27, 77], [80, 2, 92, 92, 97, 18, 55, 73, 34, 26, 1, 11, 3, 3, 51, 13, 49, 65, 70, 8, 33, 88, 93, 97], [34, 96, 94, 8, 28, 58, 22, 8, 60, 57, 86, 16, 84, 63, 21, 84, 59, 83, 75, 46, 95, 54, 52, 16], [81, 18, 98, 77, 20, 14, 13, 18, 2, 86, 46, 48, 49, 26, 69, 54, 63, 76, 97, 11, 39, 58, 75, 87], [36, 48, 94, 97, 96, 39, 34, 90, 17, 48, 72, 39, 85, 40, 63, 85, 41, 55, 23, 76, 39, 21, 52, 27]],20,18,), ([[45, 42, 10, 70, 41, 89, 22, 51, 39, 46, 25, 16, 53, 79, 40, 94, 32, 42, 36, 72, 38, 23, 87, 9, 24], [76, 21, 4, 75, 31, 69, 97, 57, 38, 25, 98, 78, 51, 37, 19, 29, 73, 57, 81, 83, 82, 19, 25, 93, 80], [72, 9, 91, 68, 96, 53, 68, 30, 52, 70, 80, 60, 61, 53, 25, 30, 10, 36, 92, 15, 19, 75, 83, 54, 57], [6, 31, 21, 12, 97, 20, 53, 80, 76, 41, 42, 1, 9, 89, 35, 3, 68, 29, 20, 29, 18, 86, 67, 21, 83], [45, 46, 53, 3, 55, 32, 40, 51, 40, 54, 89, 93, 81, 5, 93, 28, 7, 19, 84, 62, 21, 53, 55, 16, 25], [55, 37, 70, 58, 26, 71, 89, 81, 11, 29, 66, 99, 82, 2, 86, 91, 47, 90, 30, 45, 70, 62, 10, 13, 77], [48, 68, 68, 43, 69, 27, 80, 39, 88, 28, 70, 36, 19, 79, 86, 11, 53, 74, 99, 77, 37, 88, 97, 66, 7], [58, 69, 76, 76, 50, 29, 40, 47, 2, 67, 12, 42, 27, 27, 57, 48, 77, 49, 93, 24, 83, 27, 81, 1, 58], [78, 82, 51, 58, 67, 53, 97, 94, 77, 33, 98, 18, 66, 87, 96, 50, 77, 8, 62, 21, 71, 87, 83, 56, 54], [95, 45, 29, 19, 52, 65, 12, 58, 38, 50, 80, 27, 80, 31, 66, 35, 68, 51, 47, 96, 62, 94, 22, 66, 21], [23, 29, 38, 27, 67, 30, 52, 15, 90, 85, 25, 67, 51, 91, 92, 71, 81, 17, 79, 50, 23, 80, 29, 64, 74], [7, 79, 94, 85, 6, 82, 98, 69, 37, 93, 82, 93, 76, 94, 87, 93, 84, 7, 67, 18, 27, 70, 98, 25, 62], [64, 31, 65, 86, 15, 8, 13, 23, 35, 54, 57, 62, 45, 50, 20, 81, 58, 34, 69, 35, 94, 13, 44, 78, 48], [98, 25, 26, 89, 53, 89, 20, 20, 51, 54, 76, 28, 55, 45, 75, 86, 90, 29, 41, 19, 1, 63, 17, 51, 5], [26, 68, 55, 36, 33, 15, 92, 63, 9, 53, 97, 63, 9, 63, 95, 8, 28, 74, 58, 57, 35, 66, 56, 17, 40], [40, 73, 83, 78, 5, 28, 71, 97, 66, 84, 47, 47, 13, 92, 99, 71, 15, 17, 86, 19, 74, 33, 17, 63, 20], [59, 14, 65, 17, 39, 59, 61, 95, 62, 32, 33, 39, 88, 49, 87, 11, 17, 32, 19, 11, 61, 95, 75, 50, 5], [81, 34, 42, 39, 28, 11, 20, 98, 60, 26, 2, 8, 64, 10, 55, 94, 24, 66, 88, 13, 81, 37, 99, 83, 83], [92, 18, 41, 52, 83, 78, 53, 87, 26, 47, 14, 97, 91, 45, 77, 37, 39, 22, 1, 46, 52, 42, 8, 99, 17], [30, 40, 15, 66, 32, 80, 35, 5, 90, 6, 56, 30, 51, 33, 48, 74, 9, 51, 58, 46, 32, 47, 59, 97, 33], [60, 14, 19, 5, 98, 49, 4, 94, 66, 59, 44, 28, 35, 60, 12, 80, 80, 6, 42, 99, 7, 35, 72, 76, 60], [73, 83, 80, 67, 93, 71, 52, 2, 91, 88, 30, 12, 70, 74, 88, 4, 21, 65, 12, 79, 48, 25, 8, 85, 82], [20, 75, 62, 20, 10, 71, 60, 52, 34, 17, 58, 88, 64, 3, 37, 52, 35, 20, 9, 20, 80, 36, 15, 94, 88], [19, 47, 94, 21, 5, 37, 13, 40, 74, 87, 17, 48, 9, 65, 96, 33, 68, 25, 72, 43, 85, 50, 70, 82, 80], [21, 88, 58, 48, 84, 38, 37, 33, 92, 56, 16, 71, 9, 50, 45, 66, 61, 61, 93, 37, 97, 36, 38, 3, 2]],24,15,), ([[67, 61, 32, 22, 31, 43, 25, 63, 3, 92, 10, 14, 64, 23, 61, 58, 67, 98, 19, 25, 98, 71, 41, 23, 17, 63, 20, 17, 59, 89, 92, 20, 28, 94, 38, 41, 20, 63, 67, 88, 68, 90, 50, 64], [64, 48, 46, 95, 50, 42, 25, 50, 77, 30, 3, 62, 81, 31, 11, 99, 52, 24, 70, 86, 98, 27, 53, 71, 24, 84, 1, 34, 70, 51, 75, 57, 37, 14, 83, 21, 82, 88, 4, 56, 88, 66, 31, 88], [48, 68, 58, 58, 7, 23, 44, 49, 84, 87, 89, 22, 42, 4, 57, 60, 36, 54, 69, 3, 61, 82, 14, 41, 37, 69, 76, 30, 78, 74, 93, 79, 82, 44, 6, 66, 37, 80, 98, 20, 32, 13, 99, 73], [58, 86, 91, 80, 4, 35, 46, 27, 79, 87, 94, 34, 24, 22, 21, 94, 16, 72, 91, 70, 53, 66, 64, 42, 71, 31, 36, 77, 70, 65, 39, 22, 43, 41, 23, 85, 20, 32, 77, 9, 16, 11, 88, 71], [6, 33, 85, 2, 73, 8, 3, 3, 48, 45, 21, 63, 77, 46, 71, 47, 54, 93, 40, 56, 95, 77, 13, 51, 43, 58, 18, 26, 96, 63, 62, 69, 60, 72, 47, 74, 44, 77, 17, 9, 7, 69, 5, 90], [25, 49, 72, 10, 59, 4, 11, 43, 79, 15, 66, 50, 59, 42, 72, 57, 13, 65, 74, 93, 90, 52, 34, 26, 12, 43, 34, 6, 63, 27, 47, 45, 4, 96, 51, 21, 74, 91, 12, 21, 34, 94, 55, 75], [72, 45, 43, 54, 9, 93, 57, 13, 59, 90, 47, 16, 78, 82, 98, 94, 7, 98, 40, 70, 57, 83, 42, 6, 36, 60, 96, 11, 38, 36, 79, 5, 24, 84, 35, 70, 61, 3, 54, 64, 58, 65, 54, 80], [91, 61, 97, 86, 81, 18, 9, 66, 58, 55, 73, 86, 13, 95, 10, 49, 12, 98, 97, 85, 47, 37, 67, 62, 12, 25, 51, 69, 77, 47, 91, 66, 85, 74, 69, 10, 96, 66, 41, 30, 95, 43, 66, 31], [57, 50, 96, 40, 96, 8, 25, 10, 88, 47, 54, 54, 55, 72, 77, 60, 97, 87, 5, 30, 24, 1, 96, 95, 81, 89, 42, 65, 69, 34, 88, 37, 4, 48, 10, 74, 44, 55, 84, 76, 72, 17, 97, 38], [93, 52, 95, 81, 54, 74, 7, 40, 98, 99, 79, 39, 14, 58, 72, 9, 66, 11, 67, 77, 74, 83, 75, 31, 82, 67, 80, 80, 18, 26, 84, 61, 36, 3, 13, 22, 16, 87, 55, 13, 42, 19, 95, 3], [83, 10, 52, 84, 97, 72, 53, 18, 85, 10, 1, 53, 96, 7, 57, 14, 27, 77, 15, 86, 12, 46, 59, 23, 30, 58, 63, 68, 19, 94, 4, 57, 25, 33, 17, 97, 88, 80, 10, 24, 13, 55, 71, 6], [97, 7, 58, 88, 38, 52, 32, 12, 93, 50, 58, 97, 24, 85, 77, 91, 52, 10, 56, 18, 61, 85, 58, 7, 7, 64, 22, 81, 94, 60, 42, 68, 84, 76, 83, 50, 28, 82, 89, 27, 96, 43, 28, 39], [86, 3, 88, 2, 33, 97, 8, 15, 40, 94, 84, 9, 62, 6, 39, 47, 9, 10, 29, 6, 52, 78, 87, 4, 64, 20, 85, 7, 89, 8, 50, 83, 4, 49, 72, 44, 24, 49, 21, 72, 64, 84, 39, 51], [88, 80, 76, 94, 47, 13, 29, 30, 85, 20, 85, 92, 78, 2, 59, 7, 87, 24, 86, 83, 25, 8, 26, 22, 93, 56, 74, 19, 9, 7, 71, 65, 79, 25, 76, 63, 87, 93, 44, 16, 76, 92, 98, 85], [67, 42, 81, 11, 30, 32, 64, 67, 30, 8, 22, 70, 35, 47, 5, 35, 89, 82, 31, 98, 42, 50, 87, 99, 18, 24, 35, 81, 40, 11, 83, 52, 16, 69, 53, 97, 73, 16, 37, 2, 32, 60, 86, 89], [39, 47, 27, 27, 81, 67, 65, 76, 8, 75, 27, 21, 44, 48, 61, 94, 42, 22, 46, 15, 95, 97, 57, 9, 61, 78, 74, 13, 48, 48, 89, 91, 37, 2, 8, 85, 19, 56, 27, 22, 26, 19, 49, 94], [87, 67, 37, 46, 62, 40, 85, 22, 73, 99, 51, 36, 99, 47, 43, 13, 37, 91, 58, 71, 90, 93, 73, 15, 92, 84, 1, 59, 3, 84, 36, 66, 8, 23, 16, 88, 79, 43, 52, 10, 15, 69, 24, 23], [19, 47, 92, 46, 24, 53, 91, 58, 15, 30, 46, 82, 43, 65, 88, 68, 18, 90, 24, 35, 41, 69, 48, 53, 48, 86, 65, 75, 2, 87, 89, 40, 26, 3, 95, 2, 24, 32, 37, 57, 85, 94, 77, 81], [24, 26, 2, 36, 32, 10, 44, 77, 59, 11, 15, 98, 12, 47, 70, 44, 18, 7, 6, 16, 67, 23, 3, 51, 51, 82, 86, 6, 18, 53, 49, 25, 22, 42, 99, 83, 90, 85, 66, 22, 22, 26, 15, 24], [84, 24, 11, 3, 88, 47, 6, 60, 25, 92, 84, 11, 42, 25, 81, 18, 81, 43, 8, 85, 79, 27, 99, 5, 16, 66, 79, 14, 73, 78, 29, 74, 15, 95, 13, 79, 39, 36, 79, 60, 6, 85, 36, 81], [6, 20, 9, 7, 85, 83, 50, 31, 90, 91, 7, 38, 20, 26, 15, 14, 53, 49, 7, 9, 15, 17, 94, 18, 88, 63, 22, 34, 26, 66, 54, 30, 9, 19, 53, 11, 13, 5, 32, 51, 35, 48, 82, 63], [80, 96, 47, 59, 1, 91, 84, 75, 95, 31, 43, 32, 70, 34, 95, 54, 13, 49, 27, 73, 50, 69, 29, 75, 17, 50, 88, 42, 76, 95, 51, 19, 87, 34, 91, 20, 90, 5, 64, 2, 34, 54, 76, 46], [85, 70, 55, 7, 39, 24, 41, 60, 89, 74, 2, 18, 50, 75, 96, 84, 1, 97, 18, 1, 42, 23, 17, 59, 98, 44, 49, 83, 50, 50, 77, 37, 12, 56, 32, 67, 72, 6, 32, 65, 7, 76, 52, 54], [46, 45, 14, 49, 65, 22, 4, 3, 28, 21, 43, 19, 1, 35, 31, 50, 67, 46, 65, 44, 74, 3, 76, 27, 84, 74, 66, 97, 14, 21, 32, 93, 45, 27, 57, 51, 9, 72, 27, 50, 44, 45, 11, 69], [25, 24, 88, 33, 90, 89, 56, 49, 69, 69, 2, 85, 95, 78, 79, 51, 46, 26, 20, 99, 3, 99, 2, 27, 82, 59, 24, 57, 68, 94, 17, 26, 10, 19, 86, 24, 50, 44, 28, 5, 69, 23, 68, 9], [29, 5, 31, 57, 47, 89, 65, 37, 32, 54, 64, 70, 48, 19, 50, 88, 88, 84, 33, 84, 1, 42, 43, 83, 90, 64, 72, 8, 58, 80, 33, 96, 4, 53, 84, 58, 29, 70, 24, 96, 36, 37, 58, 97], [73, 47, 38, 22, 77, 37, 38, 22, 3, 57, 14, 27, 59, 24, 68, 68, 87, 94, 5, 32, 97, 26, 52, 90, 46, 65, 69, 14, 33, 66, 63, 70, 57, 80, 82, 89, 77, 15, 79, 91, 75, 67, 4, 53], [88, 3, 45, 71, 71, 2, 27, 68, 22, 59, 58, 47, 89, 82, 74, 10, 32, 24, 74, 68, 36, 20, 98, 83, 34, 6, 75, 36, 26, 7, 74, 98, 19, 61, 86, 16, 86, 51, 46, 46, 81, 59, 39, 79], [84, 11, 50, 52, 59, 41, 98, 62, 3, 23, 91, 15, 83, 4, 37, 36, 77, 97, 66, 19, 37, 92, 79, 32, 18, 50, 53, 1, 71, 28, 95, 7, 12, 11, 80, 78, 81, 11, 98, 92, 28, 5, 23, 49], [37, 57, 14, 93, 49, 66, 35, 63, 83, 84, 19, 20, 17, 16, 83, 21, 28, 29, 7, 10, 70, 55, 54, 24, 86, 85, 8, 83, 27, 87, 63, 46, 45, 39, 8, 18, 78, 75, 6, 2, 67, 33, 2, 58], [9, 52, 26, 95, 57, 4, 49, 80, 60, 90, 39, 83, 14, 49, 22, 99, 7, 72, 62, 11, 76, 99, 33, 93, 90, 53, 20, 47, 23, 89, 5, 22, 16, 89, 40, 89, 54, 22, 74, 51, 11, 21, 79, 80], [66, 12, 85, 75, 41, 2, 23, 46, 57, 90, 45, 32, 77, 74, 90, 73, 75, 22, 3, 13, 94, 89, 2, 12, 64, 4, 45, 21, 35, 45, 33, 44, 86, 86, 44, 40, 97, 51, 30, 46, 76, 20, 76, 5], [35, 15, 99, 54, 22, 51, 23, 42, 37, 47, 90, 34, 11, 50, 32, 78, 42, 54, 28, 28, 36, 5, 51, 45, 44, 47, 83, 48, 5, 38, 98, 73, 97, 72, 81, 45, 40, 94, 51, 1, 35, 63, 69, 48], [53, 69, 64, 24, 50, 8, 77, 80, 54, 15, 52, 5, 17, 55, 80, 35, 7, 80, 14, 91, 34, 30, 61, 99, 59, 39, 32, 18, 39, 1, 26, 75, 2, 8, 46, 63, 24, 99, 97, 23, 86, 58, 77, 61], [79, 15, 11, 8, 31, 31, 21, 37, 12, 64, 24, 38, 23, 39, 91, 48, 23, 67, 55, 62, 56, 10, 62, 3, 96, 60, 54, 42, 63, 18, 5, 74, 32, 19, 49, 7, 47, 13, 9, 66, 50, 89, 49, 17], [9, 14, 44, 11, 27, 85, 41, 71, 76, 60, 29, 15, 82, 35, 91, 54, 31, 26, 34, 47, 8, 46, 85, 99, 61, 50, 15, 25, 66, 7, 16, 69, 11, 72, 90, 17, 6, 94, 12, 34, 47, 62, 88, 96], [7, 41, 81, 66, 10, 11, 72, 78, 94, 4, 11, 45, 73, 25, 88, 38, 25, 50, 2, 14, 98, 86, 3, 84, 7, 84, 29, 7, 7, 97, 15, 23, 70, 10, 19, 14, 25, 96, 64, 64, 33, 8, 15, 97], [31, 90, 82, 65, 98, 19, 90, 90, 7, 1, 20, 19, 39, 39, 56, 30, 94, 65, 43, 74, 12, 89, 81, 28, 16, 88, 54, 74, 31, 91, 44, 52, 80, 13, 95, 62, 10, 10, 79, 91, 71, 31, 66, 92], [87, 2, 17, 28, 71, 7, 17, 37, 37, 72, 2, 25, 25, 35, 64, 95, 66, 69, 90, 63, 34, 16, 80, 77, 41, 78, 25, 9, 99, 3, 62, 17, 2, 79, 16, 82, 83, 67, 97, 49, 76, 32, 25, 32], [22, 53, 6, 71, 49, 38, 44, 43, 77, 95, 28, 19, 76, 12, 82, 48, 91, 25, 66, 50, 78, 28, 44, 69, 26, 83, 25, 15, 96, 20, 77, 1, 33, 88, 8, 38, 28, 79, 34, 34, 29, 78, 9, 52], [44, 10, 43, 22, 19, 24, 34, 3, 14, 37, 37, 30, 87, 48, 75, 99, 84, 99, 18, 65, 52, 93, 64, 90, 73, 91, 11, 23, 40, 72, 7, 61, 98, 11, 8, 42, 32, 86, 40, 21, 19, 90, 95, 52], [12, 51, 98, 82, 51, 4, 86, 40, 74, 1, 82, 26, 56, 54, 89, 81, 38, 73, 25, 18, 3, 95, 8, 86, 38, 6, 55, 56, 65, 40, 88, 40, 68, 41, 84, 40, 93, 7, 16, 79, 5, 52, 20, 71], [56, 34, 12, 72, 32, 49, 62, 57, 25, 69, 16, 51, 76, 23, 40, 41, 15, 39, 77, 63, 63, 22, 95, 86, 73, 26, 28, 44, 35, 92, 42, 52, 7, 23, 71, 88, 92, 99, 44, 4, 81, 78, 51, 69], [29, 17, 82, 37, 10, 15, 25, 54, 37, 30, 60, 73, 16, 85, 56, 98, 42, 99, 14, 46, 78, 50, 72, 61, 72, 4, 39, 99, 71, 55, 50, 46, 80, 21, 96, 49, 47, 10, 70, 29, 60, 16, 24, 60]],30,36,), ([[10, 67, 53, 58, 73, 24, 62, 89, 36, 84, 54, 60, 46, 96, 96, 92, 26, 82, 97, 63], [48, 41, 1, 86, 53, 43, 18, 90, 36, 96, 15, 29, 95, 85, 70, 25, 86, 25, 26, 76], [62, 70, 29, 37, 26, 52, 66, 37, 64, 30, 55, 90, 77, 26, 1, 91, 73, 37, 75, 10], [37, 25, 56, 27, 77, 68, 12, 12, 31, 9, 54, 8, 6, 38, 8, 59, 80, 17, 35, 10], [84, 63, 29, 21, 63, 58, 6, 76, 14, 43, 20, 88, 95, 82, 81, 30, 36, 53, 41, 35], [12, 20, 52, 81, 63, 57, 16, 97, 91, 89, 19, 62, 95, 56, 54, 13, 6, 61, 67, 86], [88, 77, 55, 5, 57, 19, 14, 94, 46, 2, 65, 49, 64, 86, 45, 54, 89, 67, 3, 90], [46, 18, 40, 16, 53, 95, 61, 90, 34, 18, 86, 6, 99, 4, 42, 20, 33, 87, 51, 81], [91, 94, 23, 19, 60, 94, 94, 16, 43, 45, 94, 78, 23, 79, 86, 82, 70, 15, 79, 60], [43, 54, 93, 45, 56, 71, 75, 98, 99, 22, 35, 76, 48, 98, 67, 29, 12, 97, 37, 77], [33, 63, 58, 43, 8, 94, 28, 18, 4, 11, 80, 38, 35, 67, 48, 41, 4, 21, 62, 17], [48, 23, 50, 36, 84, 41, 78, 91, 78, 38, 72, 52, 41, 21, 14, 53, 32, 43, 1, 65], [22, 5, 5, 11, 55, 80, 64, 98, 49, 41, 77, 61, 75, 48, 65, 51, 4, 2, 54, 55], [36, 33, 97, 47, 39, 18, 23, 11, 93, 47, 58, 76, 33, 76, 18, 21, 22, 53, 87, 72], [77, 9, 31, 43, 61, 78, 92, 74, 94, 66, 63, 54, 94, 39, 5, 91, 5, 36, 7, 87], [10, 50, 16, 13, 94, 93, 26, 48, 80, 23, 56, 93, 85, 46, 16, 37, 73, 86, 50, 41], [1, 49, 47, 8, 53, 12, 8, 62, 90, 60, 29, 61, 87, 81, 87, 76, 59, 44, 72, 79], [9, 63, 35, 78, 26, 57, 4, 37, 95, 93, 13, 52, 40, 76, 28, 9, 94, 80, 76, 96], [48, 39, 62, 36, 11, 9, 59, 79, 23, 73, 62, 64, 5, 77, 9, 1, 51, 66, 91, 53], [38, 84, 93, 19, 79, 34, 77, 87, 14, 83, 86, 10, 36, 65, 98, 5, 78, 15, 66, 87]],15,14,), ([[77, 56, 21, 16, 3, 4, 66, 99, 72, 94, 34, 33, 76, 11, 85, 89, 9, 74], [19, 31, 23, 11, 31, 52, 97, 53, 56, 6, 28, 4, 68, 74, 92, 14, 90, 64], [61, 79, 82, 4, 63, 17, 35, 22, 53, 84, 18, 49, 57, 77, 67, 52, 63, 50], [15, 14, 6, 59, 1, 21, 5, 46, 43, 70, 54, 51, 90, 94, 92, 97, 91, 53], [91, 42, 70, 95, 16, 16, 29, 89, 52, 60, 1, 60, 39, 54, 48, 71, 94, 69], [4, 86, 36, 45, 15, 74, 86, 35, 5, 55, 14, 51, 81, 76, 76, 67, 32, 1], [79, 1, 94, 83, 6, 91, 26, 32, 55, 77, 17, 90, 37, 99, 68, 40, 44, 87], [63, 57, 15, 2, 26, 35, 92, 15, 16, 53, 14, 4, 49, 99, 18, 47, 35, 85], [72, 52, 11, 94, 54, 45, 98, 39, 94, 4, 68, 72, 6, 18, 94, 33, 61, 22], [20, 62, 47, 73, 41, 88, 83, 88, 96, 73, 4, 67, 28, 91, 11, 56, 95, 15], [32, 29, 44, 46, 61, 48, 51, 64, 59, 47, 49, 17, 30, 75, 30, 10, 58, 76], [96, 46, 69, 13, 88, 44, 82, 58, 93, 96, 43, 51, 91, 86, 68, 72, 6, 83], [84, 40, 99, 55, 58, 57, 32, 5, 30, 83, 30, 27, 50, 42, 56, 11, 18, 88], [3, 94, 46, 14, 38, 91, 36, 62, 80, 54, 62, 60, 83, 93, 97, 4, 38, 36], [70, 84, 86, 57, 43, 23, 7, 59, 5, 24, 12, 37, 49, 10, 82, 83, 45, 71], [25, 75, 55, 79, 31, 96, 47, 61, 25, 1, 66, 12, 16, 46, 84, 52, 57, 50], [86, 98, 54, 8, 35, 6, 85, 99, 58, 48, 49, 76, 29, 36, 82, 77, 72, 68], [95, 53, 87, 51, 41, 30, 56, 16, 31, 33, 48, 91, 17, 90, 47, 59, 75, 7]],16,10,), ([[34, 1, 55, 60, 18, 68, 91, 6, 94, 26, 74, 59, 4, 58, 39, 76, 49, 81, 16, 6, 76, 4, 89, 24, 75, 14, 42, 58, 50, 97, 13, 37, 17, 12, 49, 87, 66, 41, 35, 8, 92, 76, 97, 76, 87, 34, 31, 98], [90, 60, 31, 75, 59, 62, 78, 99, 32, 64, 98, 14, 13, 54, 62, 66, 71, 90, 8, 14, 79, 19, 22, 89, 55, 57, 14, 64, 90, 48, 26, 49, 5, 1, 92, 2, 25, 59, 49, 62, 56, 24, 79, 60, 70, 18, 93, 11], [27, 45, 53, 94, 75, 27, 40, 42, 87, 55, 73, 75, 86, 13, 77, 16, 41, 8, 30, 71, 34, 11, 70, 90, 59, 4, 86, 38, 9, 17, 5, 44, 39, 49, 47, 16, 80, 5, 84, 77, 73, 65, 33, 67, 90, 10, 6, 91], [86, 24, 6, 58, 22, 53, 14, 6, 38, 5, 94, 58, 77, 96, 52, 88, 57, 76, 19, 80, 52, 61, 41, 25, 6, 42, 34, 25, 77, 58, 12, 1, 45, 42, 67, 9, 8, 53, 79, 53, 54, 34, 69, 21, 68, 49, 86, 9], [71, 11, 83, 90, 39, 31, 56, 64, 69, 40, 91, 57, 59, 4, 97, 70, 27, 33, 85, 21, 17, 82, 10, 16, 12, 99, 89, 82, 34, 40, 70, 53, 88, 77, 18, 15, 99, 93, 62, 25, 3, 98, 9, 43, 46, 16, 16, 88], [43, 71, 10, 81, 76, 35, 37, 17, 59, 7, 86, 34, 53, 27, 4, 49, 61, 89, 73, 14, 38, 7, 63, 73, 8, 78, 29, 28, 62, 72, 25, 54, 89, 86, 99, 15, 59, 29, 57, 67, 67, 18, 72, 85, 51, 76, 69, 43], [19, 57, 50, 26, 95, 65, 89, 97, 97, 20, 48, 74, 57, 29, 79, 66, 4, 42, 67, 73, 55, 90, 58, 46, 34, 44, 78, 6, 28, 68, 61, 76, 22, 1, 25, 9, 81, 17, 79, 54, 83, 80, 43, 39, 13, 31, 75, 52], [46, 21, 43, 57, 20, 54, 26, 30, 88, 15, 65, 17, 37, 49, 52, 84, 81, 57, 72, 89, 46, 79, 89, 42, 20, 8, 76, 45, 34, 18, 90, 24, 36, 70, 80, 18, 22, 58, 93, 92, 95, 72, 95, 46, 36, 65, 5, 16], [7, 96, 69, 10, 42, 76, 23, 25, 73, 93, 61, 72, 85, 70, 34, 77, 36, 83, 88, 75, 23, 33, 71, 63, 69, 60, 54, 89, 68, 56, 30, 47, 99, 22, 17, 95, 68, 42, 67, 96, 39, 90, 3, 71, 75, 5, 19, 43], [23, 91, 35, 60, 60, 78, 49, 80, 78, 42, 86, 42, 3, 2, 7, 45, 57, 84, 49, 35, 91, 16, 39, 51, 34, 1, 99, 57, 36, 18, 34, 44, 62, 84, 41, 15, 78, 78, 46, 33, 39, 2, 75, 79, 7, 90, 99, 34], [70, 61, 64, 66, 92, 86, 11, 85, 26, 99, 11, 10, 32, 72, 3, 52, 21, 2, 52, 25, 17, 69, 22, 9, 97, 65, 79, 90, 93, 46, 84, 33, 33, 84, 3, 52, 70, 18, 15, 3, 90, 70, 7, 77, 78, 90, 41, 95], [20, 62, 11, 12, 16, 66, 64, 45, 10, 33, 79, 52, 34, 17, 57, 47, 24, 37, 57, 89, 74, 63, 38, 59, 50, 90, 27, 60, 63, 72, 89, 24, 76, 42, 82, 30, 69, 30, 22, 49, 83, 29, 26, 70, 57, 48, 54, 40], [81, 50, 53, 62, 11, 44, 96, 77, 7, 23, 22, 15, 77, 77, 46, 22, 86, 98, 62, 44, 30, 3, 55, 64, 92, 18, 22, 78, 1, 64, 39, 45, 25, 91, 23, 92, 37, 47, 66, 54, 43, 68, 4, 61, 21, 21, 3, 73], [94, 88, 19, 88, 94, 42, 38, 60, 83, 36, 92, 52, 72, 89, 53, 52, 25, 28, 49, 77, 42, 75, 80, 46, 15, 80, 40, 51, 58, 89, 4, 19, 54, 66, 39, 40, 12, 13, 5, 92, 86, 37, 85, 72, 6, 60, 55, 36], [18, 28, 83, 83, 52, 63, 61, 28, 18, 14, 98, 53, 76, 8, 4, 98, 33, 29, 61, 12, 29, 99, 51, 31, 1, 74, 14, 37, 22, 77, 69, 41, 77, 87, 8, 46, 25, 20, 60, 8, 54, 69, 88, 52, 70, 89, 45, 69], [98, 51, 93, 91, 42, 33, 87, 62, 1, 31, 5, 12, 37, 87, 29, 40, 59, 11, 1, 46, 78, 82, 90, 6, 23, 98, 90, 79, 36, 87, 83, 25, 61, 89, 11, 63, 3, 11, 96, 98, 23, 81, 62, 83, 79, 4, 43, 54], [61, 26, 32, 69, 69, 62, 95, 36, 41, 46, 32, 98, 62, 43, 49, 22, 33, 88, 36, 29, 15, 9, 30, 74, 96, 77, 41, 13, 86, 43, 96, 50, 91, 46, 29, 26, 84, 89, 49, 52, 10, 27, 8, 57, 55, 36, 54, 82], [89, 6, 53, 46, 51, 50, 49, 69, 7, 38, 53, 96, 84, 23, 13, 62, 40, 35, 12, 41, 38, 72, 72, 40, 83, 57, 2, 58, 18, 42, 20, 51, 71, 11, 71, 93, 53, 16, 35, 17, 8, 99, 57, 39, 99, 14, 22, 7], [98, 11, 25, 47, 36, 80, 96, 77, 93, 84, 52, 25, 14, 19, 13, 98, 75, 70, 94, 27, 87, 53, 8, 31, 1, 41, 31, 75, 51, 36, 69, 43, 2, 12, 19, 77, 7, 89, 61, 96, 99, 5, 10, 99, 78, 67, 98, 94], [61, 48, 23, 56, 86, 87, 32, 87, 39, 93, 86, 41, 48, 32, 8, 80, 31, 54, 77, 48, 8, 28, 31, 73, 48, 84, 32, 4, 45, 7, 19, 34, 91, 36, 13, 9, 50, 83, 9, 50, 90, 79, 78, 15, 37, 80, 52, 99], [27, 5, 64, 47, 73, 88, 29, 61, 88, 91, 99, 44, 25, 93, 77, 80, 76, 95, 27, 59, 98, 97, 69, 99, 5, 58, 7, 16, 74, 43, 48, 59, 4, 33, 36, 75, 10, 73, 60, 48, 85, 35, 77, 61, 26, 61, 65, 30], [39, 84, 58, 47, 4, 37, 53, 41, 54, 75, 98, 50, 98, 36, 16, 95, 85, 32, 63, 45, 70, 40, 92, 81, 30, 76, 41, 21, 86, 71, 13, 56, 48, 13, 36, 5, 39, 5, 21, 44, 87, 31, 26, 28, 34, 65, 75, 8], [8, 89, 99, 81, 99, 51, 90, 59, 75, 96, 23, 49, 29, 63, 15, 86, 50, 26, 51, 55, 45, 89, 88, 49, 62, 92, 52, 78, 58, 53, 63, 84, 45, 43, 52, 3, 12, 42, 4, 87, 81, 32, 52, 44, 79, 1, 62, 63], [77, 11, 44, 2, 2, 81, 31, 15, 15, 58, 6, 90, 84, 99, 95, 64, 67, 21, 92, 22, 97, 35, 13, 77, 37, 46, 9, 92, 10, 26, 90, 94, 25, 57, 4, 36, 61, 97, 1, 18, 86, 32, 8, 67, 81, 70, 48, 90], [17, 69, 7, 39, 49, 60, 41, 58, 75, 85, 89, 62, 11, 55, 85, 37, 20, 24, 80, 36, 68, 75, 94, 3, 11, 42, 5, 43, 75, 76, 16, 78, 79, 61, 67, 78, 79, 61, 8, 24, 66, 31, 97, 35, 91, 33, 31, 60], [25, 42, 49, 77, 52, 3, 53, 62, 34, 91, 21, 85, 24, 73, 60, 10, 55, 97, 7, 73, 41, 39, 86, 40, 58, 76, 9, 12, 7, 91, 32, 43, 48, 95, 55, 71, 39, 41, 26, 61, 30, 98, 89, 39, 14, 40, 6, 76], [64, 99, 34, 93, 26, 89, 72, 1, 31, 68, 93, 46, 44, 96, 88, 92, 6, 70, 68, 33, 83, 39, 15, 42, 70, 86, 53, 78, 23, 9, 15, 10, 17, 71, 96, 22, 8, 40, 90, 94, 32, 95, 90, 7, 13, 49, 4, 97], [53, 17, 23, 66, 81, 12, 48, 28, 48, 71, 54, 35, 93, 21, 87, 34, 50, 17, 17, 1, 14, 27, 15, 35, 23, 32, 21, 56, 52, 43, 45, 38, 74, 52, 28, 40, 51, 99, 72, 47, 82, 78, 9, 16, 44, 94, 38, 90], [52, 48, 12, 76, 55, 89, 94, 97, 52, 99, 1, 29, 41, 1, 78, 43, 86, 16, 93, 29, 25, 83, 83, 78, 71, 57, 98, 19, 19, 25, 13, 55, 52, 95, 75, 14, 28, 38, 93, 88, 69, 53, 20, 44, 67, 57, 94, 7], [34, 46, 56, 14, 19, 41, 73, 18, 96, 99, 45, 82, 1, 93, 51, 80, 5, 20, 14, 29, 96, 16, 92, 18, 17, 12, 87, 77, 65, 70, 46, 90, 32, 53, 56, 69, 50, 50, 92, 52, 84, 42, 58, 11, 90, 80, 55, 66], [2, 35, 27, 4, 13, 85, 68, 1, 21, 62, 1, 95, 16, 32, 19, 80, 37, 81, 6, 97, 44, 95, 55, 88, 35, 16, 75, 35, 57, 81, 89, 9, 41, 68, 53, 58, 80, 86, 84, 43, 65, 69, 23, 32, 13, 36, 52, 5], [11, 74, 57, 15, 92, 66, 10, 83, 98, 58, 32, 95, 13, 66, 39, 33, 23, 18, 86, 90, 85, 5, 96, 2, 40, 17, 19, 7, 39, 32, 70, 90, 39, 2, 69, 57, 20, 47, 81, 20, 52, 81, 17, 91, 72, 17, 20, 98], [96, 37, 13, 9, 80, 60, 58, 46, 62, 79, 36, 48, 34, 6, 44, 30, 56, 94, 34, 79, 76, 89, 60, 3, 18, 8, 45, 95, 68, 5, 9, 82, 8, 34, 20, 27, 34, 34, 12, 15, 58, 59, 80, 76, 10, 65, 36, 39], [20, 10, 39, 70, 21, 21, 80, 89, 99, 42, 40, 67, 73, 18, 16, 74, 33, 92, 22, 28, 13, 19, 81, 38, 52, 70, 41, 39, 13, 87, 53, 61, 48, 43, 31, 14, 22, 19, 39, 95, 61, 49, 6, 36, 61, 15, 81, 53], [68, 26, 46, 53, 96, 87, 73, 7, 35, 56, 89, 41, 58, 24, 14, 4, 24, 77, 76, 47, 19, 60, 85, 1, 87, 60, 89, 88, 20, 60, 57, 56, 11, 54, 90, 85, 79, 63, 37, 33, 11, 6, 12, 9, 16, 41, 68, 52], [44, 20, 66, 30, 16, 72, 15, 3, 31, 32, 69, 93, 77, 43, 50, 63, 72, 42, 98, 28, 49, 9, 34, 49, 65, 89, 80, 31, 67, 12, 75, 27, 60, 65, 36, 96, 86, 70, 2, 39, 63, 46, 95, 40, 10, 99, 27, 22], [67, 2, 94, 6, 87, 53, 8, 87, 36, 39, 72, 59, 85, 60, 19, 36, 71, 71, 16, 48, 68, 35, 3, 99, 81, 31, 40, 45, 49, 33, 54, 69, 75, 78, 7, 60, 5, 5, 42, 57, 94, 75, 9, 32, 83, 1, 49, 15], [23, 31, 16, 78, 68, 20, 21, 55, 59, 71, 90, 72, 43, 2, 79, 11, 93, 64, 19, 21, 84, 89, 93, 1, 20, 5, 39, 77, 81, 82, 19, 44, 59, 71, 7, 63, 79, 94, 37, 63, 89, 52, 52, 30, 61, 22, 33, 3], [98, 99, 44, 46, 75, 2, 87, 79, 39, 85, 80, 76, 21, 22, 67, 46, 88, 94, 32, 43, 27, 41, 31, 99, 15, 25, 99, 66, 55, 92, 11, 18, 14, 36, 43, 12, 9, 50, 43, 97, 25, 60, 9, 70, 12, 43, 95, 87], [51, 61, 10, 97, 97, 32, 40, 18, 14, 90, 39, 1, 57, 62, 52, 51, 35, 94, 48, 63, 72, 16, 85, 24, 1, 66, 61, 7, 17, 50, 82, 31, 72, 83, 95, 15, 57, 99, 65, 51, 18, 73, 76, 94, 35, 73, 36, 84], [22, 73, 81, 80, 43, 73, 95, 3, 24, 5, 42, 31, 49, 54, 97, 53, 69, 25, 48, 67, 39, 98, 83, 83, 55, 74, 45, 83, 78, 15, 95, 56, 94, 80, 42, 38, 95, 71, 49, 94, 7, 7, 47, 13, 45, 25, 50, 64], [88, 80, 68, 97, 95, 56, 44, 59, 2, 30, 62, 54, 47, 2, 56, 68, 22, 87, 81, 71, 73, 80, 64, 87, 34, 29, 71, 98, 22, 64, 78, 29, 90, 15, 25, 66, 39, 92, 91, 75, 79, 11, 35, 57, 95, 74, 13, 27], [23, 99, 14, 62, 52, 33, 98, 58, 62, 13, 77, 21, 34, 36, 81, 40, 1, 1, 71, 59, 2, 85, 35, 50, 48, 62, 24, 24, 79, 26, 14, 52, 93, 76, 88, 98, 10, 34, 45, 73, 51, 31, 22, 19, 64, 95, 6, 8], [20, 88, 73, 46, 27, 35, 76, 10, 38, 80, 58, 26, 3, 72, 29, 45, 46, 12, 91, 23, 9, 15, 33, 15, 24, 14, 40, 73, 14, 4, 89, 78, 40, 11, 59, 76, 77, 80, 33, 3, 61, 1, 54, 65, 89, 53, 54, 38], [22, 73, 56, 45, 75, 2, 10, 5, 88, 72, 42, 34, 24, 12, 52, 23, 48, 69, 19, 77, 35, 8, 76, 85, 49, 92, 76, 5, 13, 54, 49, 58, 15, 45, 96, 72, 81, 64, 54, 82, 87, 4, 60, 23, 8, 95, 40, 13], [95, 49, 45, 39, 82, 36, 91, 66, 26, 2, 33, 80, 4, 55, 32, 81, 61, 7, 79, 83, 56, 67, 67, 5, 49, 20, 3, 61, 23, 16, 10, 64, 62, 36, 79, 74, 49, 67, 64, 14, 84, 29, 68, 52, 62, 39, 54, 50], [75, 71, 26, 55, 45, 54, 26, 94, 10, 44, 68, 30, 12, 87, 47, 72, 92, 85, 25, 78, 33, 42, 90, 33, 45, 50, 61, 14, 82, 61, 26, 81, 58, 4, 88, 69, 5, 91, 3, 24, 90, 88, 42, 52, 96, 54, 6, 49], [56, 17, 62, 40, 7, 94, 96, 82, 92, 15, 68, 71, 56, 47, 5, 7, 63, 28, 76, 93, 25, 71, 47, 20, 77, 48, 95, 3, 69, 77, 77, 50, 60, 66, 91, 75, 1, 11, 13, 39, 30, 7, 89, 19, 80, 22, 75, 68]],35,31,) ] for i, p_set in enumerate(param): param[i] = list(param[i]) param[i][0] = [[e - 50 for e in sorted(l)] for l in p_set[0]] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
null
MAXIMIZE_VOLUME_CUBOID_GIVEN_SUM_SIDES_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMIZE_VOLUME_CUBOID_GIVEN_SUM_SIDES_1{ static int f_gold ( int s ) { int length = s / 3 ; s -= length ; int breadth = s / 2 ; int height = s - breadth ; return length * breadth * height ; }
def f_gold ( s ) : length = int ( s / 3 ) s -= length breadth = s / 2 height = s - breadth return int ( length * breadth * height )
using namespace std; int f_gold ( int s ) { int length = s / 3; s -= length; int breadth = s / 2; int height = s - breadth; return length * breadth * height; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(8); param0.add(96); param0.add(96); param0.add(96); param0.add(12); param0.add(95); param0.add(72); param0.add(81); param0.add(42); param0.add(13); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (8,), (96,), (96,), (96,), (12,), (95,), (72,), (81,), (42,), (13,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {8,96,96,96,12,95,72,81,42,13}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
NUMBER_OF_BINARY_TREES_FOR_GIVEN_PREORDER_SEQUENCE_LENGTH
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_OF_BINARY_TREES_FOR_GIVEN_PREORDER_SEQUENCE_LENGTH{ static int f_gold ( int n ) { int BT [ ] = new int [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) BT [ i ] = 0 ; BT [ 0 ] = BT [ 1 ] = 1 ; for ( int i = 2 ; i <= n ; ++ i ) for ( int j = 0 ; j < i ; j ++ ) BT [ i ] += BT [ j ] * BT [ i - j - 1 ] ; return BT [ n ] ; }
def f_gold(n): BT = [0] * (n + 1) BT[0] = BT[1] = 1 for i in range(2, n + 1): for j in range(i): BT[i] += BT[j] * BT[i - j - 1] return BT[n]
using namespace std; int f_gold ( int n ) { int BT [ n + 1 ]; memset ( BT, 0, sizeof ( BT ) ); BT [ 0 ] = BT [ 1 ] = 1; for ( int i = 2; i <= n; ++ i ) for ( int j = 0; j < i; j ++ ) BT [ i ] += BT [ j ] * BT [ i - j - 1 ]; return BT [ n ]; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(87); param0.add(69); param0.add(15); param0.add(11); param0.add(11); param0.add(15); param0.add(47); param0.add(65); param0.add(50); param0.add(58); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (87,), (69,), (15,), (11,), (11,), (15,), (47,), (65,), (50,), (58,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success += 1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {87,69,15,11,11,15,47,65,50,58}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
GIVEN_P_AND_N_FIND_THE_LARGEST_X_SUCH_THAT_PX_DIVIDES_N_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class GIVEN_P_AND_N_FIND_THE_LARGEST_X_SUCH_THAT_PX_DIVIDES_N_2{ static int f_gold ( int n , int p ) { int ans = 0 ; while ( n > 0 ) { n /= p ; ans += n ; } return ans ; }
null
null
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(33); param0.add(81); param0.add(18); param0.add(77); param0.add(9); param0.add(31); param0.add(63); param0.add(66); param0.add(57); param0.add(14); List<Integer> param1 = new ArrayList<>(); param1.add(3); param1.add(71); param1.add(68); param1.add(66); param1.add(52); param1.add(69); param1.add(90); param1.add(48); param1.add(18); param1.add(64); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
null
CHECK_WHETHER_ARITHMETIC_PROGRESSION_CAN_FORMED_GIVEN_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_WHETHER_ARITHMETIC_PROGRESSION_CAN_FORMED_GIVEN_ARRAY{ static boolean f_gold ( int arr [ ] , int n ) { if ( n == 1 ) return true ; Arrays . sort ( arr ) ; int d = arr [ 1 ] - arr [ 0 ] ; for ( int i = 2 ; i < n ; i ++ ) if ( arr [ i ] - arr [ i - 1 ] != d ) return false ; return true ; }
def f_gold ( arr , n ) : if ( n == 1 ) : return True arr.sort ( ) d = arr [ 1 ] - arr [ 0 ] for i in range ( 2 , n ) : if ( arr [ i ] - arr [ i - 1 ] != d ) : return False return True
using namespace std; bool f_gold ( int arr [ ], int n ) { if ( n == 1 ) return true; sort ( arr, arr + n ); int d = arr [ 1 ] - arr [ 0 ]; for ( int i = 2; i < n; i ++ ) if ( arr [ i ] - arr [ i - 1 ] != d ) return false; return true; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,4,64,16}); param0.add(new int[]{0, 12, 4, 8}); param0.add(new int[]{-2, 2, 0, 4, 6}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0}); param0.add(new int[]{66,56,86,76,46}); param0.add(new int[]{66,56,56,86,76,46}); param0.add(new int[]{7,9,11,21,44,45,61,67,78,97,98,99}); param0.add(new int[]{66,-28,-26,50,-18,54,84,-2,-70,-74,6,-34,44,-36,-4,36,14,24,64,74,86,-96,54,-68,-84,-62,-36,34,-36,70,-50,6,62,-50,-34,-38,-28,74,78,-2,-12,-4}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{18,93,79,20,44,36,69,37,33,82,19,51,32,22,1,54,89,20,58,35,70,70,61,63,61,57,3,95,99,45,15,17,15,5,86,46,11,64,92,14,39,67}); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(4); param1.add(5); param1.add(7); param1.add(5); param1.add(6); param1.add(11); param1.add(33); param1.add(33); param1.add(40); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([1,4,64,16],4,), ([0, 12, 4, 8],4,), ([-2, 2, 0, 4, 6],5,), ([0,0,0,0,0,0,0,0,0,0,0,0],7,), ([66,56,86,76,46],5,), ([66,56,56,86,76,46],6,), ([7, 9, 11, 21, 44, 45, 61, 67, 78, 97, 98, 99],11,), ([66, -28, -26, 50, -18, 54, 84, -2, -70, -74, 6, -34, 44, -36, -4, 36, 14, 24, 64, 74, 86, -96, 54, -68, -84, -62, -36, 34, -36, 70, -50, 6, 62, -50, -34, -38, -28, 74, 78, -2, -12, -4],33,), ([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],33,), ([18, 93, 79, 20, 44, 36, 69, 37, 33, 82, 19, 51, 32, 22, 1, 54, 89, 20, 58, 35, 70, 70, 61, 63, 61, 57, 3, 95, 99, 45, 15, 17, 15, 5, 86, 46, 11, 64, 92, 14, 39, 67],40,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 { {1,4,64,16}, {0, 12, 4, 8}, {-2, 2, 0, 4, 6}, {0,0,0,0,0,0,0,0,0,0,0,0}, {66,56,86,76,46}, {66,56,56,86,76,46}, {7,9,11,21,44,45,61,67,78,97,98,99}, {66,-28,-26,50,-18,54,84,-2,-70,-74,6,-34,44,-36,-4,36,14,24,64,74,86,-96,54,-68,-84,-62,-36,34,-36,70,-50,6,62,-50,-34,-38,-28,74,78,-2,-12,-4}, {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}, {18,93,79,20,44,36,69,37,33,82,19,51,32,22,1,54,89,20,58,35,70,70,61,63,61,57,3,95,99,45,15,17,15,5,86,46,11,64,92,14,39,67}}; vector<int> param1 {4,4,5,7,5,6,11,33,33,40}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
COUNT_PAIRS_WHOSE_PRODUCTS_EXIST_IN_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_PAIRS_WHOSE_PRODUCTS_EXIST_IN_ARRAY{ static int f_gold ( int arr [ ] , int n ) { int result = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { int product = arr [ i ] * arr [ j ] ; for ( int k = 0 ; k < n ; k ++ ) { if ( arr [ k ] == product ) { result ++ ; break ; } } } } return result ; }
def f_gold ( arr , n ) : result = 0 ; for i in range ( 0 , n ) : for j in range ( i + 1 , n ) : product = arr [ i ] * arr [ j ] ; for k in range ( 0 , n ) : if ( arr [ k ] == product ) : result = result + 1 ; break ; return result ;
using namespace std; int f_gold ( int arr [ ], int n ) { int result = 0; for ( int i = 0; i < n; i ++ ) { for ( int j = i + 1; j < n; j ++ ) { int product = arr [ i ] * arr [ j ]; for ( int k = 0; k < n; k ++ ) { if ( arr [ k ] == product ) { result ++; break; } } } } return result; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,7,26,40,46,89,99}); param0.add(new int[]{98,42,-24,-60,74,86,6,8,72,-58,38,-20,6,-6,8,48,-34,30,60,66,38,-54,8,-94,-8,0,-64,-94,-94,-72,-84,-36,88,-62,-88,46,-4,88}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{37,97,57,82,29,68,94,38,81,48,13,84,57,5,27,87,11,35,82,53,67,31,15,99,6,93,91,92,3,23,90,27,6,33,78,3,19,19,27}); param0.add(new int[]{-80,-74,-72,-72,-66,-66,-62,-50,-44,-44,-28,-24,-24,-22,-16,-10,-6,-4,-2,2,2,4,12,16,16,28,30,32,32,38,38,72,84,86,88,90,96}); param0.add(new int[]{0,1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,1,1}); param0.add(new int[]{25,67}); param0.add(new int[]{82,74,-82,22,-28,-78,-22,-86,-74,42,-6,54,-88,-92,-14,-50,68,46,-50,46,-18,66,-76,-30,36,12,66}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{50,23,56,9}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(24); param1.add(44); param1.add(36); param1.add(34); param1.add(18); param1.add(1); param1.add(14); param1.add(32); param1.add(3); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([3, 7, 26, 40, 46, 89, 99],5,), ([98, 42, -24, -60, 74, 86, 6, 8, 72, -58, 38, -20, 6, -6, 8, 48, -34, 30, 60, 66, 38, -54, 8, -94, -8, 0, -64, -94, -94, -72, -84, -36, 88, -62, -88, 46, -4, 88],24,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],44,), ([37, 97, 57, 82, 29, 68, 94, 38, 81, 48, 13, 84, 57, 5, 27, 87, 11, 35, 82, 53, 67, 31, 15, 99, 6, 93, 91, 92, 3, 23, 90, 27, 6, 33, 78, 3, 19, 19, 27],36,), ([-80, -74, -72, -72, -66, -66, -62, -50, -44, -44, -28, -24, -24, -22, -16, -10, -6, -4, -2, 2, 2, 4, 12, 16, 16, 28, 30, 32, 32, 38, 38, 72, 84, 86, 88, 90, 96],34,), ([0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1],18,), ([25, 67],1,), ([82, 74, -82, 22, -28, -78, -22, -86, -74, 42, -6, 54, -88, -92, -14, -50, 68, 46, -50, 46, -18, 66, -76, -30, 36, 12, 66],14,), ([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],32,), ([50, 23, 56, 9],3,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{3,7,26,40,46,89,99},{98,42,-24,-60,74,86,6,8,72,-58,38,-20,6,-6,8,48,-34,30,60,66,38,-54,8,-94,-8,0,-64,-94,-94,-72,-84,-36,88,-62,-88,46,-4,88},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{37,97,57,82,29,68,94,38,81,48,13,84,57,5,27,87,11,35,82,53,67,31,15,99,6,93,91,92,3,23,90,27,6,33,78,3,19,19,27},{-80,-74,-72,-72,-66,-66,-62,-50,-44,-44,-28,-24,-24,-22,-16,-10,-6,-4,-2,2,2,4,12,16,16,28,30,32,32,38,38,72,84,86,88,90,96},{0,1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,1,1},{25,67},{82,74,-82,22,-28,-78,-22,-86,-74,42,-6,54,-88,-92,-14,-50,68,46,-50,46,-18,66,-76,-30,36,12,66},{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},{50,23,56,9}}; vector<int> param1 {5,24,44,36,34,18,1,14,32,3}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING_1{ static char f_gold ( String str ) { int n = str . length ( ) ; int count = 0 ; char res = str . charAt ( 0 ) ; int cur_count = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i < n - 1 && str . charAt ( i ) == str . charAt ( i + 1 ) ) cur_count ++ ; else { if ( cur_count > count ) { count = cur_count ; res = str . charAt ( i ) ; } cur_count = 1 ; } } return res ; }
def f_gold ( str ) : n = len ( str ) count = 0 res = str [ 0 ] cur_count = 1 for i in range ( n ) : if ( i < n - 1 and str [ i ] == str [ i + 1 ] ) : cur_count += 1 else : if cur_count > count : count = cur_count res = str [ i ] cur_count = 1 return res
using namespace std; char f_gold ( string str ) { int n = str . length ( ); int count = 0; char res = str [ 0 ]; int cur_count = 1; for ( int i = 0; i < n; i ++ ) { if ( i < n - 1 && str [ i ] == str [ i + 1 ] ) cur_count ++; else { if ( cur_count > count ) { count = cur_count; res = str [ i ]; } cur_count = 1; } } return res; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("geeekk"); param0.add("3786868"); param0.add("110"); param0.add("aaaabbcbbb"); param0.add("11"); param0.add("011101"); param0.add("WoHNyJYLC"); param0.add("3141711779"); param0.add("10111101101"); param0.add("aabbabababcc"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('geeekk',), ('3786868',), ('110',), ('aaaabbcbbb',), ('11',), ('011101',), ('WoHNyJYLC',), ('3141711779',), ('10111101101',), ('aabbabababcc',) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 {"geeekk","3786868","110","aaaabbcbbb","11","011101","WoHNyJYLC","3141711779","10111101101","aabbabababcc"}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
C_PROGRAM_CONCATENATE_STRING_GIVEN_NUMBER_TIMES
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class C_PROGRAM_CONCATENATE_STRING_GIVEN_NUMBER_TIMES{ static String f_gold ( String s , int n ) { String s1 = s ; for ( int i = 1 ; i < n ; i ++ ) s += s1 ; return s ; }
def f_gold ( s , n ) : s1 = s for i in range ( 1 , n ) : s += s1 return s
using namespace std; string f_gold ( string s, int n ) { string s1 = s; for ( int i = 1; i < n; i ++ ) s += s1; return s; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("LPWsaI"); param0.add("9037515104"); param0.add("00100010010111"); param0.add("SbwipuE"); param0.add("574314109"); param0.add("1101"); param0.add("f"); param0.add("068"); param0.add("000011001"); param0.add("BWbUtIkC"); List<Integer> param1 = new ArrayList<>(); param1.add(41); param1.add(72); param1.add(95); param1.add(27); param1.add(5); param1.add(70); param1.add(91); param1.add(50); param1.add(38); param1.add(79); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)).equals(f_gold(param0.get(i),param1.get(i)))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('LPWsaI',41,), ('9037515104',72,), ('00100010010111',95,), ('SbwipuE',27,), ('574314109',5,), ('1101',70,), ('f',91,), ('068',50,), ('000011001',38,), ('BWbUtIkC',79,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 {"LPWsaI","9037515104","00100010010111","SbwipuE","574314109","1101","f","068","000011001","BWbUtIkC"}; vector<int> param1 {41,72,95,27,5,70,91,50,38,79}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
PRODUCT_MAXIMUM_FIRST_ARRAY_MINIMUM_SECOND_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PRODUCT_MAXIMUM_FIRST_ARRAY_MINIMUM_SECOND_1{ public static int f_gold ( int arr1 [ ] , int arr2 [ ] , int n1 , int n2 ) { int max = arr1 [ 0 ] ; int min = arr2 [ 0 ] ; int i ; for ( i = 1 ; i < n1 && i < n2 ; ++ i ) { if ( arr1 [ i ] > max ) max = arr1 [ i ] ; if ( arr2 [ i ] < min ) min = arr2 [ i ] ; } while ( i < n1 ) { if ( arr1 [ i ] > max ) max = arr1 [ i ] ; i ++ ; } while ( i < n2 ) { if ( arr2 [ i ] < min ) min = arr2 [ i ] ; i ++ ; } return max * min ; }
null
using namespace std; int f_gold ( int arr1 [ ], int arr2 [ ], int n1, int n2 ) { int max = arr1 [ 0 ]; int min = arr2 [ 0 ]; int i; for ( i = 1; i < n1 && i < n2; ++ i ) { if ( arr1 [ i ] > max ) max = arr1 [ i ]; if ( arr2 [ i ] < min ) min = arr2 [ i ]; } while ( i < n1 ) { if ( arr1 [ i ] > max ) max = arr1 [ i ]; i ++; } while ( i < n2 ) { if ( arr2 [ i ] < min ) min = arr2 [ i ]; i ++; } return max * min; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,6,32,33,34,36,41,43,52,70,70,70,75,78,88,88,95,95}); param0.add(new int[]{78,-88,44,10,96,-46,-66,84,32,44,56,76,-72,-72,82,-12,-20,-76,8,-34,12,-22,-92,-74,76,46,86,-2,-76,-86,36,80}); param0.add(new int[]{0,0,1}); param0.add(new int[]{87,4,90,50,2,35,87}); param0.add(new int[]{-98,-86,-86,-82,-72,-72,-70,-68,-64,-58,-50,-48,-44,-38,-36,-32,-32,-30,-28,-16,-12,-12,-4,8,10,16,18,22,28,32,32,42,60,70,88,88,88,98,98}); param0.add(new int[]{0}); param0.add(new int[]{31,32,33,49,68,77,89,94}); param0.add(new int[]{64,-44,-6,12,-98,42,-48,-70,-76,30,-48,-72,32,-2,68,42,-60,86,-24,98,62,-60,36,-52,-50,-74,96,36,-30,66,-92,-74,8,74,-64,-24,-60,-70}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{35,11,39,23,49,12,96,98,46,76,29,1,88,71,27,49,12,24,95,61,38,33,59,97,56,7,97,7,71,59,46,68,45}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{2,4,11,25,26,26,32,39,50,53,65,66,69,74,81,83,89,99}); param1.add(new int[]{30,0,-50,-62,36,-26,-26,70,-72,-8,58,34,26,36,-14,52,18,-80,-64,92,-22,50,-10,56,2,42,90,-80,-94,-62,76,-56}); param1.add(new int[]{0,0,1}); param1.add(new int[]{33,90,2,95,54,94,96}); param1.add(new int[]{-98,-84,-72,-70,-60,-58,-54,-52,-44,-44,-24,-10,-6,2,10,12,12,14,18,22,30,34,42,48,50,54,54,56,68,68,70,76,76,78,86,88,88,90,96}); param1.add(new int[]{1}); param1.add(new int[]{7,26,28,35,36,37,81,98}); param1.add(new int[]{44,-70,16,60,84,-8,58,-64,-32,-58,38,-30,-38,-94,-64,-42,-42,-84,-94,2,-22,46,-72,-38,-28,0,-94,-92,-24,46,48,-18,-56,52,26,-60,-84,-68}); param1.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}); param1.add(new int[]{53,67,70,97,2,97,28,59,89,14,83,71,49,86,13,16,40,60,10,54,35,22,59,53,70,83,95,71,91,72,38,91,39}); List<Integer> param2 = new ArrayList<>(); param2.add(13); param2.add(26); param2.add(2); param2.add(5); param2.add(22); param2.add(0); param2.add(7); param2.add(21); param2.add(12); param2.add(31); List<Integer> param3 = new ArrayList<>(); param3.add(11); param3.add(31); param3.add(2); param3.add(4); param3.add(31); param3.add(0); param3.add(7); param3.add(23); param3.add(15); param3.add(27); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{4,6,32,33,34,36,41,43,52,70,70,70,75,78,88,88,95,95},{78,-88,44,10,96,-46,-66,84,32,44,56,76,-72,-72,82,-12,-20,-76,8,-34,12,-22,-92,-74,76,46,86,-2,-76,-86,36,80},{0,0,1},{87,4,90,50,2,35,87},{-98,-86,-86,-82,-72,-72,-70,-68,-64,-58,-50,-48,-44,-38,-36,-32,-32,-30,-28,-16,-12,-12,-4,8,10,16,18,22,28,32,32,42,60,70,88,88,88,98,98},{0},{31,32,33,49,68,77,89,94},{64,-44,-6,12,-98,42,-48,-70,-76,30,-48,-72,32,-2,68,42,-60,86,-24,98,62,-60,36,-52,-50,-74,96,36,-30,66,-92,-74,8,74,-64,-24,-60,-70},{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},{35,11,39,23,49,12,96,98,46,76,29,1,88,71,27,49,12,24,95,61,38,33,59,97,56,7,97,7,71,59,46,68,45}}; vector<vector<int>> param1 {{2,4,11,25,26,26,32,39,50,53,65,66,69,74,81,83,89,99},{30,0,-50,-62,36,-26,-26,70,-72,-8,58,34,26,36,-14,52,18,-80,-64,92,-22,50,-10,56,2,42,90,-80,-94,-62,76,-56},{0,0,1},{33,90,2,95,54,94,96},{-98,-84,-72,-70,-60,-58,-54,-52,-44,-44,-24,-10,-6,2,10,12,12,14,18,22,30,34,42,48,50,54,54,56,68,68,70,76,76,78,86,88,88,90,96},{1},{7,26,28,35,36,37,81,98},{44,-70,16,60,84,-8,58,-64,-32,-58,38,-30,-38,-94,-64,-42,-42,-84,-94,2,-22,46,-72,-38,-28,0,-94,-92,-24,46,48,-18,-56,52,26,-60,-84,-68},{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1},{53,67,70,97,2,97,28,59,89,14,83,71,49,86,13,16,40,60,10,54,35,22,59,53,70,83,95,71,91,72,38,91,39}}; vector<int> param2 {13,26,2,5,22,0,7,21,12,31}; vector<int> param3 {11,31,2,4,31,0,7,23,15,27}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),&param1[i].front(),param2[i],param3[i]) == f_gold(&param0[i].front(),&param1[i].front(),param2[i],param3[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
COUNT_NUMBER_OF_OCCURRENCES_OR_FREQUENCY_IN_A_SORTED_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_NUMBER_OF_OCCURRENCES_OR_FREQUENCY_IN_A_SORTED_ARRAY{ static int f_gold ( int arr [ ] , int n , int x ) { int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) if ( x == arr [ i ] ) res ++ ; return res ; }
def f_gold ( arr , n , x ) : res = 0 for i in range ( n ) : if x == arr [ i ] : res += 1 return res
using namespace std; int f_gold ( int arr [ ], int n, int x ) { int res = 0; for ( int i = 0; i < n; i ++ ) if ( x == arr [ i ] ) res ++; return res; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{16,18,24,27,34,36,41,43,43,52,59,76,86,87,90,91,94,96,98,98}); param0.add(new int[]{64,66,-36}); param0.add(new int[]{0,0,0}); param0.add(new int[]{9,85,34,43,70,96,44,7,27,33,34,5,91,84,76,45,20,37,15,37,20,24,13,49,74,13,50,81,81,66,23,36,91,80,61,15,96,70,90,25,16,62,75,63,6,65,38,12}); param0.add(new int[]{-98,-98,-98,-34,-32,-26,-12,0,18,52,68,72}); param0.add(new int[]{1,1,0,0,1,1,0,0,1,0,0,1,0,0,1,1}); param0.add(new int[]{1,3,6,6,10,12,15,16,21,22,23,29,33,37,40,40,43,52,55,59,64,65,71,72,80,83,86,86,88,88}); param0.add(new int[]{-14,-30,-38,-38,-8,40,-34,2,-84,68,-42,38,-14,0,-64,12,-2,-38,-8,-44,-88,-34,-80,-36,82,70,96,-32,16,-52,-12,-46,-28,-86,30,-14,50,-44,22,30,-4,78,52}); param0.add(new int[]{1,1,1,1}); param0.add(new int[]{11,50,1,93,12,7,55,35,36,62,61,71,16}); List<Integer> param1 = new ArrayList<>(); param1.add(14); param1.add(1); param1.add(2); param1.add(43); param1.add(11); param1.add(11); param1.add(29); param1.add(39); param1.add(2); param1.add(11); List<Integer> param2 = new ArrayList<>(); param2.add(43); param2.add(64); param2.add(0); param2.add(5); param2.add(-98); param2.add(1); param2.add(40); param2.add(26); param2.add(3); param2.add(8); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([16, 18, 24, 27, 34, 36, 41, 43, 43, 52, 59, 76, 86, 87, 90, 91, 94, 96, 98, 98],14,43,), ([64, 66, -36],1,64,), ([0, 0, 0],2,0,), ([9, 85, 34, 43, 70, 96, 44, 7, 27, 33, 34, 5, 91, 84, 76, 45, 20, 37, 15, 37, 20, 24, 13, 49, 74, 13, 50, 81, 81, 66, 23, 36, 91, 80, 61, 15, 96, 70, 90, 25, 16, 62, 75, 63, 6, 65, 38, 12],43,5,), ([-98, -98, -98, -34, -32, -26, -12, 0, 18, 52, 68, 72],11,-98,), ([1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1],11,1,), ([1, 3, 6, 6, 10, 12, 15, 16, 21, 22, 23, 29, 33, 37, 40, 40, 43, 52, 55, 59, 64, 65, 71, 72, 80, 83, 86, 86, 88, 88],29,40,), ([-14, -30, -38, -38, -8, 40, -34, 2, -84, 68, -42, 38, -14, 0, -64, 12, -2, -38, -8, -44, -88, -34, -80, -36, 82, 70, 96, -32, 16, -52, -12, -46, -28, -86, 30, -14, 50, -44, 22, 30, -4, 78, 52],39,26,), ([1, 1, 1, 1],2,3,), ([11, 50, 1, 93, 12, 7, 55, 35, 36, 62, 61, 71, 16],11,8,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{16,18,24,27,34,36,41,43,43,52,59,76,86,87,90,91,94,96,98,98},{64,66,-36},{0,0,0},{9,85,34,43,70,96,44,7,27,33,34,5,91,84,76,45,20,37,15,37,20,24,13,49,74,13,50,81,81,66,23,36,91,80,61,15,96,70,90,25,16,62,75,63,6,65,38,12},{-98,-98,-98,-34,-32,-26,-12,0,18,52,68,72},{1,1,0,0,1,1,0,0,1,0,0,1,0,0,1,1},{1,3,6,6,10,12,15,16,21,22,23,29,33,37,40,40,43,52,55,59,64,65,71,72,80,83,86,86,88,88},{-14,-30,-38,-38,-8,40,-34,2,-84,68,-42,38,-14,0,-64,12,-2,-38,-8,-44,-88,-34,-80,-36,82,70,96,-32,16,-52,-12,-46,-28,-86,30,-14,50,-44,22,30,-4,78,52},{1,1,1,1},{11,50,1,93,12,7,55,35,36,62,61,71,16}}; vector<int> param1 {14,1,2,43,11,11,29,39,2,11}; vector<int> param2 {43,64,0,5,-98,1,40,26,3,8}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i],param2[i]) == f_gold(&param0[i].front(),param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
FIRST_ELEMENT_OCCURRING_K_TIMES_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIRST_ELEMENT_OCCURRING_K_TIMES_ARRAY{ static int f_gold ( int arr [ ] , int n , int k ) { HashMap < Integer , Integer > count_map = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = 0 ; if ( count_map . get ( arr [ i ] ) != null ) { a = count_map . get ( arr [ i ] ) ; } count_map . put ( arr [ i ] , a + 1 ) ; } for ( int i = 0 ; i < n ; i ++ ) { if ( count_map . get ( arr [ i ] ) == k ) { return arr [ i ] ; } } return - 1 ; }
def f_gold ( arr , n , k ) : count_map = { } ; for i in range ( 0 , n ) : if ( arr [ i ] in count_map.keys ( ) ) : count_map [ arr [ i ] ] += 1 else : count_map [ arr [ i ] ] = 1 i += 1 for i in range ( 0 , n ) : if ( count_map [ arr [ i ] ] == k ) : return arr [ i ] i += 1 return - 1
using namespace std; int f_gold ( int arr [ ], int n, int k ) { unordered_map < int, int > count_map; for ( int i = 0; i < n; i ++ ) count_map [ arr [ i ] ] ++; for ( int i = 0; i < n; i ++ ) if ( count_map [ arr [ i ] ] == k ) return arr [ i ]; return - 1; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,3,4,4,7,18,20,23,27,30,31,31,32,35,36,43,45,46,49,50,53,55,59,60,64,64,65,68,78,80,80,85,95}); param0.add(new int[]{-26,32,36,6,64,24,-28,96}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{38,40,43,70,20,40,95,96,81,82}); param0.add(new int[]{-68,-8,-8,16,24,54}); param0.add(new int[]{1,0,1,0,0,0,1,0,1,0,0,0,1}); param0.add(new int[]{13,18,19,28,31,34,49,49,53,57,58,62,75,76,77,78,80,84,84,85,87,91,98,99}); param0.add(new int[]{-4,24,-86,-84,30,-16,12,-92,-68,22}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1}); param0.add(new int[]{55,44,75,97,25,65,76,53,20,78,25,59,61,29,81,35,15,78,41,44,31,33,39,93,26,67}); List<Integer> param1 = new ArrayList<>(); param1.add(30); param1.add(6); param1.add(15); param1.add(9); param1.add(3); param1.add(6); param1.add(20); param1.add(6); param1.add(8); param1.add(23); List<Integer> param2 = new ArrayList<>(); param2.add(2); param2.add(3); param2.add(7); param2.add(1); param2.add(2); param2.add(4); param2.add(2); param2.add(5); param2.add(10); param2.add(20); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([2, 3, 4, 4, 7, 18, 20, 23, 27, 30, 31, 31, 32, 35, 36, 43, 45, 46, 49, 50, 53, 55, 59, 60, 64, 64, 65, 68, 78, 80, 80, 85, 95],30,2,), ([-26, 32, 36, 6, 64, 24, -28, 96],6,3,), ([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],15,7,), ([38, 40, 43, 70, 20, 40, 95, 96, 81, 82],9,1,), ([-68, -8, -8, 16, 24, 54],3,2,), ([1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1],6,4,), ([13, 18, 19, 28, 31, 34, 49, 49, 53, 57, 58, 62, 75, 76, 77, 78, 80, 84, 84, 85, 87, 91, 98, 99],20,2,), ([-4, 24, -86, -84, 30, -16, 12, -92, -68, 22],6,5,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1],8,10,), ([55, 44, 75, 97, 25, 65, 76, 53, 20, 78, 25, 59, 61, 29, 81, 35, 15, 78, 41, 44, 31, 33, 39, 93, 26, 67],23,20,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{2,3,4,4,7,18,20,23,27,30,31,31,32,35,36,43,45,46,49,50,53,55,59,60,64,64,65,68,78,80,80,85,95},{-26,32,36,6,64,24,-28,96},{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},{38,40,43,70,20,40,95,96,81,82},{-68,-8,-8,16,24,54},{1,0,1,0,0,0,1,0,1,0,0,0,1},{13,18,19,28,31,34,49,49,53,57,58,62,75,76,77,78,80,84,84,85,87,91,98,99},{-4,24,-86,-84,30,-16,12,-92,-68,22},{0,0,0,0,0,0,0,0,0,1,1,1,1},{55,44,75,97,25,65,76,53,20,78,25,59,61,29,81,35,15,78,41,44,31,33,39,93,26,67}}; vector<int> param1 {30,6,15,9,3,6,20,6,8,23}; vector<int> param2 {2,3,7,1,2,4,2,5,10,20}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i],param2[i]) == f_gold(&param0[i].front(),param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SPLIT_ARRAY_ADD_FIRST_PART_END
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SPLIT_ARRAY_ADD_FIRST_PART_END{ public static void f_gold ( int arr [ ] , int n , int k ) { for ( int i = 0 ; i < k ; i ++ ) { int x = arr [ 0 ] ; for ( int j = 0 ; j < n - 1 ; ++ j ) arr [ j ] = arr [ j + 1 ] ; arr [ n - 1 ] = x ; } }
def f_gold ( arr , n , k ) : for i in range ( 0 , k ) : x = arr [ 0 ] for j in range ( 0 , n - 1 ) : arr [ j ] = arr [ j + 1 ] arr [ n - 1 ] = x
using namespace std; void f_gold ( int arr [ ], int n, int k ) { for ( int i = 0; i < k; i ++ ) { int x = arr [ 0 ]; for ( int j = 0; j < n - 1; ++ j ) arr [ j ] = arr [ j + 1 ]; arr [ n - 1 ] = x; } }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{75}); param0.add(new int[]{-58,-60,-38,48,-2,32,-48,-46,90,-54,-18,28,72,86,0,-2,-74,12,-58,90,-30,10,-88,2,-14,82,-82,-46,2,-74}); param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{45,51,26,36,10,62,62,56,61,67,86,97,31,93,32,1,14,25,24,30,1,44,7,98,56,68,53,59,30,90,79,22}); param0.add(new int[]{-88,-72,-64,-46,-40,-16,-8,0,22,34,44}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,1,0,0,1,1,1,1,0}); param0.add(new int[]{8,17,20,23,31,32,37,37,44,45,48,64,64,67,69,71,75,77,78,81,83,87,89,92,94}); param0.add(new int[]{-8,-88,-68,48,8,50,30,-88,74,-16,6,74,36,32,22,96,-2,70,40,-46,98,34,2,94}); param0.add(new int[]{0,0,0,0,1,1,1,1,1}); param0.add(new int[]{80,14,35,25,60,86,45,95,32,29,94,6,63,66,38}); List<Integer> param1 = new ArrayList<>(); param1.add(0); param1.add(27); param1.add(7); param1.add(23); param1.add(6); param1.add(23); param1.add(21); param1.add(23); param1.add(5); param1.add(9); List<Integer> param2 = new ArrayList<>(); param2.add(0); param2.add(17); param2.add(7); param2.add(24); param2.add(6); param2.add(30); param2.add(20); param2.add(13); param2.add(8); param2.add(7); List<int [ ]> filled_function_param0 = new ArrayList<>(); filled_function_param0.add(new int[]{75}); filled_function_param0.add(new int[]{-58,-60,-38,48,-2,32,-48,-46,90,-54,-18,28,72,86,0,-2,-74,12,-58,90,-30,10,-88,2,-14,82,-82,-46,2,-74}); filled_function_param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1}); filled_function_param0.add(new int[]{45,51,26,36,10,62,62,56,61,67,86,97,31,93,32,1,14,25,24,30,1,44,7,98,56,68,53,59,30,90,79,22}); filled_function_param0.add(new int[]{-88,-72,-64,-46,-40,-16,-8,0,22,34,44}); filled_function_param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,1,0,0,1,1,1,1,0}); filled_function_param0.add(new int[]{8,17,20,23,31,32,37,37,44,45,48,64,64,67,69,71,75,77,78,81,83,87,89,92,94}); filled_function_param0.add(new int[]{-8,-88,-68,48,8,50,30,-88,74,-16,6,74,36,32,22,96,-2,70,40,-46,98,34,2,94}); filled_function_param0.add(new int[]{0,0,0,0,1,1,1,1,1}); filled_function_param0.add(new int[]{80,14,35,25,60,86,45,95,32,29,94,6,63,66,38}); List<Integer> filled_function_param1 = new ArrayList<>(); filled_function_param1.add(0); filled_function_param1.add(27); filled_function_param1.add(7); filled_function_param1.add(23); filled_function_param1.add(6); filled_function_param1.add(23); filled_function_param1.add(21); filled_function_param1.add(23); filled_function_param1.add(5); filled_function_param1.add(9); List<Integer> filled_function_param2 = new ArrayList<>(); filled_function_param2.add(0); filled_function_param2.add(17); filled_function_param2.add(7); filled_function_param2.add(24); filled_function_param2.add(6); filled_function_param2.add(30); filled_function_param2.add(20); filled_function_param2.add(13); filled_function_param2.add(8); filled_function_param2.add(7); for(int i = 0; i < param0.size(); ++i) { f_filled(filled_function_param0.get(i),filled_function_param1.get(i),filled_function_param2.get(i)); f_gold(param0.get(i),param1.get(i),param2.get(i)); if(Arrays.equals(param0.get(i), filled_function_param0.get(i)) && param1.get(i) == filled_function_param1.get(i) && param2.get(i) == filled_function_param2.get(i)) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([75],0,0,), ([-58, -60, -38, 48, -2, 32, -48, -46, 90, -54, -18, 28, 72, 86, 0, -2, -74, 12, -58, 90, -30, 10, -88, 2, -14, 82, -82, -46, 2, -74],27,17,), ([0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],7,7,), ([45, 51, 26, 36, 10, 62, 62, 56, 61, 67, 86, 97, 31, 93, 32, 1, 14, 25, 24, 30, 1, 44, 7, 98, 56, 68, 53, 59, 30, 90, 79, 22],23,24,), ([-88, -72, -64, -46, -40, -16, -8, 0, 22, 34, 44],6,6,), ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0],23,30,), ([8, 17, 20, 23, 31, 32, 37, 37, 44, 45, 48, 64, 64, 67, 69, 71, 75, 77, 78, 81, 83, 87, 89, 92, 94],21,20,), ([-8, -88, -68, 48, 8, 50, 30, -88, 74, -16, 6, 74, 36, 32, 22, 96, -2, 70, 40, -46, 98, 34, 2, 94],23,13,), ([0, 0, 0, 0, 1, 1, 1, 1, 1],5,8,), ([80, 14, 35, 25, 60, 86, 45, 95, 32, 29, 94, 6, 63, 66, 38],9,7,) ] filled_function_param = [ ([75],0,0,), ([-58, -60, -38, 48, -2, 32, -48, -46, 90, -54, -18, 28, 72, 86, 0, -2, -74, 12, -58, 90, -30, 10, -88, 2, -14, 82, -82, -46, 2, -74],27,17,), ([0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],7,7,), ([45, 51, 26, 36, 10, 62, 62, 56, 61, 67, 86, 97, 31, 93, 32, 1, 14, 25, 24, 30, 1, 44, 7, 98, 56, 68, 53, 59, 30, 90, 79, 22],23,24,), ([-88, -72, -64, -46, -40, -16, -8, 0, 22, 34, 44],6,6,), ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0],23,30,), ([8, 17, 20, 23, 31, 32, 37, 37, 44, 45, 48, 64, 64, 67, 69, 71, 75, 77, 78, 81, 83, 87, 89, 92, 94],21,20,), ([-8, -88, -68, 48, 8, 50, 30, -88, 74, -16, 6, 74, 36, 32, 22, 96, -2, 70, 40, -46, 98, 34, 2, 94],23,13,), ([0, 0, 0, 0, 1, 1, 1, 1, 1],5,8,), ([80, 14, 35, 25, 60, 86, 45, 95, 32, 29, 94, 6, 63, 66, 38],9,7,) ] n_success = 0 for i, parameters_set in enumerate(param): f_filled(*(filled_function_param[i])) f_gold(*parameters_set) if parameters_set == filled_function_param[i]: n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{75},{-58,-60,-38,48,-2,32,-48,-46,90,-54,-18,28,72,86,0,-2,-74,12,-58,90,-30,10,-88,2,-14,82,-82,-46,2,-74},{0,0,0,0,0,1,1,1,1,1,1},{45,51,26,36,10,62,62,56,61,67,86,97,31,93,32,1,14,25,24,30,1,44,7,98,56,68,53,59,30,90,79,22},{-88,-72,-64,-46,-40,-16,-8,0,22,34,44},{0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,1,0,0,1,1,1,1,0},{8,17,20,23,31,32,37,37,44,45,48,64,64,67,69,71,75,77,78,81,83,87,89,92,94},{-8,-88,-68,48,8,50,30,-88,74,-16,6,74,36,32,22,96,-2,70,40,-46,98,34,2,94},{0,0,0,0,1,1,1,1,1},{80,14,35,25,60,86,45,95,32,29,94,6,63,66,38}}; vector<int> param1 {0,27,7,23,6,23,21,23,5,9}; vector<int> param2 {0,17,7,24,6,30,20,13,8,7}; vector<vector<int>> filled_function_param0 {{75},{-58,-60,-38,48,-2,32,-48,-46,90,-54,-18,28,72,86,0,-2,-74,12,-58,90,-30,10,-88,2,-14,82,-82,-46,2,-74},{0,0,0,0,0,1,1,1,1,1,1},{45,51,26,36,10,62,62,56,61,67,86,97,31,93,32,1,14,25,24,30,1,44,7,98,56,68,53,59,30,90,79,22},{-88,-72,-64,-46,-40,-16,-8,0,22,34,44},{0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,1,0,0,1,1,1,1,0},{8,17,20,23,31,32,37,37,44,45,48,64,64,67,69,71,75,77,78,81,83,87,89,92,94},{-8,-88,-68,48,8,50,30,-88,74,-16,6,74,36,32,22,96,-2,70,40,-46,98,34,2,94},{0,0,0,0,1,1,1,1,1},{80,14,35,25,60,86,45,95,32,29,94,6,63,66,38}}; vector<int> filled_function_param1 {0,27,7,23,6,23,21,23,5,9}; vector<int> filled_function_param2 {0,17,7,24,6,30,20,13,8,7}; for(int i = 0; i < param0.size(); ++i) { f_filled(&filled_function_param0[i].front(),filled_function_param1[i],filled_function_param2[i]); f_gold(&param0[i].front(),param1[i],param2[i]); if(equal(begin(param0[i]), end(param0[i]), begin(filled_function_param0[i])) && param1[i] == filled_function_param1[i] && param2[i] == filled_function_param2[i]) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
K_TH_LARGEST_SUM_CONTIGUOUS_SUBARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class K_TH_LARGEST_SUM_CONTIGUOUS_SUBARRAY{ static int f_gold ( int arr [ ] , int n , int k ) { int sum [ ] = new int [ n + 1 ] ; sum [ 0 ] = 0 ; sum [ 1 ] = arr [ 0 ] ; for ( int i = 2 ; i <= n ; i ++ ) sum [ i ] = sum [ i - 1 ] + arr [ i - 1 ] ; PriorityQueue < Integer > Q = new PriorityQueue < Integer > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = i ; j <= n ; j ++ ) { int x = sum [ j ] - sum [ i - 1 ] ; if ( Q . size ( ) < k ) Q . add ( x ) ; else { if ( Q . peek ( ) < x ) { Q . poll ( ) ; Q . add ( x ) ; } } } } return Q . poll ( ) ; }
import heapq def f_gold ( arr , n , k ) : sum = [ ] sum.append ( 0 ) sum.append ( arr [ 0 ] ) for i in range ( 2 , n + 1 ) : sum.append ( sum [ i - 1 ] + arr [ i - 1 ] ) Q = [ ] heapq.heapify ( Q ) for i in range ( 1 , n + 1 ) : for j in range ( i , n + 1 ) : x = sum [ j ] - sum [ i - 1 ] if len ( Q ) < k : heapq.heappush ( Q , x ) else : if Q [ 0 ] < x : heapq.heappop ( Q ) heapq.heappush ( Q , x ) return Q [ 0 ]
using namespace std; int f_gold ( int arr [ ], int n, int k ) { int sum [ n + 1 ]; sum [ 0 ] = 0; sum [ 1 ] = arr [ 0 ]; for ( int i = 2; i <= n; i ++ ) sum [ i ] = sum [ i - 1 ] + arr [ i - 1 ]; priority_queue < int, vector < int >, greater < int > > Q; for ( int i = 1; i <= n; i ++ ) { for ( int j = i; j <= n; j ++ ) { int x = sum [ j ] - sum [ i - 1 ]; if ( Q . size ( ) < k ) Q . push ( x ); else { if ( Q . top ( ) < x ) { Q . pop ( ); Q . push ( x ); } } } } return Q . top ( ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,3,5,7,8,29,29,44,47,52,60,65,73,83,87,92,92,95}); param0.add(new int[]{44,-98,-10,14,-6,-46,6,-74,-4,36,10,-2,30,28,96,-84,-36,-76,64,-74,-20,94,-4,14,78,52,-56,98,-68,-76,-10,20,88,-98,96,80,96,-32,-40,-30,82}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{58,21,97,78,78,57,29,33,57,81,66,32,11,82,28,72,46,67,42,15,60,45,16,37}); param0.add(new int[]{-92,-90,-88,-84,-68,-66,-62,-58,-52,-44,-22,-16,-4,-4,2,12,14,14,24,26,44,56,80,90,92,94,98}); param0.add(new int[]{1,1,1,1,1,1,1,1,0,0,0}); param0.add(new int[]{3,4,8,12,13,14,17,19,23,24,28,29,30,35,35,38,44,47,47,53,55,56,56,58,66,67,70,71,72,73,74,75,77,78,82,84,87,87,87,88,88,93,94,96}); param0.add(new int[]{20,-58,94,-70,18,16,-46,38,-44,-92,-20,-70,-30,50}); 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}); param0.add(new int[]{90,77,82,38,96,62,66,4,93,30,75,22,26,61,40,11,38,55,88,24,66,47,40,71,21,5,18,31,26,56,19,47,71,34}); List<Integer> param1 = new ArrayList<>(); param1.add(10); param1.add(34); param1.add(16); param1.add(14); param1.add(15); param1.add(5); param1.add(26); param1.add(11); param1.add(19); param1.add(28); List<Integer> param2 = new ArrayList<>(); param2.add(12); param2.add(37); param2.add(15); param2.add(20); param2.add(25); param2.add(5); param2.add(25); param2.add(7); param2.add(23); param2.add(32); 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()); } }
if __name__ == '__main__': param = [ ([2, 3, 5, 7, 8, 29, 29, 44, 47, 52, 60, 65, 73, 83, 87, 92, 92, 95],10,12,), ([44, -98, -10, 14, -6, -46, 6, -74, -4, 36, 10, -2, 30, 28, 96, -84, -36, -76, 64, -74, -20, 94, -4, 14, 78, 52, -56, 98, -68, -76, -10, 20, 88, -98, 96, 80, 96, -32, -40, -30, 82],34,37,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],16,15,), ([58, 21, 97, 78, 78, 57, 29, 33, 57, 81, 66, 32, 11, 82, 28, 72, 46, 67, 42, 15, 60, 45, 16, 37],14,20,), ([-92, -90, -88, -84, -68, -66, -62, -58, -52, -44, -22, -16, -4, -4, 2, 12, 14, 14, 24, 26, 44, 56, 80, 90, 92, 94, 98],15,25,), ([1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0],5,5,), ([3, 4, 8, 12, 13, 14, 17, 19, 23, 24, 28, 29, 30, 35, 35, 38, 44, 47, 47, 53, 55, 56, 56, 58, 66, 67, 70, 71, 72, 73, 74, 75, 77, 78, 82, 84, 87, 87, 87, 88, 88, 93, 94, 96],26,25,), ([20, -58, 94, -70, 18, 16, -46, 38, -44, -92, -20, -70, -30, 50],11,7,), ([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],19,23,), ([90, 77, 82, 38, 96, 62, 66, 4, 93, 30, 75, 22, 26, 61, 40, 11, 38, 55, 88, 24, 66, 47, 40, 71, 21, 5, 18, 31, 26, 56, 19, 47, 71, 34],28,32,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{2,3,5,7,8,29,29,44,47,52,60,65,73,83,87,92,92,95},{44,-98,-10,14,-6,-46,6,-74,-4,36,10,-2,30,28,96,-84,-36,-76,64,-74,-20,94,-4,14,78,52,-56,98,-68,-76,-10,20,88,-98,96,80,96,-32,-40,-30,82},{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1},{58,21,97,78,78,57,29,33,57,81,66,32,11,82,28,72,46,67,42,15,60,45,16,37},{-92,-90,-88,-84,-68,-66,-62,-58,-52,-44,-22,-16,-4,-4,2,12,14,14,24,26,44,56,80,90,92,94,98},{1,1,1,1,1,1,1,1,0,0,0},{3,4,8,12,13,14,17,19,23,24,28,29,30,35,35,38,44,47,47,53,55,56,56,58,66,67,70,71,72,73,74,75,77,78,82,84,87,87,87,88,88,93,94,96},{20,-58,94,-70,18,16,-46,38,-44,-92,-20,-70,-30,50},{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},{90,77,82,38,96,62,66,4,93,30,75,22,26,61,40,11,38,55,88,24,66,47,40,71,21,5,18,31,26,56,19,47,71,34}}; vector<int> param1 {10,34,16,14,15,5,26,11,19,28}; vector<int> param2 {12,37,15,20,25,5,25,7,23,32}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i],param2[i]) == f_gold(&param0[i].front(),param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
TEMPLE_OFFERINGS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class TEMPLE_OFFERINGS{ static int f_gold ( int n , int templeHeight [ ] ) { int sum = 0 ; for ( int i = 0 ; i < n ; ++ i ) { int left = 0 , right = 0 ; for ( int j = i - 1 ; j >= 0 ; -- j ) { if ( templeHeight [ j ] < templeHeight [ j + 1 ] ) ++ left ; else break ; } for ( int j = i + 1 ; j < n ; ++ j ) { if ( templeHeight [ j ] < templeHeight [ j - 1 ] ) ++ right ; else break ; } sum += Math . max ( right , left ) + 1 ; } return sum ; }
def f_gold ( n , templeHeight ) : sum = 0 for i in range ( n ) : left = 0 right = 0 for j in range ( i - 1 , - 1 , - 1 ) : if ( templeHeight [ j ] < templeHeight [ j + 1 ] ) : left += 1 else : break for j in range ( i + 1 , n ) : if ( templeHeight [ j ] < templeHeight [ j - 1 ] ) : right += 1 else : break sum += max ( right , left ) + 1 return sum
using namespace std; int f_gold ( int n, int templeHeight [ ] ) { int sum = 0; for ( int i = 0; i < n; ++ i ) { int left = 0, right = 0; for ( int j = i - 1; j >= 0; -- j ) { if ( templeHeight [ j ] < templeHeight [ j + 1 ] ) ++ left; else break; } for ( int j = i + 1; j < n; ++ j ) { if ( templeHeight [ j ] < templeHeight [ j - 1 ] ) ++ right; else break; } sum += max ( right, left ) + 1; } return sum; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(12); param0.add(46); param0.add(16); param0.add(9); param0.add(0); param0.add(38); param0.add(28); param0.add(9); param0.add(18); param0.add(29); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{3,11,12,15,16,21,24,29,32,39,42,44,51,68,79,81,81,85,92,94}); param1.add(new int[]{76,48,88,70,-64,66,-6,-58,26,-28,-42,-94,80,-4,-56,-46,4,90,-12,-78,64,18,-38,26,56,-24,66,-18,-12,0,-94,12,-10,4,-68,-20,88,2,-58,16,46,-80,-42,44,-86,96,-44}); param1.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}); param1.add(new int[]{2,95,20,50,2,58,20,14,65,69,78,7}); param1.add(new int[]{-88}); param1.add(new int[]{0,0,0,0,1,0,1,0,0,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,0,1,1,0,0,0,1,1,1,0,0}); param1.add(new int[]{2,3,6,8,9,10,14,17,17,22,25,27,29,29,30,32,33,35,38,42,50,51,51,57,59,59,59,60,62,62,63,67,70,75,76,77,81,81,83,84}); param1.add(new int[]{-52,62,74,-62,-58,62,38,42,-50,20}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{96,15,9,9,40,34,17,4,51,49,34,66,97,28,64,65,92,56,74,48,43,17,82,8,21,39,83,35,42,37,64,34,42,59,45,61,55,93,94,29,20,96,77,66}); 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()); } }
if __name__ == '__main__': param = [ (12,[3, 11, 12, 15, 16, 21, 24, 29, 32, 39, 42, 44, 51, 68, 79, 81, 81, 85, 92, 94],), (46,[76, 48, 88, 70, -64, 66, -6, -58, 26, -28, -42, -94, 80, -4, -56, -46, 4, 90, -12, -78, 64, 18, -38, 26, 56, -24, 66, -18, -12, 0, -94, 12, -10, 4, -68, -20, 88, 2, -58, 16, 46, -80, -42, 44, -86, 96, -44],), (16,[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],), (9,[2, 95, 20, 50, 2, 58, 20, 14, 65, 69, 78, 7],), (0,[-88],), (38,[0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0],), (28,[2, 3, 6, 8, 9, 10, 14, 17, 17, 22, 25, 27, 29, 29, 30, 32, 33, 35, 38, 42, 50, 51, 51, 57, 59, 59, 59, 60, 62, 62, 63, 67, 70, 75, 76, 77, 81, 81, 83, 84],), (9,[-52, 62, 74, -62, -58, 62, 38, 42, -50, 20],), (18,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],), (29,[96, 15, 9, 9, 40, 34, 17, 4, 51, 49, 34, 66, 97, 28, 64, 65, 92, 56, 74, 48, 43, 17, 82, 8, 21, 39, 83, 35, 42, 37, 64, 34, 42, 59, 45, 61, 55, 93, 94, 29, 20, 96, 77, 66],) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {12,46,16,9,0,38,28,9,18,29}; vector<vector<int>> param1 {{3,11,12,15,16,21,24,29,32,39,42,44,51,68,79,81,81,85,92,94},{76,48,88,70,-64,66,-6,-58,26,-28,-42,-94,80,-4,-56,-46,4,90,-12,-78,64,18,-38,26,56,-24,66,-18,-12,0,-94,12,-10,4,-68,-20,88,2,-58,16,46,-80,-42,44,-86,96,-44},{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},{2,95,20,50,2,58,20,14,65,69,78,7},{-88},{0,0,0,0,1,0,1,0,0,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,0,1,1,0,0,0,1,1,1,0,0},{2,3,6,8,9,10,14,17,17,22,25,27,29,29,30,32,33,35,38,42,50,51,51,57,59,59,59,60,62,62,63,67,70,75,76,77,81,81,83,84},{-52,62,74,-62,-58,62,38,42,-50,20},{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1},{96,15,9,9,40,34,17,4,51,49,34,66,97,28,64,65,92,56,74,48,43,17,82,8,21,39,83,35,42,37,64,34,42,59,45,61,55,93,94,29,20,96,77,66}}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],&param1[i].front()) == f_gold(param0[i],&param1[i].front())) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
COUNT_1S_SORTED_BINARY_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_1S_SORTED_BINARY_ARRAY{ static int f_gold ( int arr [ ] , int low , int high ) { if ( high >= low ) { int mid = low + ( high - low ) / 2 ; if ( ( mid == high || arr [ mid + 1 ] == 0 ) && ( arr [ mid ] == 1 ) ) return mid + 1 ; if ( arr [ mid ] == 1 ) return f_gold ( arr , ( mid + 1 ) , high ) ; return f_gold ( arr , low , ( mid - 1 ) ) ; } return 0 ; }
null
null
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{5,21,38,46,89,91}); param0.add(new int[]{-48,46,12,-68,-82,-16,86,32,98,86,44,-86,60,-28,-60,-6,12,88,-82,-84,28,4,64,30,82,94,64,-34,-46,90,60,52,46,-24,10}); param0.add(new int[]{0,0,1,1}); param0.add(new int[]{19,99,62,68,41,32,55,20,1,18,5,73,10,17,7,19,18,51,88,47,36,80,3,75,35,67,7,83,36,70,19,95,15,61,99,88,26}); param0.add(new int[]{-98,-98,-94,-92,-84,-74,-32,-14,0,0,6,36,48,50,52,60,64,68,72,84,86,88,96}); param0.add(new int[]{1,0,0,0,1,1,1,1,1,0,0,0,1,0,1,0,0,1,1,0,0,1,1,1,1,0}); param0.add(new int[]{2,4,4,8,9,13,16,16,18,19,20,21,22,26,27,28,29,30,37,40,40,41,48,51,54,54,55,61,66,67,68,74,75,77,77,80,80,81,82,84,84,86,88,90,91,95}); param0.add(new int[]{18,78,96,10,82,66,60,-48,-96,72,-66,72,-6,-84,28,90,-50,70,-6,-30,-20,94,30,-56,-16,-52,-16,76,36,50,70,-22,76,-16,-84,-44,-14,-22,-78,86,-60,-4,-22,76,20,56}); param0.add(new int[]{0}); param0.add(new int[]{38,25,44,82,89,86,5,22}); List<Integer> param1 = new ArrayList<>(); param1.add(3); param1.add(27); param1.add(3); param1.add(33); param1.add(11); param1.add(14); param1.add(29); param1.add(29); param1.add(0); param1.add(5); List<Integer> param2 = new ArrayList<>(); param2.add(3); param2.add(27); param2.add(3); param2.add(28); param2.add(14); param2.add(15); param2.add(36); param2.add(29); param2.add(0); param2.add(5); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
null
MINIMUM_NUMBER_OF_JUMPS_TO_REACH_END_OF_A_GIVEN_ARRAY_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_NUMBER_OF_JUMPS_TO_REACH_END_OF_A_GIVEN_ARRAY_2{ static int f_gold ( int arr [ ] , int n ) { int [ ] jumps = new int [ n ] ; int min ; jumps [ n - 1 ] = 0 ; for ( int i = n - 2 ; i >= 0 ; i -- ) { if ( arr [ i ] == 0 ) jumps [ i ] = Integer . MAX_VALUE ; else if ( arr [ i ] >= n - i - 1 ) jumps [ i ] = 1 ; else { min = Integer . MAX_VALUE ; for ( int j = i + 1 ; j < n && j <= arr [ i ] + i ; j ++ ) { if ( min > jumps [ j ] ) min = jumps [ j ] ; } if ( min != Integer . MAX_VALUE ) jumps [ i ] = min + 1 ; else jumps [ i ] = min ; } } return jumps [ 0 ] ; }
def f_gold ( arr , n ) : jumps = [ 0 for i in range ( n ) ] for i in range ( n - 2 , - 1 , - 1 ) : if ( arr [ i ] == 0 ) : jumps [ i ] = float ( 'inf' ) elif ( arr [ i ] >= n - i - 1 ) : jumps [ i ] = 1 else : min = float ( 'inf' ) for j in range ( i + 1 , n ) : if ( j <= arr [ i ] + i ) : if ( min > jumps [ j ] ) : min = jumps [ j ] if ( min != float ( 'inf' ) ) : jumps [ i ] = min + 1 else : jumps [ i ] = min return jumps [ 0 ]
using namespace std; int f_gold ( int arr [ ], int n ) { int * jumps = new int [ n ]; int min; jumps [ n - 1 ] = 0; for ( int i = n - 2; i >= 0; i -- ) { if ( arr [ i ] == 0 ) jumps [ i ] = INT_MAX; else if ( arr [ i ] >= n - i - 1 ) jumps [ i ] = 1; else { min = INT_MAX; for ( int j = i + 1; j < n && j <= arr [ i ] + i; j ++ ) { if ( min > jumps [ j ] ) min = jumps [ j ]; } if ( min != INT_MAX ) jumps [ i ] = min + 1; else jumps [ i ] = min; } } return jumps [ 0 ]; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,6,7,14,22,32,42,42,43,48,54,57,59,69,84,92,98}); param0.add(new int[]{98,-66,-70,-64,-88,-76,-90,16,58,68,-10,-42,-28,10,72,68,-30,60,92,-56,80,-4,-82,30,58,98,-56,98,-14,-38,-20,-74,-46,-22,78,36,-54,-64,80,-10,-26,82,96,-72,-36,-36,-32,-88,0}); 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}); param0.add(new int[]{64,25,63,54,7,43,79,27,34,13,84,80,34,48,5,56,67,2}); param0.add(new int[]{2,28,68}); param0.add(new int[]{1,0,0,0,0,1,1,1,1,0,1,0,0}); param0.add(new int[]{1,1,9,16,17,18,19,20,21,22,25,28,29,29,36,37,40,40,42,48,49,49,55,63,65,66,69,70,72,73,76,77,77,79,79,81,81,93,95,99}); param0.add(new int[]{38,-42,-8,98,-90,38,88,-8,70,-28,-50,-22,28,24,88,-26,58,48,6,0,68,-6,8,54,-2,46,-44,96,-82,-14,-48,-18,-16,-48,-44,-16,-58,-64}); 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}); param0.add(new int[]{98,46,12,55,57,11,25,64,92,35,90,72,95,30,75,67,64,12,31,84,70,96,71,80,62,34,70,10,54}); List<Integer> param1 = new ArrayList<>(); param1.add(11); param1.add(26); param1.add(41); param1.add(10); param1.add(2); param1.add(11); param1.add(24); param1.add(34); 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()); } }
if __name__ == '__main__': param = [ ([1, 6, 7, 14, 22, 32, 42, 42, 43, 48, 54, 57, 59, 69, 84, 92, 98],11,), ([98, -66, -70, -64, -88, -76, -90, 16, 58, 68, -10, -42, -28, 10, 72, 68, -30, 60, 92, -56, 80, -4, -82, 30, 58, 98, -56, 98, -14, -38, -20, -74, -46, -22, 78, 36, -54, -64, 80, -10, -26, 82, 96, -72, -36, -36, -32, -88, 0],26,), ([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],41,), ([64, 25, 63, 54, 7, 43, 79, 27, 34, 13, 84, 80, 34, 48, 5, 56, 67, 2],10,), ([2, 28, 68],2,), ([1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0],11,), ([1, 1, 9, 16, 17, 18, 19, 20, 21, 22, 25, 28, 29, 29, 36, 37, 40, 40, 42, 48, 49, 49, 55, 63, 65, 66, 69, 70, 72, 73, 76, 77, 77, 79, 79, 81, 81, 93, 95, 99],24,), ([38, -42, -8, 98, -90, 38, 88, -8, 70, -28, -50, -22, 28, 24, 88, -26, 58, 48, 6, 0, 68, -6, 8, 54, -2, 46, -44, 96, -82, -14, -48, -18, -16, -48, -44, -16, -58, -64],34,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],14,), ([98, 46, 12, 55, 57, 11, 25, 64, 92, 35, 90, 72, 95, 30, 75, 67, 64, 12, 31, 84, 70, 96, 71, 80, 62, 34, 70, 10, 54],25,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{1,6,7,14,22,32,42,42,43,48,54,57,59,69,84,92,98},{98,-66,-70,-64,-88,-76,-90,16,58,68,-10,-42,-28,10,72,68,-30,60,92,-56,80,-4,-82,30,58,98,-56,98,-14,-38,-20,-74,-46,-22,78,36,-54,-64,80,-10,-26,82,96,-72,-36,-36,-32,-88,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},{64,25,63,54,7,43,79,27,34,13,84,80,34,48,5,56,67,2},{2,28,68},{1,0,0,0,0,1,1,1,1,0,1,0,0},{1,1,9,16,17,18,19,20,21,22,25,28,29,29,36,37,40,40,42,48,49,49,55,63,65,66,69,70,72,73,76,77,77,79,79,81,81,93,95,99},{38,-42,-8,98,-90,38,88,-8,70,-28,-50,-22,28,24,88,-26,58,48,6,0,68,-6,8,54,-2,46,-44,96,-82,-14,-48,-18,-16,-48,-44,-16,-58,-64},{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1},{98,46,12,55,57,11,25,64,92,35,90,72,95,30,75,67,64,12,31,84,70,96,71,80,62,34,70,10,54}}; vector<int> param1 {11,26,41,10,2,11,24,34,14,25}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MINIMUM_SUM_SUBSEQUENCE_LEAST_ONE_EVERY_FOUR_CONSECUTIVE_ELEMENTS_PICKED
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_SUM_SUBSEQUENCE_LEAST_ONE_EVERY_FOUR_CONSECUTIVE_ELEMENTS_PICKED{ static int f_gold ( int [ ] arr , int n ) { int [ ] dp = new int [ n ] ; if ( n == 1 ) return arr [ 0 ] ; if ( n == 2 ) return Math . min ( arr [ 0 ] , arr [ 1 ] ) ; if ( n == 3 ) return Math . min ( arr [ 0 ] , Math . min ( arr [ 1 ] , arr [ 2 ] ) ) ; if ( n == 4 ) return Math . min ( Math . min ( arr [ 0 ] , arr [ 1 ] ) , Math . min ( arr [ 2 ] , arr [ 3 ] ) ) ; dp [ 0 ] = arr [ 0 ] ; dp [ 1 ] = arr [ 1 ] ; dp [ 2 ] = arr [ 2 ] ; dp [ 3 ] = arr [ 3 ] ; for ( int i = 4 ; i < n ; i ++ ) dp [ i ] = arr [ i ] + Math . min ( Math . min ( dp [ i - 1 ] , dp [ i - 2 ] ) , Math . min ( dp [ i - 3 ] , dp [ i - 4 ] ) ) ; return Math . min ( Math . min ( dp [ n - 1 ] , dp [ n - 2 ] ) , Math . min ( dp [ n - 4 ] , dp [ n - 3 ] ) ) ; }
def f_gold ( arr , n ) : dp = [ 0 ] * n if ( n == 1 ) : return arr [ 0 ] if ( n == 2 ) : return min ( arr [ 0 ] , arr [ 1 ] ) if ( n == 3 ) : return min ( arr [ 0 ] , min ( arr [ 1 ] , arr [ 2 ] ) ) if ( n == 4 ) : return min ( min ( arr [ 0 ] , arr [ 1 ] ) , min ( arr [ 2 ] , arr [ 3 ] ) ) dp [ 0 ] = arr [ 0 ] dp [ 1 ] = arr [ 1 ] dp [ 2 ] = arr [ 2 ] dp [ 3 ] = arr [ 3 ] for i in range ( 4 , n ) : dp [ i ] = arr [ i ] + min ( min ( dp [ i - 1 ] , dp [ i - 2 ] ) , min ( dp [ i - 3 ] , dp [ i - 4 ] ) ) return min ( min ( dp [ n - 1 ] , dp [ n - 2 ] ) , min ( dp [ n - 4 ] , dp [ n - 3 ] ) )
using namespace std; int f_gold ( int arr [ ], int n ) { int dp [ n ]; if ( n == 1 ) return arr [ 0 ]; if ( n == 2 ) return min ( arr [ 0 ], arr [ 1 ] ); if ( n == 3 ) return min ( arr [ 0 ], min ( arr [ 1 ], arr [ 2 ] ) ); if ( n == 4 ) return min ( min ( arr [ 0 ], arr [ 1 ] ), min ( arr [ 2 ], arr [ 3 ] ) ); dp [ 0 ] = arr [ 0 ]; dp [ 1 ] = arr [ 1 ]; dp [ 2 ] = arr [ 2 ]; dp [ 3 ] = arr [ 3 ]; for ( int i = 4; i < n; i ++ ) dp [ i ] = arr [ i ] + min ( min ( dp [ i - 1 ], dp [ i - 2 ] ), min ( dp [ i - 3 ], dp [ i - 4 ] ) ); return min ( min ( dp [ n - 1 ], dp [ n - 2 ] ), min ( dp [ n - 4 ], dp [ n - 3 ] ) ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,7,11,12,13,14,18,20,22,26,28,29,31,32,33,35,38,38,40,40,41,42,43,44,45,53,54,54,59,62,69,72,74,75,75,76,79,83,84,89,91,96,97,98,99,99}); param0.add(new int[]{50,-22,90,-40,46,86,50,44,12,-42,-58,6,52,-16,4,46,44,0,-64,78,-14,-80,30,-66,78,24,28,10,-72,-44,-28,-32,-30,94,-22,26,16,20,-52,-16,-80,2,-56,-70,-76,60,62}); 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}); param0.add(new int[]{63,18,13,2,1,94,11,49,82,97,75,98,25,20,96,82,60,94,24,15,79,48,40,60,9,62,24,69,31,78,34,83,22,88}); param0.add(new int[]{-74,16,96}); param0.add(new int[]{0,0,1,0,1,1}); param0.add(new int[]{2,5,6,8,10,16,18,19,20,21,24,30,34,36,39,42,52,53,54,55,56,57,70,71,72,73,75,75,77,78,82,85,87,88,89,91}); param0.add(new int[]{-40,12,-86,-54,-68,32,10,-24,-46,54,-64,20,22,88,62,-4,-2,-8,-32,88,-4,38,4,86,82,-16,-76,-44,54,-24,-92,74,50,-52,52}); 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}); param0.add(new int[]{4,53,96,86,69,81,86,95,80,43,25,66,24,72}); List<Integer> param1 = new ArrayList<>(); param1.add(30); param1.add(40); param1.add(14); param1.add(33); param1.add(1); param1.add(5); param1.add(25); param1.add(22); param1.add(20); 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()); } }
if __name__ == '__main__': param = [ ([2, 7, 11, 12, 13, 14, 18, 20, 22, 26, 28, 29, 31, 32, 33, 35, 38, 38, 40, 40, 41, 42, 43, 44, 45, 53, 54, 54, 59, 62, 69, 72, 74, 75, 75, 76, 79, 83, 84, 89, 91, 96, 97, 98, 99, 99],30,), ([50, -22, 90, -40, 46, 86, 50, 44, 12, -42, -58, 6, 52, -16, 4, 46, 44, 0, -64, 78, -14, -80, 30, -66, 78, 24, 28, 10, -72, -44, -28, -32, -30, 94, -22, 26, 16, 20, -52, -16, -80, 2, -56, -70, -76, 60, 62],40,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],14,), ([63, 18, 13, 2, 1, 94, 11, 49, 82, 97, 75, 98, 25, 20, 96, 82, 60, 94, 24, 15, 79, 48, 40, 60, 9, 62, 24, 69, 31, 78, 34, 83, 22, 88],33,), ([-74, 16, 96],1,), ([0, 0, 1, 0, 1, 1],5,), ([2, 5, 6, 8, 10, 16, 18, 19, 20, 21, 24, 30, 34, 36, 39, 42, 52, 53, 54, 55, 56, 57, 70, 71, 72, 73, 75, 75, 77, 78, 82, 85, 87, 88, 89, 91],25,), ([-40, 12, -86, -54, -68, 32, 10, -24, -46, 54, -64, 20, 22, 88, 62, -4, -2, -8, -32, 88, -4, 38, 4, 86, 82, -16, -76, -44, 54, -24, -92, 74, 50, -52, 52],22,), ([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],20,), ([4, 53, 96, 86, 69, 81, 86, 95, 80, 43, 25, 66, 24, 72],12,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{2,7,11,12,13,14,18,20,22,26,28,29,31,32,33,35,38,38,40,40,41,42,43,44,45,53,54,54,59,62,69,72,74,75,75,76,79,83,84,89,91,96,97,98,99,99},{50,-22,90,-40,46,86,50,44,12,-42,-58,6,52,-16,4,46,44,0,-64,78,-14,-80,30,-66,78,24,28,10,-72,-44,-28,-32,-30,94,-22,26,16,20,-52,-16,-80,2,-56,-70,-76,60,62},{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},{63,18,13,2,1,94,11,49,82,97,75,98,25,20,96,82,60,94,24,15,79,48,40,60,9,62,24,69,31,78,34,83,22,88},{-74,16,96},{0,0,1,0,1,1},{2,5,6,8,10,16,18,19,20,21,24,30,34,36,39,42,52,53,54,55,56,57,70,71,72,73,75,75,77,78,82,85,87,88,89,91},{-40,12,-86,-54,-68,32,10,-24,-46,54,-64,20,22,88,62,-4,-2,-8,-32,88,-4,38,4,86,82,-16,-76,-44,54,-24,-92,74,50,-52,52},{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},{4,53,96,86,69,81,86,95,80,43,25,66,24,72}}; vector<int> param1 {30,40,14,33,1,5,25,22,20,12}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
PROGRAM_CHECK_ARRAY_SORTED_NOT_ITERATIVE_RECURSIVE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_CHECK_ARRAY_SORTED_NOT_ITERATIVE_RECURSIVE{ static int f_gold ( int arr [ ] , int n ) { if ( n == 1 || n == 0 ) return 1 ; if ( arr [ n - 1 ] < arr [ n - 2 ] ) return 0 ; return f_gold ( arr , n - 1 ) ; }
null
using namespace std; int f_gold ( int arr [ ], int n ) { if ( n == 1 || n == 0 ) return 1; if ( arr [ n - 1 ] < arr [ n - 2 ] ) return 0; return f_gold ( arr, n - 1 ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,4,19,21,28,32,35,44,51,55,62,80,80,83,90,93,93}); param0.add(new int[]{84,-28,-42,38,-94,-70,34,54,38,-58,-54,-6,72,-32,-18,80,-6,-38,-30,-86,-10,14,92,-56,40,-58,-2,-6,-46,-80,72,-12,2,-64,36,98,-24}); param0.add(new int[]{0,1,1,1}); param0.add(new int[]{74,75,9,13,57,82,57,37,47,11,28,6,33,14,47,29,15,56,69,86,31,19,18,58,70,73,30,95,35,17,16,97,68,95,33,36,11,60,4,63,5,64,85,77,4}); param0.add(new int[]{-96,-92,-84,-78,-74,-68,-66,-64,-62,-50,-48,-48,-46,-38,-28,-28,-26,-24,-24,-20,-14,-12,-4,16,18,28,32,48,50,62,70,72,78,90,92}); param0.add(new int[]{0,1,0,1,0,0,0,1,1,1,1,1,0,1,0,1,1,1,0,1,0,0,0,1,1,1,0,1,1,1,1,1,1,0,1,0,1,1,1,0,0,1,0,1,1,1,0,0}); param0.add(new int[]{6,8,11,21,29,31,41,50,56,56,69,69,74,79,86,88,93,95,99}); param0.add(new int[]{10,-12,-36,72,-42,-94,38,-78,-4,6,12,6,-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,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[]{97,58,88,20,63,1,23,33,57,81,54,66,95,31,54,16,37,7,1,94,18,42,39,26,75,65,57,69,86,77,17,7,71,12,38,87,48,55,54,72,15,30,55}); List<Integer> param1 = new ArrayList<>(); param1.add(8); param1.add(21); param1.add(2); param1.add(31); param1.add(31); param1.add(38); param1.add(10); param1.add(6); param1.add(35); param1.add(29); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{1,4,19,21,28,32,35,44,51,55,62,80,80,83,90,93,93},{84,-28,-42,38,-94,-70,34,54,38,-58,-54,-6,72,-32,-18,80,-6,-38,-30,-86,-10,14,92,-56,40,-58,-2,-6,-46,-80,72,-12,2,-64,36,98,-24},{0,1,1,1},{74,75,9,13,57,82,57,37,47,11,28,6,33,14,47,29,15,56,69,86,31,19,18,58,70,73,30,95,35,17,16,97,68,95,33,36,11,60,4,63,5,64,85,77,4},{-96,-92,-84,-78,-74,-68,-66,-64,-62,-50,-48,-48,-46,-38,-28,-28,-26,-24,-24,-20,-14,-12,-4,16,18,28,32,48,50,62,70,72,78,90,92},{0,1,0,1,0,0,0,1,1,1,1,1,0,1,0,1,1,1,0,1,0,0,0,1,1,1,0,1,1,1,1,1,1,0,1,0,1,1,1,0,0,1,0,1,1,1,0,0},{6,8,11,21,29,31,41,50,56,56,69,69,74,79,86,88,93,95,99},{10,-12,-36,72,-42,-94,38,-78,-4,6,12,6,-48},{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},{97,58,88,20,63,1,23,33,57,81,54,66,95,31,54,16,37,7,1,94,18,42,39,26,75,65,57,69,86,77,17,7,71,12,38,87,48,55,54,72,15,30,55}}; vector<int> param1 {8,21,2,31,31,38,10,6,35,29}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
PRODUCT_NODES_K_TH_LEVEL_TREE_REPRESENTED_STRING
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PRODUCT_NODES_K_TH_LEVEL_TREE_REPRESENTED_STRING{ static int f_gold ( String tree , int k ) { int level = - 1 ; int product = 1 ; int n = tree . length ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( tree . charAt ( i ) == '(' ) level ++ ; else if ( tree . charAt ( i ) == ')' ) level -- ; else { if ( level == k ) product *= ( tree . charAt ( i ) - '0' ) ; } } return product ; }
def f_gold ( tree , k ) : level = - 1 product = 1 n = len ( tree ) for i in range ( 0 , n ) : if ( tree [ i ] == '(' ) : level += 1 elif ( tree [ i ] == ')' ) : level -= 1 else : if ( level == k ) : product *= ( int ( tree [ i ] ) - int ( '0' ) ) return product
using namespace std; int f_gold ( string tree, int k ) { int level = - 1; int product = 1; int n = tree . length ( ); for ( int i = 0; i < n; i ++ ) { if ( tree [ i ] == '(' ) level ++; else if ( tree [ i ] == ')' ) level --; else { if ( level == k ) product *= ( tree [ i ] - '0' ); } } return product; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("(0(5(6()())(4()(9()())))(7(1()())(3()())))"); param0.add("(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))"); param0.add("(0(5(6()())(4()(9()())))(7(1()())(3()())))"); param0.add("(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))"); param0.add("(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))"); param0.add("(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))"); param0.add("(0(5(6()())(4()(9()())))(7(1()())(3()())))"); param0.add("(0(5(6()())(4()(9()())))(7(1()())(3()())))"); param0.add("0010"); param0.add("kjtdgmy"); List<Integer> param1 = new ArrayList<>(); param1.add(2); param1.add(3); param1.add(1); param1.add(2); param1.add(4); param1.add(100); param1.add(3); param1.add(0); param1.add(12); param1.add(97); 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()); } }
if __name__ == '__main__': param = [ ('(0(5(6()())(4()(9()())))(7(1()())(3()())))',2,), ('(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))',3,), ('(0(5(6()())(4()(9()())))(7(1()())(3()())))',1,), ('(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))',2,), ('(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))',4,), ('(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))',100,), ('(0(5(6()())(4()(9()())))(7(1()())(3()())))',3,), ('(0(5(6()())(4()(9()())))(7(1()())(3()())))',0,), ('0010',12,), ('kjtdgmy',97,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 { "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "0010", "kjtdgmy"}; vector<int> param1 {2,3,1,2,4,100,3,0,12,97}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SIZE_SUBARRAY_MAXIMUM_SUM
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SIZE_SUBARRAY_MAXIMUM_SUM{ static int f_gold ( int a [ ] , int size ) { int max_so_far = Integer . MIN_VALUE , max_ending_here = 0 , start = 0 , end = 0 , s = 0 ; for ( int i = 0 ; i < size ; i ++ ) { max_ending_here += a [ i ] ; if ( max_so_far < max_ending_here ) { max_so_far = max_ending_here ; start = s ; end = i ; } if ( max_ending_here < 0 ) { max_ending_here = 0 ; s = i + 1 ; } } return ( end - start + 1 ) ; }
null
using namespace std; int f_gold ( int a [ ], int size ) { int max_so_far = INT_MIN, max_ending_here = 0, start = 0, end = 0, s = 0; for ( int i = 0; i < size; i ++ ) { max_ending_here += a [ i ]; if ( max_so_far < max_ending_here ) { max_so_far = max_ending_here; start = s; end = i; } if ( max_ending_here < 0 ) { max_ending_here = 0; s = i + 1; } } return ( end - start + 1 ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{7,7,16,20,21,22,34,34,37,37,49,53,54,55,58,59,60,66,67,68,73,80,80,88,90,98,99,99}); param0.add(new int[]{-90,-98,-10,-84,24}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{94,2,83,94,10,94,58,99,60,19,3,71,36,84,71,14,50,15}); param0.add(new int[]{-98,-96,-70,-64,-56,-38,-34,-24,-22,-2,26,32,36,50,62,70,70,72,72,74,78,82,84,86}); param0.add(new int[]{0,1,0,1,1,1,0,0,0,1,1,1,0,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,1,1,0,1,0,1,0}); param0.add(new int[]{1,2,2,5,13,14,15,18,21,34,42,48,50,63,67,68,69,75,80,80,81,83,84,89,90,90,91,92,95,98}); param0.add(new int[]{-88,-10,-88,-90,92,14,68,-90,-86}); 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,1,1,1,1,1}); param0.add(new int[]{28,39,90,39,12,90,24,89,54,44,3,26,44,36,67,92,3,79,10,45,22,21,39,91,2,5,72,21,55,48,75,47}); List<Integer> param1 = new ArrayList<>(); param1.add(21); param1.add(2); param1.add(19); param1.add(14); param1.add(13); param1.add(35); param1.add(22); param1.add(5); param1.add(24); 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()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{7,7,16,20,21,22,34,34,37,37,49,53,54,55,58,59,60,66,67,68,73,80,80,88,90,98,99,99},{-90,-98,-10,-84,24},{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},{94,2,83,94,10,94,58,99,60,19,3,71,36,84,71,14,50,15},{-98,-96,-70,-64,-56,-38,-34,-24,-22,-2,26,32,36,50,62,70,70,72,72,74,78,82,84,86},{0,1,0,1,1,1,0,0,0,1,1,1,0,0,1,0,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,1,1,0,1,0,1,0},{1,2,2,5,13,14,15,18,21,34,42,48,50,63,67,68,69,75,80,80,81,83,84,89,90,90,91,92,95,98},{-88,-10,-88,-90,92,14,68,-90,-86},{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},{28,39,90,39,12,90,24,89,54,44,3,26,44,36,67,92,3,79,10,45,22,21,39,91,2,5,72,21,55,48,75,47}}; vector<int> param1 {21,2,19,14,13,35,22,5,24,27}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
RECURSIVE_C_PROGRAM_LINEARLY_SEARCH_ELEMENT_GIVEN_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class RECURSIVE_C_PROGRAM_LINEARLY_SEARCH_ELEMENT_GIVEN_ARRAY{ static int f_gold ( int arr [ ] , int l , int r , int x ) { if ( r < l ) return - 1 ; if ( arr [ l ] == x ) return l ; if ( arr [ r ] == x ) return r ; return f_gold ( arr , l + 1 , r - 1 , x ) ; }
def f_gold ( arr , l , r , x ) : if r < l : return - 1 if arr [ l ] == x : return l if arr [ r ] == x : return r return f_gold ( arr , l + 1 , r - 1 , x )
using namespace std; int f_gold ( int arr [ ], int l, int r, int x ) { if ( r < l ) return - 1; if ( arr [ l ] == x ) return l; if ( arr [ r ] == x ) return r; return f_gold ( arr, l + 1, r - 1, x ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{10,74,5}); param0.add(new int[]{-90,72,36,96,42,0,-66,5}); param0.add(new int[]{0,5}); param0.add(new int[]{99,70,67,5}); param0.add(new int[]{-98,-98,-26,-26,-24,-18,-16,80,5}); param0.add(new int[]{1,1,1,1,0,1,5}); param0.add(new int[]{1,5,12,12,17,17,12,95,96,98,5}); param0.add(new int[]{50,-70,-30,-54,6,-10,70,84,5}); param0.add(new int[]{0,1,5}); param0.add(new int[]{59,21,28,3,14,5}); List<Integer> param1 = new ArrayList<>(); param1.add(0); param1.add(0); param1.add(0); param1.add(0); param1.add(0); param1.add(0); param1.add(0); param1.add(0); param1.add(0); param1.add(0); List<Integer> param2 = new ArrayList<>(); param2.add(2); param2.add(7); param2.add(1); param2.add(3); param2.add(8); param2.add(6); param2.add(10); param2.add(8); param2.add(2); param2.add(5); List<Integer> param3 = new ArrayList<>(); param3.add(1); param3.add(96); param3.add(-1); param3.add(3); param3.add(80); param3.add(1); param3.add(12); param3.add(27); param3.add(14); param3.add(28); 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()); } }
if __name__ == '__main__': param = [ ([10,74,5],0,2,1,), ([-90,72,36,96,42,0,-66,5],0,7,96,), ([0,5],0,1,-1,), ([99,70,67,5],0,3,3,), ([-98,-98,-26,-26,-24,-18,-16,80,5],0,8,80,), ([1,1,1,1,0,1,5],0,6,1,), ([1,5,12,12,17,17,12,95,96,98,5],0,0,12,), ([50,-70,-30,-54,6,-10,70,84,5],0,8,27,), ([0,1,5],0,2,14,), ([59,21,28,3,14,5],0,5,28,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{10,74,3},{-90,72,36,96,42,0,-66,4},{0},{99,70,67,5},{-98,-98,-26,-26,-24,-18,-16,80,5},{1,1,1,1,0,1,0},{1,5,12,12,17,17,12,95,96,98,4},{50,-70,-30,-54,6,-10,70,84,5},{0,1,5},{59,21,28,3,14,5}}; vector<int> param1 {0,0,0,0,0,0,0,0,0,0}; vector<int> param2 {2,7,1,3,8,6,10,8,2,5}; vector<int> param3 {1,96,-1,3,80,1,12,27,14,28}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i],param2[i],param3[i]) == f_gold(&param0[i].front(),param1[i],param2[i],param3[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CHECK_POSSIBLE_SORT_ARRAY_CONDITIONAL_SWAPPING_ADJACENT_ALLOWED
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_POSSIBLE_SORT_ARRAY_CONDITIONAL_SWAPPING_ADJACENT_ALLOWED{ static boolean f_gold ( int arr [ ] , int n ) { for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( arr [ i ] > arr [ i + 1 ] ) { if ( arr [ i ] - arr [ i + 1 ] == 1 ) { int temp = arr [ i ] ; arr [ i ] = arr [ i + 1 ] ; arr [ i + 1 ] = temp ; } else return false ; } } return true ; }
def f_gold ( arr , n ) : for i in range ( 0 , n - 1 ) : if ( arr [ i ] > arr [ i + 1 ] ) : if ( arr [ i ] - arr [ i + 1 ] == 1 ) : arr [ i ] , arr [ i + 1 ] = arr [ i + 1 ] , arr [ i ] else : return False return True
using namespace std; bool f_gold ( int arr [ ], int n ) { for ( int i = 0; i < n - 1; i ++ ) { if ( arr [ i ] > arr [ i + 1 ] ) { if ( arr [ i ] - arr [ i + 1 ] == 1 ) swap ( arr [ i ], arr [ i + 1 ] ); else return false; } } return true; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,4,12,16,37,44,47,51,55,57,57,62,62,62,64,69,69,70,72,81,81,88,89,97}); param0.add(new int[]{-86,0,14,-16,-12,-72,62,-34,-72,30,84,-60,84,-64,50,74,18,-82,-64,-64,-74,-56,86,84,-32,-10,20,4,8,96,82,26,42}); 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}); param0.add(new int[]{48,66,83,12,77,98,18,33,21,16,28,24,46,43}); param0.add(new int[]{-92,-58,-36,-28,-6,2,4,26,48,58,60,62,62,98}); param0.add(new int[]{1,0,0,0,0,1}); param0.add(new int[]{22,38,41,41,42,51,54,58,68,76,80,85}); param0.add(new int[]{84,-38,52,-72,-24,82,54,74,0}); param0.add(new int[]{0,1,1}); param0.add(new int[]{63,31,14,19,77,64,62,23,22,19,39,9,79,1,87,29,58,3,3,39,1,39,35,64,64}); List<Integer> param1 = new ArrayList<>(); param1.add(15); param1.add(18); param1.add(31); param1.add(13); param1.add(10); param1.add(4); param1.add(9); param1.add(8); param1.add(2); 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()); } }
if __name__ == '__main__': param = [ ([1, 4, 12, 16, 37, 44, 47, 51, 55, 57, 57, 62, 62, 62, 64, 69, 69, 70, 72, 81, 81, 88, 89, 97],15,), ([-86, 0, 14, -16, -12, -72, 62, -34, -72, 30, 84, -60, 84, -64, 50, 74, 18, -82, -64, -64, -74, -56, 86, 84, -32, -10, 20, 4, 8, 96, 82, 26, 42],18,), ([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],31,), ([48, 66, 83, 12, 77, 98, 18, 33, 21, 16, 28, 24, 46, 43],13,), ([-92, -58, -36, -28, -6, 2, 4, 26, 48, 58, 60, 62, 62, 98],10,), ([1, 0, 0, 0, 0, 1],4,), ([22, 38, 41, 41, 42, 51, 54, 58, 68, 76, 80, 85],9,), ([84, -38, 52, -72, -24, 82, 54, 74, 0],8,), ([0, 1, 1],2,), ([63, 31, 14, 19, 77, 64, 62, 23, 22, 19, 39, 9, 79, 1, 87, 29, 58, 3, 3, 39, 1, 39, 35, 64, 64],13,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{1,4,12,16,37,44,47,51,55,57,57,62,62,62,64,69,69,70,72,81,81,88,89,97},{-86,0,14,-16,-12,-72,62,-34,-72,30,84,-60,84,-64,50,74,18,-82,-64,-64,-74,-56,86,84,-32,-10,20,4,8,96,82,26,42},{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},{48,66,83,12,77,98,18,33,21,16,28,24,46,43},{-92,-58,-36,-28,-6,2,4,26,48,58,60,62,62,98},{1,0,0,0,0,1},{22,38,41,41,42,51,54,58,68,76,80,85},{84,-38,52,-72,-24,82,54,74,0},{0,1,1},{63,31,14,19,77,64,62,23,22,19,39,9,79,1,87,29,58,3,3,39,1,39,35,64,64}}; vector<int> param1 {15,18,31,13,10,4,9,8,2,13}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
C_PROGRAM_FACTORIAL_NUMBER_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class C_PROGRAM_FACTORIAL_NUMBER_2{ static int f_gold ( int n ) { return ( n == 1 || n == 0 ) ? 1 : n * f_gold ( n - 1 ) ; }
def f_gold ( n ) : return 1 if ( n == 1 or n == 0 ) else n * f_gold ( n - 1 )
using namespace std; int f_gold ( int n ) { return ( n == 1 || n == 0 ) ? 1 : n * f_gold ( n - 1 ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(66); param0.add(93); param0.add(39); param0.add(93); param0.add(68); param0.add(20); param0.add(37); param0.add(52); param0.add(52); 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()); } }
if __name__ == '__main__': param = [ (66,), (93,), (39,), (93,), (68,), (20,), (37,), (52,), (52,), (19,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {66,93,39,93,68,20,37,52,52,19}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SUM_SERIES_23_45_67_89_UPTO_N_TERMS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_SERIES_23_45_67_89_UPTO_N_TERMS{ static double f_gold ( int n ) { int i = 1 ; double res = 0.0 ; boolean sign = true ; while ( n > 0 ) { n -- ; if ( sign ) { sign = ! sign ; res = res + ( double ) ++ i / ++ i ; } else { sign = ! sign ; res = res - ( double ) ++ i / ++ i ; } } return res ; }
def f_gold ( n ) : i = 1 ; res = 0.0 ; sign = True ; while ( n > 0 ) : n = n - 1 ; if ( sign ) : sign = False ; res = res + ( i + 1 ) / ( i + 2 ) ; i = i + 2 ; else : sign = True ; res = res - ( i + 1 ) / ( i + 2 ) ; i = i + 2 ; return res ;
using namespace std; double f_gold ( int n ) { int i = 1; double res = 0.0; bool sign = true; while ( n > 0 ) { n --; if ( sign ) { sign = ! sign; res = res + ( double ) ++ i / ++ i; } else { sign = ! sign; res = res - ( double ) ++ i / ++ i; } } return res; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(49); param0.add(4); param0.add(60); param0.add(90); param0.add(96); param0.add(29); param0.add(86); param0.add(47); param0.add(77); param0.add(87); 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()); } }
if __name__ == '__main__': param = [ (49,), (4,), (60,), (90,), (96,), (29,), (86,), (47,), (77,), (87,) ] n_success = 0 for i, parameters_set in enumerate(param): if abs(1 - (0.0000001 + abs(f_gold(*parameters_set))) / (abs(f_filled(*parameters_set)) + 0.0000001)) < 0.001: n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {49,4,60,90,96,29,86,47,77,87}; for(int i = 0; i < param0.size(); ++i) { if(abs(1 - (0.0000001 + abs(f_gold(param0[i])) )/ (abs(f_filled(param0[i])) + 0.0000001)) < 0.001) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
COUNT_NUMBER_PAIRS_N_B_N_GCD_B_B
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_NUMBER_PAIRS_N_B_N_GCD_B_B{ static int f_gold ( int n ) { int k = n ; int imin = 1 ; int ans = 0 ; while ( imin <= n ) { int imax = n / k ; ans += k * ( imax - imin + 1 ) ; imin = imax + 1 ; k = n / imin ; } return ans ; }
def f_gold(n): k = n imin = 1 ans = 0 while (imin <= n): imax = n / k ans += k * (imax - imin + 1) imin = imax + 1 k = n / imin return ans
using namespace std; int f_gold ( int n ) { int k = n; int imin = 1; int ans = 0; while ( imin <= n ) { int imax = n / k; ans += k * ( imax - imin + 1 ); imin = imax + 1; k = n / imin; } return ans; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(17); param0.add(72); param0.add(43); param0.add(55); param0.add(62); param0.add(22); param0.add(17); param0.add(68); param0.add(20); param0.add(29); 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()); } }
if __name__ == '__main__': param = [ (17,), (72,), (43,), (55,), (62,), (22,), (17,), (68,), (20,), (29,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success += 1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {17,72,43,55,62,22,17,68,20,29}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CALCULATE_VOLUME_DODECAHEDRON
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CALCULATE_VOLUME_DODECAHEDRON{ static double f_gold ( int side ) { return ( ( ( 15 + ( 7 * ( Math . sqrt ( 5 ) ) ) ) / 4 ) * ( Math . pow ( side , 3 ) ) ) ; }
import math def f_gold ( side ) : return ( ( ( 15 + ( 7 * ( math.sqrt ( 5 ) ) ) ) / 4 ) * ( math.pow ( side , 3 ) ) )
using namespace std; double f_gold ( int side ) { return ( ( ( 15 + ( 7 * ( sqrt ( 5 ) ) ) ) / 4 ) * ( pow ( side, 3 ) ) ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(56); param0.add(73); param0.add(22); param0.add(10); param0.add(84); param0.add(20); param0.add(51); param0.add(91); param0.add(10); param0.add(83); 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()); } }
if __name__ == '__main__': param = [ (56,), (73,), (22,), (10,), (84,), (20,), (51,), (91,), (10,), (83,) ] n_success = 0 for i, parameters_set in enumerate(param): if abs(1 - (0.0000001 + abs(f_gold(*parameters_set))) / (abs(f_filled(*parameters_set)) + 0.0000001)) < 0.001: n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {56,73,22,10,84,20,51,91,10,83}; for(int i = 0; i < param0.size(); ++i) { if(abs(1 - (0.0000001 + abs(f_gold(param0[i])) )/ (abs(f_filled(param0[i])) + 0.0000001)) < 0.001) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SORT_ARRAY_CONTAIN_1_N_VALUES
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; class SORT_ARRAY_CONTAIN_1_N_VALUES{ static void f_gold ( int [ ] arr , int n ) { for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = i + 1 ; } }
def f_gold ( arr , n ) : for i in range ( n ) : arr [ i ] = i + 1
using namespace std; void f_gold ( int arr [ ], int n ) { for ( int i = 0; i < n; i ++ ) { arr [ i ] = i + 1; } }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,3,6,7,9,11,15,15,17,19,21,23,26,27,37,48,48,51,53,53,59,64,69,69,70,71,72,84,93,96}); param0.add(new int[]{66,-28,6,25,-65,19,-86,-86,-90,40,-62}); 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}); param0.add(new int[]{85,84,8,36,93,76,14,54,85,86}); param0.add(new int[]{-90,-82,-80,-73,-67,-62,-62,-61,-58,-56,-56,-52,-50,-49,-49,-43,-43,-30,-26,-26,-15,-14,-13,-4,10,19,20,22,26,29,34,35,37,45,49,52,54,66,67,80,84,87,89,90}); param0.add(new int[]{1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,0,0,1,1,0,0,0,1,1,0,0,1,0,1,1,1}); param0.add(new int[]{10,11,13,19,19,30,33,36,40,42,44,47,49,52,53,58,66,68,72,82,87,89,90,94}); param0.add(new int[]{-46,-35,40,-76,-66,-47,36,-82,-43,12,-95,54,58,82,-87,-17,-71,-97,-10,4,23,86,-24}); param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{88,76,16,23,40,60,73,32,15,13,5,75,74,52,77,41,53,50,15,7,40,28,32,99,15,85}); List<Integer> param1 = new ArrayList<>(); param1.add(19); param1.add(8); param1.add(26); param1.add(9); param1.add(31); param1.add(29); param1.add(21); param1.add(12); param1.add(6); param1.add(18); List<int [ ]> filled_function_param0 = new ArrayList<>(); filled_function_param0.add(new int[]{3,3,6,7,9,11,15,15,17,19,21,23,26,27,37,48,48,51,53,53,59,64,69,69,70,71,72,84,93,96}); filled_function_param0.add(new int[]{66,-28,6,25,-65,19,-86,-86,-90,40,-62}); filled_function_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}); filled_function_param0.add(new int[]{85,84,8,36,93,76,14,54,85,86}); filled_function_param0.add(new int[]{-90,-82,-80,-73,-67,-62,-62,-61,-58,-56,-56,-52,-50,-49,-49,-43,-43,-30,-26,-26,-15,-14,-13,-4,10,19,20,22,26,29,34,35,37,45,49,52,54,66,67,80,84,87,89,90}); filled_function_param0.add(new int[]{1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,0,0,1,1,0,0,0,1,1,0,0,1,0,1,1,1}); filled_function_param0.add(new int[]{10,11,13,19,19,30,33,36,40,42,44,47,49,52,53,58,66,68,72,82,87,89,90,94}); filled_function_param0.add(new int[]{-46,-35,40,-76,-66,-47,36,-82,-43,12,-95,54,58,82,-87,-17,-71,-97,-10,4,23,86,-24}); filled_function_param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1}); filled_function_param0.add(new int[]{88,76,16,23,40,60,73,32,15,13,5,75,74,52,77,41,53,50,15,7,40,28,32,99,15,85}); List<Integer> filled_function_param1 = new ArrayList<>(); filled_function_param1.add(19); filled_function_param1.add(8); filled_function_param1.add(26); filled_function_param1.add(9); filled_function_param1.add(31); filled_function_param1.add(29); filled_function_param1.add(21); filled_function_param1.add(12); filled_function_param1.add(6); filled_function_param1.add(18); 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()); } }
if __name__ == '__main__': param = [ ([3, 3, 6, 7, 9, 11, 15, 15, 17, 19, 21, 23, 26, 27, 37, 48, 48, 51, 53, 53, 59, 64, 69, 69, 70, 71, 72, 84, 93, 96],19,), ([66, -28, 6, 25, -65, 19, -86, -86, -90, 40, -62],8,), ([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],26,), ([85, 84, 8, 36, 93, 76, 14, 54, 85, 86],9,), ([-90, -82, -80, -73, -67, -62, -62, -61, -58, -56, -56, -52, -50, -49, -49, -43, -43, -30, -26, -26, -15, -14, -13, -4, 10, 19, 20, 22, 26, 29, 34, 35, 37, 45, 49, 52, 54, 66, 67, 80, 84, 87, 89, 90],31,), ([1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1],29,), ([10, 11, 13, 19, 19, 30, 33, 36, 40, 42, 44, 47, 49, 52, 53, 58, 66, 68, 72, 82, 87, 89, 90, 94],21,), ([-46, -35, 40, -76, -66, -47, 36, -82, -43, 12, -95, 54, 58, 82, -87, -17, -71, -97, -10, 4, 23, 86, -24],12,), ([0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],6,), ([88, 76, 16, 23, 40, 60, 73, 32, 15, 13, 5, 75, 74, 52, 77, 41, 53, 50, 15, 7, 40, 28, 32, 99, 15, 85],18,) ] filled_function_param = [ ([3, 3, 6, 7, 9, 11, 15, 15, 17, 19, 21, 23, 26, 27, 37, 48, 48, 51, 53, 53, 59, 64, 69, 69, 70, 71, 72, 84, 93, 96],19,), ([66, -28, 6, 25, -65, 19, -86, -86, -90, 40, -62],8,), ([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],26,), ([85, 84, 8, 36, 93, 76, 14, 54, 85, 86],9,), ([-90, -82, -80, -73, -67, -62, -62, -61, -58, -56, -56, -52, -50, -49, -49, -43, -43, -30, -26, -26, -15, -14, -13, -4, 10, 19, 20, 22, 26, 29, 34, 35, 37, 45, 49, 52, 54, 66, 67, 80, 84, 87, 89, 90],31,), ([1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1],29,), ([10, 11, 13, 19, 19, 30, 33, 36, 40, 42, 44, 47, 49, 52, 53, 58, 66, 68, 72, 82, 87, 89, 90, 94],21,), ([-46, -35, 40, -76, -66, -47, 36, -82, -43, 12, -95, 54, 58, 82, -87, -17, -71, -97, -10, 4, 23, 86, -24],12,), ([0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],6,), ([88, 76, 16, 23, 40, 60, 73, 32, 15, 13, 5, 75, 74, 52, 77, 41, 53, 50, 15, 7, 40, 28, 32, 99, 15, 85],18,) ] n_success = 0 for i, parameters_set in enumerate(param): f_filled(*(filled_function_param[i])) f_gold(*parameters_set) if parameters_set == filled_function_param[i]: n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{3,3,6,7,9,11,15,15,17,19,21,23,26,27,37,48,48,51,53,53,59,64,69,69,70,71,72,84,93,96},{66,-28,6,25,-65,19,-86,-86,-90,40,-62},{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},{85,84,8,36,93,76,14,54,85,86},{-90,-82,-80,-73,-67,-62,-62,-61,-58,-56,-56,-52,-50,-49,-49,-43,-43,-30,-26,-26,-15,-14,-13,-4,10,19,20,22,26,29,34,35,37,45,49,52,54,66,67,80,84,87,89,90},{1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,0,0,1,1,0,0,0,1,1,0,0,1,0,1,1,1},{10,11,13,19,19,30,33,36,40,42,44,47,49,52,53,58,66,68,72,82,87,89,90,94},{-46,-35,40,-76,-66,-47,36,-82,-43,12,-95,54,58,82,-87,-17,-71,-97,-10,4,23,86,-24},{0,0,0,0,0,1,1,1,1,1,1},{88,76,16,23,40,60,73,32,15,13,5,75,74,52,77,41,53,50,15,7,40,28,32,99,15,85}}; vector<int> param1 {19,8,26,9,31,29,21,12,6,18}; vector<vector<int>> filled_function_param0 {{3,3,6,7,9,11,15,15,17,19,21,23,26,27,37,48,48,51,53,53,59,64,69,69,70,71,72,84,93,96},{66,-28,6,25,-65,19,-86,-86,-90,40,-62},{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},{85,84,8,36,93,76,14,54,85,86},{-90,-82,-80,-73,-67,-62,-62,-61,-58,-56,-56,-52,-50,-49,-49,-43,-43,-30,-26,-26,-15,-14,-13,-4,10,19,20,22,26,29,34,35,37,45,49,52,54,66,67,80,84,87,89,90},{1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,0,0,1,1,0,0,0,1,1,0,0,1,0,1,1,1},{10,11,13,19,19,30,33,36,40,42,44,47,49,52,53,58,66,68,72,82,87,89,90,94},{-46,-35,40,-76,-66,-47,36,-82,-43,12,-95,54,58,82,-87,-17,-71,-97,-10,4,23,86,-24},{0,0,0,0,0,1,1,1,1,1,1},{88,76,16,23,40,60,73,32,15,13,5,75,74,52,77,41,53,50,15,7,40,28,32,99,15,85}}; vector<int> filled_function_param1 {19,8,26,9,31,29,21,12,6,18}; for(int i = 0; i < param0.size(); ++i) { f_filled(&filled_function_param0[i].front(),filled_function_param1[i]); f_gold(&param0[i].front(),param1[i]); if(equal(begin(param0[i]), end(param0[i]), begin(filled_function_param0[i])) && param1[i] == filled_function_param1[i]) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
PROGRAM_CHECK_INPUT_INTEGER_STRING
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_CHECK_INPUT_INTEGER_STRING{ static boolean f_gold ( String s ) { for ( int i = 0 ; i < s . length ( ) ; i ++ ) if ( Character . isDigit ( s . charAt ( i ) ) == false ) return false ; return true ; }
def f_gold ( s ) : for i in range ( len ( s ) ) : if s [ i ].isdigit ( ) != True : return False return True
using namespace std; bool f_gold ( string s ) { for ( int i = 0; i < s . length ( ); i ++ ) if ( isdigit ( s [ i ] ) == false ) return false; return true; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("MgTOyHo NT"); param0.add("033675175"); param0.add("011001"); param0.add("XLlccG"); param0.add("8223900094410"); param0.add("000"); param0.add("aupp"); param0.add("90202721499"); param0.add("110000100011"); param0.add("MhYHsMQeLhG"); 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()); } }
if __name__ == '__main__': param = [ ('MgTOyHo NT',), ('033675175',), ('011001',), ('XLlccG',), ('8223900094410',), ('000',), ('aupp',), ('90202721499',), ('110000100011',), ('MhYHsMQeLhG',) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 {"MgTOyHo NT","033675175","011001","XLlccG","8223900094410","000","aupp","90202721499","110000100011","MhYHsMQeLhG"}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MINIMUM_XOR_VALUE_PAIR_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_XOR_VALUE_PAIR_1{ static int f_gold ( int arr [ ] , int n ) { Arrays . parallelSort ( arr ) ; int minXor = Integer . MAX_VALUE ; int val = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { val = arr [ i ] ^ arr [ i + 1 ] ; minXor = Math . min ( minXor , val ) ; } return minXor ; }
import sys def f_gold ( arr , n ) : arr.sort ( ) minXor = int ( sys.float_info.max ) val = 0 for i in range ( 0 , n - 1 ) : val = arr [ i ] ^ arr [ i + 1 ] ; minXor = min ( minXor , val ) ; return minXor
using namespace std; int f_gold ( int arr [ ], int n ) { sort ( arr, arr + n ); int minXor = INT_MAX; int val = 0; for ( int i = 0; i < n - 1; i ++ ) { val = arr [ i ] ^ arr [ i + 1 ]; minXor = min ( minXor, val ); } return minXor; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{8,11,12,27,32,32,36,56,57,66,68,70,74,78,82,83,96}); param0.add(new int[]{40,48,66,4,-60,42,-8,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}); param0.add(new int[]{98,6,82,95,87,20,11,63,78,70,37,12,57,67,10,49,38,28,86,7,61,50,32,68,91,66,57,29,2,64,65,15,16,4,7,76,44,52,81,89,3,36,57,95,48,24}); param0.add(new int[]{-88,-84,-76,-58,-40,-38,-28,-24,-20,-14,-12,16,20,28,28,30,40,44,56,58,60,92,92}); param0.add(new int[]{0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,0,1,1,0,1,0}); param0.add(new int[]{6,6,19,31,41,45,49,56,78,96,98}); param0.add(new int[]{62,-90,22,-84,-4}); 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}); param0.add(new int[]{83,13,43,99,34,74,56,20,93,65,92,58,91,72,37,10,39,7,29,69,42,28}); List<Integer> param1 = new ArrayList<>(); param1.add(10); param1.add(7); param1.add(19); param1.add(36); param1.add(13); param1.add(20); param1.add(6); param1.add(3); param1.add(21); param1.add(14); 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()); } }
if __name__ == '__main__': param = [ ([8, 11, 12, 27, 32, 32, 36, 56, 57, 66, 68, 70, 74, 78, 82, 83, 96],10,), ([40, 48, 66, 4, -60, 42, -8, 38],7,), ([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],19,), ([98, 6, 82, 95, 87, 20, 11, 63, 78, 70, 37, 12, 57, 67, 10, 49, 38, 28, 86, 7, 61, 50, 32, 68, 91, 66, 57, 29, 2, 64, 65, 15, 16, 4, 7, 76, 44, 52, 81, 89, 3, 36, 57, 95, 48, 24],36,), ([-88, -84, -76, -58, -40, -38, -28, -24, -20, -14, -12, 16, 20, 28, 28, 30, 40, 44, 56, 58, 60, 92, 92],13,), ([0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0],20,), ([6, 6, 19, 31, 41, 45, 49, 56, 78, 96, 98],6,), ([62, -90, 22, -84, -4],3,), ([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],21,), ([83, 13, 43, 99, 34, 74, 56, 20, 93, 65, 92, 58, 91, 72, 37, 10, 39, 7, 29, 69, 42, 28],14,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{8,11,12,27,32,32,36,56,57,66,68,70,74,78,82,83,96},{40,48,66,4,-60,42,-8,38},{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},{98,6,82,95,87,20,11,63,78,70,37,12,57,67,10,49,38,28,86,7,61,50,32,68,91,66,57,29,2,64,65,15,16,4,7,76,44,52,81,89,3,36,57,95,48,24},{-88,-84,-76,-58,-40,-38,-28,-24,-20,-14,-12,16,20,28,28,30,40,44,56,58,60,92,92},{0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,0,1,1,0,1,0},{6,6,19,31,41,45,49,56,78,96,98},{62,-90,22,-84,-4},{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},{83,13,43,99,34,74,56,20,93,65,92,58,91,72,37,10,39,7,29,69,42,28}}; vector<int> param1 {10,7,19,36,13,20,6,3,21,14}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SUM_K_TH_GROUP_ODD_POSITIVE_NUMBERS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_K_TH_GROUP_ODD_POSITIVE_NUMBERS{ public static int f_gold ( int k ) { int cur = ( k * ( k - 1 ) ) + 1 ; int sum = 0 ; while ( k -- > 0 ) { sum += cur ; cur += 2 ; } return sum ; }
def f_gold(k): cur = int((k * (k - 1)) + 1) sum = 0 while k: sum += cur cur += 2 k = k - 1 return sum
using namespace std; int f_gold ( int k ) { int cur = ( k * ( k - 1 ) ) + 1; int sum = 0; while ( k -- ) { sum += cur; cur += 2; } return sum; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(91); param0.add(52); param0.add(78); param0.add(51); param0.add(65); param0.add(39); param0.add(42); param0.add(12); param0.add(56); param0.add(98); 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()); } }
if __name__ == '__main__': param = [ (91,), (52,), (78,), (51,), (65,), (39,), (42,), (12,), (56,), (98,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success += 1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {91,52,78,51,65,39,42,12,56,98}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
FIND_SMALLEST_VALUE_REPRESENTED_SUM_SUBSET_GIVEN_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_SMALLEST_VALUE_REPRESENTED_SUM_SUBSET_GIVEN_ARRAY{ static int f_gold ( int arr [ ] , int n ) { int res = 1 ; for ( int i = 0 ; i < n && arr [ i ] <= res ; i ++ ) res = res + arr [ i ] ; return res ; }
def f_gold ( arr , n ) : res = 1 for i in range ( 0 , n ) : if arr [ i ] <= res : res = res + arr [ i ] else : break return res
using namespace std; int f_gold ( int arr [ ], int n ) { int res = 1; for ( int i = 0; i < n && arr [ i ] <= res; i ++ ) res = res + arr [ i ]; return res; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{16,23,24,41,48,58,72,75}); param0.add(new int[]{-14,-82,12,-14,-38,12,40,12,-74,42,-36,64}); param0.add(new int[]{0,0,1,1,1,1}); param0.add(new int[]{17,89,44}); param0.add(new int[]{-94,-92,-84,-82,-72,-58,-56,-40,-34,-34,-24,-22,-8,-8,12,14,16,16,22,22,34,46,54,58,68,72,74,78,88,96}); param0.add(new int[]{0,0,0,0,0,1,0,0,1,0,1,0}); param0.add(new int[]{2,12,13,13,13,16,28,32,34,41,41,47,49,49,50,52,58,61,63,65,67,68,68,74,80,80,84,84,89,93,94,98,99,99}); param0.add(new int[]{-54}); 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}); param0.add(new int[]{42,50,76,45,6,63,46,73,65,70,87,5,41,63,96,75,38,76,27,7,71,9,65,44,76,37,94,52,55,3,38,68,45,15,35,90,36,46,13,92,32,22,49,35,83}); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(8); param1.add(5); param1.add(2); param1.add(25); param1.add(8); param1.add(23); param1.add(0); param1.add(33); param1.add(35); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([16, 23, 24, 41, 48, 58, 72, 75],4,), ([-14, -82, 12, -14, -38, 12, 40, 12, -74, 42, -36, 64],8,), ([0, 0, 1, 1, 1, 1],5,), ([17, 89, 44],2,), ([-94, -92, -84, -82, -72, -58, -56, -40, -34, -34, -24, -22, -8, -8, 12, 14, 16, 16, 22, 22, 34, 46, 54, 58, 68, 72, 74, 78, 88, 96],25,), ([0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0],8,), ([2, 12, 13, 13, 13, 16, 28, 32, 34, 41, 41, 47, 49, 49, 50, 52, 58, 61, 63, 65, 67, 68, 68, 74, 80, 80, 84, 84, 89, 93, 94, 98, 99, 99],23,), ([-54],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],33,), ([42, 50, 76, 45, 6, 63, 46, 73, 65, 70, 87, 5, 41, 63, 96, 75, 38, 76, 27, 7, 71, 9, 65, 44, 76, 37, 94, 52, 55, 3, 38, 68, 45, 15, 35, 90, 36, 46, 13, 92, 32, 22, 49, 35, 83],35,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{16,23,24,41,48,58,72,75},{-14,-82,12,-14,-38,12,40,12,-74,42,-36,64},{0,0,1,1,1,1},{17,89,44},{-94,-92,-84,-82,-72,-58,-56,-40,-34,-34,-24,-22,-8,-8,12,14,16,16,22,22,34,46,54,58,68,72,74,78,88,96},{0,0,0,0,0,1,0,0,1,0,1,0},{2,12,13,13,13,16,28,32,34,41,41,47,49,49,50,52,58,61,63,65,67,68,68,74,80,80,84,84,89,93,94,98,99,99},{-54},{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},{42,50,76,45,6,63,46,73,65,70,87,5,41,63,96,75,38,76,27,7,71,9,65,44,76,37,94,52,55,3,38,68,45,15,35,90,36,46,13,92,32,22,49,35,83}}; vector<int> param1 {4,8,5,2,25,8,23,0,33,35}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
EFFICIENT_WAY_CHECK_WHETHER_N_TH_FIBONACCI_NUMBER_MULTIPLE_10
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class EFFICIENT_WAY_CHECK_WHETHER_N_TH_FIBONACCI_NUMBER_MULTIPLE_10{ static boolean f_gold ( int n ) { if ( n % 15 == 0 ) return true ; return false ; }
def f_gold ( n ) : return ( n % 15 == 0 )
using namespace std; bool f_gold ( int n ) { return ( n % 15 == 0 ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(30); param0.add(-30); param0.add(60); param0.add(90); param0.add(99); param0.add(32); param0.add(21); param0.add(65); param0.add(21); param0.add(99); 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()); } }
if __name__ == '__main__': param = [ (30,), (-30,), (60,), (90,), (99,), (32,), (21,), (65,), (21,), (99,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {30,-30,60,90,99,32,21,65,21,99}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
DYNAMIC_PROGRAMMING_SET_14_MAXIMUM_SUM_INCREASING_SUBSEQUENCE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DYNAMIC_PROGRAMMING_SET_14_MAXIMUM_SUM_INCREASING_SUBSEQUENCE{ static int f_gold ( int arr [ ] , int n ) { int i , j , max = 0 ; int msis [ ] = new int [ n ] ; for ( i = 0 ; i < n ; i ++ ) msis [ i ] = arr [ i ] ; for ( i = 1 ; i < n ; i ++ ) for ( j = 0 ; j < i ; j ++ ) if ( arr [ i ] > arr [ j ] && msis [ i ] < msis [ j ] + arr [ i ] ) msis [ i ] = msis [ j ] + arr [ i ] ; for ( i = 0 ; i < n ; i ++ ) if ( max < msis [ i ] ) max = msis [ i ] ; return max ; }
def f_gold ( arr , n ) : max = 0 msis = [ 0 for x in range ( n ) ] for i in range ( n ) : msis [ i ] = arr [ i ] for i in range ( 1 , n ) : for j in range ( i ) : if ( arr [ i ] > arr [ j ] and msis [ i ] < msis [ j ] + arr [ i ] ) : msis [ i ] = msis [ j ] + arr [ i ] for i in range ( n ) : if max < msis [ i ] : max = msis [ i ] return max
using namespace std; int f_gold ( int arr [ ], int n ) { int i, j, max = 0; int msis [ n ]; for ( i = 0; i < n; i ++ ) msis [ i ] = arr [ i ]; for ( i = 1; i < n; i ++ ) for ( j = 0; j < i; j ++ ) if ( arr [ i ] > arr [ j ] && msis [ i ] < msis [ j ] + arr [ i ] ) msis [ i ] = msis [ j ] + arr [ i ]; for ( i = 0; i < n; i ++ ) if ( max < msis [ i ] ) max = msis [ i ]; return max; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,5,7,12,23,31,31,45,47,60,67,70,84,85,91,96}); param0.add(new int[]{-88,-38,-50,-14,36,-32,0,-8,-12,-62,-46,66,-46,-26,6,-44,14,-74,-84,52,-28}); 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[]{85,42,7,35,35,21,97,59,88,50,12,44,85,22,38,23,42,61,44,63,23,69,28,17,73,20,71,80,15,42,28,10,56,77,43}); param0.add(new int[]{-92,-82,-82,-74,-72,-68,-68,-66,-60,-54,-42,-38,-36,-32,-30,-16,-14,-12,-10,14,24,28,34,34,38,42,44,52,70,72,80,84,86,94}); param0.add(new int[]{0,1,1,1,1,1,0,1,1,0,1,0,0,0}); param0.add(new int[]{33}); param0.add(new int[]{76,86,46,-70,92,6,70,-66,64,46,86,-42,-46,-24,8,76,4,-96,-86,18,70,-72,-56,-88,-96,62,22,20,42}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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[]{25,46,41,61,93,29,65,24,10,89,22,51,18,65,70,59,87,82,97,99,15,64,20,97,12,23,76}); List<Integer> param1 = new ArrayList<>(); param1.add(11); param1.add(18); param1.add(39); param1.add(26); param1.add(32); param1.add(8); param1.add(0); param1.add(21); param1.add(24); 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()); } }
if __name__ == '__main__': param = [ ([4, 5, 7, 12, 23, 31, 31, 45, 47, 60, 67, 70, 84, 85, 91, 96],11,), ([-88, -38, -50, -14, 36, -32, 0, -8, -12, -62, -46, 66, -46, -26, 6, -44, 14, -74, -84, 52, -28],18,), ([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],39,), ([85, 42, 7, 35, 35, 21, 97, 59, 88, 50, 12, 44, 85, 22, 38, 23, 42, 61, 44, 63, 23, 69, 28, 17, 73, 20, 71, 80, 15, 42, 28, 10, 56, 77, 43],26,), ([-92, -82, -82, -74, -72, -68, -68, -66, -60, -54, -42, -38, -36, -32, -30, -16, -14, -12, -10, 14, 24, 28, 34, 34, 38, 42, 44, 52, 70, 72, 80, 84, 86, 94],32,), ([0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0],8,), ([33],0,), ([76, 86, 46, -70, 92, 6, 70, -66, 64, 46, 86, -42, -46, -24, 8, 76, 4, -96, -86, 18, 70, -72, -56, -88, -96, 62, 22, 20, 42],21,), ([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],24,), ([25, 46, 41, 61, 93, 29, 65, 24, 10, 89, 22, 51, 18, 65, 70, 59, 87, 82, 97, 99, 15, 64, 20, 97, 12, 23, 76],20,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{4,5,7,12,23,31,31,45,47,60,67,70,84,85,91,96},{-88,-38,-50,-14,36,-32,0,-8,-12,-62,-46,66,-46,-26,6,-44,14,-74,-84,52,-28},{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},{85,42,7,35,35,21,97,59,88,50,12,44,85,22,38,23,42,61,44,63,23,69,28,17,73,20,71,80,15,42,28,10,56,77,43},{-92,-82,-82,-74,-72,-68,-68,-66,-60,-54,-42,-38,-36,-32,-30,-16,-14,-12,-10,14,24,28,34,34,38,42,44,52,70,72,80,84,86,94},{0,1,1,1,1,1,0,1,1,0,1,0,0,0},{33},{76,86,46,-70,92,6,70,-66,64,46,86,-42,-46,-24,8,76,4,-96,-86,18,70,-72,-56,-88,-96,62,22,20,42},{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},{25,46,41,61,93,29,65,24,10,89,22,51,18,65,70,59,87,82,97,99,15,64,20,97,12,23,76}}; vector<int> param1 {11,18,39,26,32,8,0,21,24,20}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SUM_NODES_K_TH_LEVEL_TREE_REPRESENTED_STRING
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_NODES_K_TH_LEVEL_TREE_REPRESENTED_STRING{ static int f_gold ( String tree , int k ) { int level = - 1 ; int sum = 0 ; int n = tree . length ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( tree . charAt ( i ) == '(' ) level ++ ; else if ( tree . charAt ( i ) == ')' ) level -- ; else { if ( level == k ) sum += ( tree . charAt ( i ) - '0' ) ; } } return sum ; }
def f_gold ( tree , k ) : level = - 1 sum = 0 n = len ( tree ) for i in range ( n ) : if ( tree [ i ] == '(' ) : level += 1 elif ( tree [ i ] == ')' ) : level -= 1 else : if ( level == k ) : sum += ( ord ( tree [ i ] ) - ord ( '0' ) ) return sum
using namespace std; int f_gold ( string tree, int k ) { int level = - 1; int sum = 0; int n = tree . length ( ); for ( int i = 0; i < n; i ++ ) { if ( tree [ i ] == '(' ) level ++; else if ( tree [ i ] == ')' ) level --; else { if ( level == k ) sum += ( tree [ i ] - '0' ); } } return sum; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("(0(5(6()())(4()(9()())))(7(1()())(3()())))"); param0.add("(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))"); param0.add("(0(5(6()())(4()(9()())))(7(1()())(3()())))"); param0.add("(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))"); param0.add("(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))"); param0.add("(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))"); param0.add("(0(5(6()())(4()(9()())))(7(1()())(3()())))"); param0.add("(0(5(6()())(4()(9()())))(7(1()())(3()())))"); param0.add("0010"); param0.add("kjtdgmy"); List<Integer> param1 = new ArrayList<>(); param1.add(2); param1.add(3); param1.add(1); param1.add(2); param1.add(4); param1.add(100); param1.add(3); param1.add(0); param1.add(12); param1.add(97); 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()); } }
if __name__ == '__main__': param = [ ('(0(5(6()())(4()(9()())))(7(1()())(3()())))',2,), ('(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))',3,), ('(0(5(6()())(4()(9()())))(7(1()())(3()())))',1,), ('(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))',2,), ('(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))',4,), ('(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))',100,), ('(0(5(6()())(4()(9()())))(7(1()())(3()())))',3,), ('(0(5(6()())(4()(9()())))(7(1()())(3()())))',0,), ('0010',12,), ('kjtdgmy',97,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 { "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "0010", "kjtdgmy"}; vector<int> param1 {2,3,1,2,4,100,3,0,12,97}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
PROGRAM_OCTAL_DECIMAL_CONVERSION
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_OCTAL_DECIMAL_CONVERSION{ static int f_gold ( int n ) { int num = n ; int dec_value = 0 ; int base = 1 ; int temp = num ; while ( temp > 0 ) { int last_digit = temp % 10 ; temp = temp / 10 ; dec_value += last_digit * base ; base = base * 8 ; } return dec_value ; }
def f_gold ( n ) : num = n ; dec_value = 0 ; base = 1 ; temp = num ; while ( temp ) : last_digit = temp % 10 ; temp = int ( temp / 10 ) ; dec_value += last_digit * base ; base = base * 8 ; return dec_value ;
using namespace std; int f_gold ( int n ) { int num = n; int dec_value = 0; int base = 1; int temp = num; while ( temp ) { int last_digit = temp % 10; temp = temp / 10; dec_value += last_digit * base; base = base * 8; } return dec_value; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(37); param0.add(25); param0.add(63); param0.add(66); param0.add(32); param0.add(5); param0.add(41); param0.add(82); param0.add(54); 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()); } }
if __name__ == '__main__': param = [ (37,), (25,), (63,), (66,), (32,), (5,), (41,), (82,), (54,), (5,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {37,25,63,66,32,5,41,82,54,5}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
REARRANGE_ARRAY_MAXIMUM_MINIMUM_FORM_SET_2_O1_EXTRA_SPACE_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; class REARRANGE_ARRAY_MAXIMUM_MINIMUM_FORM_SET_2_O1_EXTRA_SPACE_1{ public static void f_gold ( int arr [ ] , int n ) { int max_ele = arr [ n - 1 ] ; int min_ele = arr [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 2 == 0 ) { arr [ i ] = max_ele ; max_ele -= 1 ; } else { arr [ i ] = min_ele ; min_ele += 1 ; } } }
def f_gold ( arr , n ) : max_ele = arr [ n - 1 ] min_ele = arr [ 0 ] for i in range ( n ) : if i % 2 == 0 : arr [ i ] = max_ele max_ele -= 1 else : arr [ i ] = min_ele min_ele += 1
using namespace std; void f_gold ( int arr [ ], int n ) { int max_ele = arr [ n - 1 ]; int min_ele = arr [ 0 ]; for ( int i = 0; i < n; i ++ ) { if ( i % 2 == 0 ) { arr [ i ] = max_ele; max_ele -= 1; } else { arr [ i ] = min_ele; min_ele += 1; } } }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,4,8,10,12,14,14,17,18,19,20,25,28,29,30,31,34,35,37,38,40,41,42,45,47,49,54,54,55,58,58,63,65,66,66,67,67,72,74,75,75,80,82,86,92,95,96,99}); param0.add(new int[]{45,42,-91,90,-6,49,65,39,-80,-65,-47,75,10,80,36,-96,55,72,68,2,-53,-6,72,-52,-9,80,-16,-32,39,25,-27,-96,-24,-27,-23,-52}); 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[]{12,84,16}); param0.add(new int[]{-85,-77,-70,-67,-55,-51,-49,-41,-37,-24,-18,-8,-6,77,87,90}); param0.add(new int[]{0,0,1,1,1,1,1,1,1,0,1,1,0,0,0}); param0.add(new int[]{5,8,15,16,20,22,25,33,46,48,52,54,55,57,57,61,61,66,72,73,83,87,88,89,98}); param0.add(new int[]{31,2,-46,-86,-64,5,-18,-33,-90,-51,11,-35,-43,-73,13,33,-29,-17,-43,20,-7,-85}); 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[]{20,75,12,62,18,94,63,84,25,12}); List<Integer> param1 = new ArrayList<>(); param1.add(40); param1.add(23); param1.add(28); param1.add(2); param1.add(13); param1.add(12); param1.add(12); param1.add(13); param1.add(31); param1.add(9); List<int [ ]> filled_function_param0 = new ArrayList<>(); filled_function_param0.add(new int[]{3,4,8,10,12,14,14,17,18,19,20,25,28,29,30,31,34,35,37,38,40,41,42,45,47,49,54,54,55,58,58,63,65,66,66,67,67,72,74,75,75,80,82,86,92,95,96,99}); filled_function_param0.add(new int[]{45,42,-91,90,-6,49,65,39,-80,-65,-47,75,10,80,36,-96,55,72,68,2,-53,-6,72,-52,-9,80,-16,-32,39,25,-27,-96,-24,-27,-23,-52}); filled_function_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}); filled_function_param0.add(new int[]{12,84,16}); filled_function_param0.add(new int[]{-85,-77,-70,-67,-55,-51,-49,-41,-37,-24,-18,-8,-6,77,87,90}); filled_function_param0.add(new int[]{0,0,1,1,1,1,1,1,1,0,1,1,0,0,0}); filled_function_param0.add(new int[]{5,8,15,16,20,22,25,33,46,48,52,54,55,57,57,61,61,66,72,73,83,87,88,89,98}); filled_function_param0.add(new int[]{31,2,-46,-86,-64,5,-18,-33,-90,-51,11,-35,-43,-73,13,33,-29,-17,-43,20,-7,-85}); filled_function_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}); filled_function_param0.add(new int[]{20,75,12,62,18,94,63,84,25,12}); List<Integer> filled_function_param1 = new ArrayList<>(); filled_function_param1.add(40); filled_function_param1.add(23); filled_function_param1.add(28); filled_function_param1.add(2); filled_function_param1.add(13); filled_function_param1.add(12); filled_function_param1.add(12); filled_function_param1.add(13); filled_function_param1.add(31); filled_function_param1.add(9); 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()); } }
if __name__ == '__main__': param = [ ([3, 4, 8, 10, 12, 14, 14, 17, 18, 19, 20, 25, 28, 29, 30, 31, 34, 35, 37, 38, 40, 41, 42, 45, 47, 49, 54, 54, 55, 58, 58, 63, 65, 66, 66, 67, 67, 72, 74, 75, 75, 80, 82, 86, 92, 95, 96, 99],40,), ([45, 42, -91, 90, -6, 49, 65, 39, -80, -65, -47, 75, 10, 80, 36, -96, 55, 72, 68, 2, -53, -6, 72, -52, -9, 80, -16, -32, 39, 25, -27, -96, -24, -27, -23, -52],23,), ([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],28,), ([12, 84, 16],2,), ([-85, -77, -70, -67, -55, -51, -49, -41, -37, -24, -18, -8, -6, 77, 87, 90],13,), ([0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0],12,), ([5, 8, 15, 16, 20, 22, 25, 33, 46, 48, 52, 54, 55, 57, 57, 61, 61, 66, 72, 73, 83, 87, 88, 89, 98],12,), ([31, 2, -46, -86, -64, 5, -18, -33, -90, -51, 11, -35, -43, -73, 13, 33, -29, -17, -43, 20, -7, -85],13,), ([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],31,), ([20, 75, 12, 62, 18, 94, 63, 84, 25, 12],9,) ] filled_function_param = [ ([3, 4, 8, 10, 12, 14, 14, 17, 18, 19, 20, 25, 28, 29, 30, 31, 34, 35, 37, 38, 40, 41, 42, 45, 47, 49, 54, 54, 55, 58, 58, 63, 65, 66, 66, 67, 67, 72, 74, 75, 75, 80, 82, 86, 92, 95, 96, 99],40,), ([45, 42, -91, 90, -6, 49, 65, 39, -80, -65, -47, 75, 10, 80, 36, -96, 55, 72, 68, 2, -53, -6, 72, -52, -9, 80, -16, -32, 39, 25, -27, -96, -24, -27, -23, -52],23,), ([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],28,), ([12, 84, 16],2,), ([-85, -77, -70, -67, -55, -51, -49, -41, -37, -24, -18, -8, -6, 77, 87, 90],13,), ([0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0],12,), ([5, 8, 15, 16, 20, 22, 25, 33, 46, 48, 52, 54, 55, 57, 57, 61, 61, 66, 72, 73, 83, 87, 88, 89, 98],12,), ([31, 2, -46, -86, -64, 5, -18, -33, -90, -51, 11, -35, -43, -73, 13, 33, -29, -17, -43, 20, -7, -85],13,), ([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],31,), ([20, 75, 12, 62, 18, 94, 63, 84, 25, 12],9,) ] n_success = 0 for i, parameters_set in enumerate(param): f_filled(*(filled_function_param[i])) f_gold(*parameters_set) if parameters_set == filled_function_param[i]: n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{3,4,8,10,12,14,14,17,18,19,20,25,28,29,30,31,34,35,37,38,40,41,42,45,47,49,54,54,55,58,58,63,65,66,66,67,67,72,74,75,75,80,82,86,92,95,96,99},{45,42,-91,90,-6,49,65,39,-80,-65,-47,75,10,80,36,-96,55,72,68,2,-53,-6,72,-52,-9,80,-16,-32,39,25,-27,-96,-24,-27,-23,-52},{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},{12,84,16},{-85,-77,-70,-67,-55,-51,-49,-41,-37,-24,-18,-8,-6,77,87,90},{0,0,1,1,1,1,1,1,1,0,1,1,0,0,0},{5,8,15,16,20,22,25,33,46,48,52,54,55,57,57,61,61,66,72,73,83,87,88,89,98},{31,2,-46,-86,-64,5,-18,-33,-90,-51,11,-35,-43,-73,13,33,-29,-17,-43,20,-7,-85},{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},{20,75,12,62,18,94,63,84,25,12}}; vector<int> param1 {40,23,28,2,13,12,12,13,31,9}; vector<vector<int>> filled_function_param0 {{3,4,8,10,12,14,14,17,18,19,20,25,28,29,30,31,34,35,37,38,40,41,42,45,47,49,54,54,55,58,58,63,65,66,66,67,67,72,74,75,75,80,82,86,92,95,96,99},{45,42,-91,90,-6,49,65,39,-80,-65,-47,75,10,80,36,-96,55,72,68,2,-53,-6,72,-52,-9,80,-16,-32,39,25,-27,-96,-24,-27,-23,-52},{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},{12,84,16},{-85,-77,-70,-67,-55,-51,-49,-41,-37,-24,-18,-8,-6,77,87,90},{0,0,1,1,1,1,1,1,1,0,1,1,0,0,0},{5,8,15,16,20,22,25,33,46,48,52,54,55,57,57,61,61,66,72,73,83,87,88,89,98},{31,2,-46,-86,-64,5,-18,-33,-90,-51,11,-35,-43,-73,13,33,-29,-17,-43,20,-7,-85},{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},{20,75,12,62,18,94,63,84,25,12}}; vector<int> filled_function_param1 {40,23,28,2,13,12,12,13,31,9}; for(int i = 0; i < param0.size(); ++i) { f_filled(&filled_function_param0[i].front(),filled_function_param1[i]); f_gold(&param0[i].front(),param1[i]); if(equal(begin(param0[i]), end(param0[i]), begin(filled_function_param0[i])) && param1[i] == filled_function_param1[i]) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CHECK_IF_STRING_REMAINS_PALINDROME_AFTER_REMOVING_GIVEN_NUMBER_OF_CHARACTERS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_IF_STRING_REMAINS_PALINDROME_AFTER_REMOVING_GIVEN_NUMBER_OF_CHARACTERS{ static boolean f_gold ( String str , int n ) { int len = str . length ( ) ; if ( len >= n ) return true ; return false ; }
def f_gold ( str , n ) : l = len ( str ) if ( l >= n ) : return True return False
using namespace std; bool f_gold ( string str, int n ) { int len = str . length ( ); if ( len >= n ) return true; return false; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("ZCoQhuM"); param0.add("7437725"); param0.add("11"); param0.add("buGlvR"); param0.add("9"); param0.add("101101010110"); param0.add("YguiM"); param0.add("8198"); param0.add("11101"); param0.add("hUInqJXNdbfP"); List<Integer> param1 = new ArrayList<>(); param1.add(2); param1.add(53); param1.add(30); param1.add(1); param1.add(92); param1.add(3); param1.add(18); param1.add(90); param1.add(71); param1.add(4); 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()); } }
if __name__ == '__main__': param = [ ('ZCoQhuM',2,), ('7437725',53,), ('11',30,), ('buGlvR',1,), ('9',92,), ('101101010110',3,), ('YguiM',18,), ('8198',90,), ('11101',71,), ('hUInqJXNdbfP',4,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 {"ZCoQhuM","7437725","11","buGlvR","9","101101010110","YguiM","8198","11101","hUInqJXNdbfP"}; vector<int> param1 {2,53,30,1,92,3,18,90,71,4}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
COUNT_POSSIBLE_PATHS_TOP_LEFT_BOTTOM_RIGHT_NXM_MATRIX_3
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_POSSIBLE_PATHS_TOP_LEFT_BOTTOM_RIGHT_NXM_MATRIX_3{ static int f_gold ( int m , int n ) { int path = 1 ; for ( int i = n ; i < ( m + n - 1 ) ; i ++ ) { path *= i ; path /= ( i - n + 1 ) ; } return path ; }
null
using namespace std; int f_gold ( int m, int n ) { int path = 1; for ( int i = n; i < ( m + n - 1 ); i ++ ) { path *= i; path /= ( i - n + 1 ); } return path; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(10); param0.add(52); param0.add(5); param0.add(84); param0.add(27); param0.add(77); param0.add(52); param0.add(3); param0.add(5); param0.add(14); List<Integer> param1 = new ArrayList<>(); param1.add(3); param1.add(8); param1.add(23); param1.add(56); param1.add(30); param1.add(90); param1.add(50); param1.add(25); param1.add(75); param1.add(18); 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()); } }
null
int main() { int n_success = 0; vector<int> param0 {10,52,5,84,27,77,52,3,5,14}; vector<int> param1 {3,8,23,56,30,90,50,25,75,18}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
NUMBER_INDEXES_EQUAL_ELEMENTS_GIVEN_RANGE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_INDEXES_EQUAL_ELEMENTS_GIVEN_RANGE{ static int f_gold ( int a [ ] , int n , int l , int r ) { int count = 0 ; for ( int i = l ; i < r ; i ++ ) if ( a [ i ] == a [ i + 1 ] ) count += 1 ; return count ; }
def f_gold ( a , n , l , r ) : count = 0 for i in range ( l , r ) : if ( a [ i ] == a [ i + 1 ] ) : count += 1 return count
using namespace std; int f_gold ( int a [ ], int n, int l, int r ) { int count = 0; for ( int i = l; i < r; i ++ ) if ( a [ i ] == a [ i + 1 ] ) count += 1; return count; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,13,13,16,16,19,39,41,48,52,57,62,65,67,76,84,88,91,95,96,97,98}); param0.add(new int[]{62,76,86,-8,84,-6,72,84,6,-50,-18,-94,54,90,-74,-64,-26,-14,-32,62,10,4,70,-28,8,18,4,-62,-76,84,-78,-4,84,98,58,-68,42,-6,34,-38,52,-84,78}); param0.add(new int[]{0,0,0,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{11,75,98,29,62,53,48,91,86,66,48,94}); param0.add(new int[]{-94,-84,-70,-70,-40,-40,-36,-24,10,48,62,74}); param0.add(new int[]{1,0,1,1,0,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,1,0,1,0,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,0,1,1,0,0}); param0.add(new int[]{1,2,6,7,10,11,13,19,19,25,29,30,32,34,35,45,45,46,47,48,48,53,58,61,64,65,67,75,76,81,81,84,84,85,86,94,94,96,99}); param0.add(new int[]{-56,42,-34,-12,-86,82,-96,-66,30,16,-40,72,84,94,-48,-30,26,50,42,-44,-50,22,-38,8,34,94,2,16,-32,18,-58,12,-26,28,-62}); param0.add(new int[]{0,0,0,0,1,1,1}); param0.add(new int[]{6,29}); List<Integer> param1 = new ArrayList<>(); param1.add(18); param1.add(32); param1.add(10); param1.add(8); param1.add(11); param1.add(36); param1.add(25); param1.add(21); param1.add(4); param1.add(1); List<Integer> param2 = new ArrayList<>(); param2.add(12); param2.add(38); param2.add(6); param2.add(6); param2.add(7); param2.add(40); param2.add(19); param2.add(30); param2.add(5); param2.add(1); List<Integer> param3 = new ArrayList<>(); param3.add(17); param3.add(23); param3.add(6); param3.add(6); param3.add(8); param3.add(37); param3.add(37); param3.add(26); param3.add(5); param3.add(1); 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()); } }
if __name__ == '__main__': param = [ ([4, 13, 13, 16, 16, 19, 39, 41, 48, 52, 57, 62, 65, 67, 76, 84, 88, 91, 95, 96, 97, 98],18,12,17,), ([62, 76, 86, -8, 84, -6, 72, 84, 6, -50, -18, -94, 54, 90, -74, -64, -26, -14, -32, 62, 10, 4, 70, -28, 8, 18, 4, -62, -76, 84, -78, -4, 84, 98, 58, -68, 42, -6, 34, -38, 52, -84, 78],32,38,23,), ([0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],10,6,6,), ([11, 75, 98, 29, 62, 53, 48, 91, 86, 66, 48, 94],8,6,6,), ([-94, -84, -70, -70, -40, -40, -36, -24, 10, 48, 62, 74],11,7,8,), ([1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0],36,40,37,), ([1, 2, 6, 7, 10, 11, 13, 19, 19, 25, 29, 30, 32, 34, 35, 45, 45, 46, 47, 48, 48, 53, 58, 61, 64, 65, 67, 75, 76, 81, 81, 84, 84, 85, 86, 94, 94, 96, 99],25,19,37,), ([-56, 42, -34, -12, -86, 82, -96, -66, 30, 16, -40, 72, 84, 94, -48, -30, 26, 50, 42, -44, -50, 22, -38, 8, 34, 94, 2, 16, -32, 18, -58, 12, -26, 28, -62],21,30,26,), ([0, 0, 0, 0, 1, 1, 1],4,5,5,), ([6, 29],1,1,1,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{4,13,13,16,16,19,39,41,48,52,57,62,65,67,76,84,88,91,95,96,97,98},{62,76,86,-8,84,-6,72,84,6,-50,-18,-94,54,90,-74,-64,-26,-14,-32,62,10,4,70,-28,8,18,4,-62,-76,84,-78,-4,84,98,58,-68,42,-6,34,-38,52,-84,78},{0,0,0,0,0,0,1,1,1,1,1,1},{11,75,98,29,62,53,48,91,86,66,48,94},{-94,-84,-70,-70,-40,-40,-36,-24,10,48,62,74},{1,0,1,1,0,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,1,0,1,0,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,0,1,1,0,0},{1,2,6,7,10,11,13,19,19,25,29,30,32,34,35,45,45,46,47,48,48,53,58,61,64,65,67,75,76,81,81,84,84,85,86,94,94,96,99},{-56,42,-34,-12,-86,82,-96,-66,30,16,-40,72,84,94,-48,-30,26,50,42,-44,-50,22,-38,8,34,94,2,16,-32,18,-58,12,-26,28,-62},{0,0,0,0,1,1,1},{6,29}}; vector<int> param1 {18,32,10,8,11,36,25,21,4,1}; vector<int> param2 {12,38,6,6,7,40,19,30,5,1}; vector<int> param3 {17,23,6,6,8,37,37,26,5,1}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i],param2[i],param3[i]) == f_gold(&param0[i].front(),param1[i],param2[i],param3[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
PROGRAM_FIND_REMAINDER_LARGE_NUMBER_DIVIDED_11
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_FIND_REMAINDER_LARGE_NUMBER_DIVIDED_11{ static int f_gold ( String str ) { int len = str . length ( ) ; int num , rem = 0 ; for ( int i = 0 ; i < len ; i ++ ) { num = rem * 10 + ( str . charAt ( i ) - '0' ) ; rem = num % 11 ; } return rem ; }
null
using namespace std; int f_gold ( string str ) { int len = str . length ( ); int num, rem = 0; for ( int i = 0; i < len; i ++ ) { num = rem * 10 + ( str [ i ] - '0' ); rem = num % 11; } return rem; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("DvsNZVNZ"); param0.add("1170"); param0.add("10"); param0.add("evsPwREbSY"); param0.add("09219178704"); param0.add("1001010"); param0.add("SkZbWSajDKmiG"); param0.add("0287976763"); param0.add("011011000111"); param0.add("lUn"); 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()); } }
null
int main() { int n_success = 0; vector<string> param0 {"DvsNZVNZ","1170","10","evsPwREbSY","09219178704","1001010","SkZbWSajDKmiG","0287976763","011011000111","lUn"}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
COUNT_SET_BITS_IN_AN_INTEGER_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_SET_BITS_IN_AN_INTEGER_2{ static int f_gold ( int n ) { int count = 0 ; while ( n > 0 ) { n &= ( n - 1 ) ; count ++ ; } return count ; }
def f_gold ( n ) : count = 0 while ( n ) : n &= ( n - 1 ) count += 1 return count
null
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(32); param0.add(94); param0.add(33); param0.add(99); param0.add(17); param0.add(64); param0.add(80); param0.add(42); param0.add(12); param0.add(86); 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()); } }
if __name__ == '__main__': param = [ (32,), (94,), (33,), (99,), (17,), (64,), (80,), (42,), (12,), (86,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
null
TRIANGULAR_NUMBERS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class TRIANGULAR_NUMBERS{ static boolean f_gold ( int num ) { if ( num < 0 ) return false ; int sum = 0 ; for ( int n = 1 ; sum <= num ; n ++ ) { sum = sum + n ; if ( sum == num ) return true ; } return false ; }
def f_gold ( num ) : if ( num < 0 ) : return False sum , n = 0 , 1 while ( sum <= num ) : sum = sum + n if ( sum == num ) : return True n += 1 return False
using namespace std; bool f_gold ( int num ) { if ( num < 0 ) return false; int sum = 0; for ( int n = 1; sum <= num; n ++ ) { sum = sum + n; if ( sum == num ) return true; } return false; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(97); param0.add(97); param0.add(32); param0.add(40); param0.add(18); param0.add(14); param0.add(90); param0.add(39); param0.add(1); param0.add(57); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (97,), (97,), (32,), (40,), (18,), (14,), (90,), (39,), (1,), (57,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {97,97,32,40,18,14,90,39,1,57}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
ROUND_THE_GIVEN_NUMBER_TO_NEAREST_MULTIPLE_OF_10
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class ROUND_THE_GIVEN_NUMBER_TO_NEAREST_MULTIPLE_OF_10{ static int f_gold ( int n ) { int a = ( n / 10 ) * 10 ; int b = a + 10 ; return ( n - a > b - n ) ? b : a ; }
def f_gold ( n ) : a = ( n // 10 ) * 10 b = a + 10 return ( b if n - a > b - n else a )
using namespace std; int f_gold ( int n ) { int a = ( n / 10 ) * 10; int b = a + 10; return ( n - a > b - n ) ? b : a; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(31); param0.add(78); param0.add(19); param0.add(36); param0.add(77); param0.add(94); param0.add(86); param0.add(16); param0.add(95); param0.add(2); 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()); } }
if __name__ == '__main__': param = [ (31,), (78,), (19,), (36,), (77,), (94,), (86,), (16,), (95,), (2,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {31,78,19,36,77,94,86,16,95,2}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SUM_FACTORS_NUMBER_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_FACTORS_NUMBER_1{ static int f_gold ( int n ) { int res = 1 ; for ( int i = 2 ; i <= Math . sqrt ( n ) ; i ++ ) { int curr_sum = 1 ; int curr_term = 1 ; while ( n % i == 0 ) { n = n / i ; curr_term *= i ; curr_sum += curr_term ; } res *= curr_sum ; } if ( n > 2 ) res *= ( 1 + n ) ; return res ; }
null
using namespace std; int f_gold ( int n ) { int res = 1; for ( int i = 2; i <= sqrt ( n ); i ++ ) { int curr_sum = 1; int curr_term = 1; while ( n % i == 0 ) { n = n / i; curr_term *= i; curr_sum += curr_term; } res *= curr_sum; } if ( n >= 2 ) res *= ( 1 + n ); return res; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(96); param0.add(32); param0.add(93); param0.add(78); param0.add(30); param0.add(5); param0.add(62); param0.add(27); param0.add(95); param0.add(45); 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()); } }
null
int main() { int n_success = 0; vector<int> param0 {96,32,93,78,30,5,62,27,95,45}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
COUNT_ROTATIONS_DIVISIBLE_8
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_ROTATIONS_DIVISIBLE_8{ static int f_gold ( String n ) { int len = n . length ( ) ; int count = 0 ; if ( len == 1 ) { int oneDigit = n . charAt ( 0 ) - '0' ; if ( oneDigit % 8 == 0 ) return 1 ; return 0 ; } if ( len == 2 ) { int first = ( n . charAt ( 0 ) - '0' ) * 10 + ( n . charAt ( 1 ) - '0' ) ; int second = ( n . charAt ( 1 ) - '0' ) * 10 + ( n . charAt ( 0 ) - '0' ) ; if ( first % 8 == 0 ) count ++ ; if ( second % 8 == 0 ) count ++ ; return count ; } int threeDigit ; for ( int i = 0 ; i < ( len - 2 ) ; i ++ ) { threeDigit = ( n . charAt ( i ) - '0' ) * 100 + ( n . charAt ( i + 1 ) - '0' ) * 10 + ( n . charAt ( i + 2 ) - '0' ) ; if ( threeDigit % 8 == 0 ) count ++ ; } threeDigit = ( n . charAt ( len - 1 ) - '0' ) * 100 + ( n . charAt ( 0 ) - '0' ) * 10 + ( n . charAt ( 1 ) - '0' ) ; if ( threeDigit % 8 == 0 ) count ++ ; threeDigit = ( n . charAt ( len - 2 ) - '0' ) * 100 + ( n . charAt ( len - 1 ) - '0' ) * 10 + ( n . charAt ( 0 ) - '0' ) ; if ( threeDigit % 8 == 0 ) count ++ ; return count ; }
null
using namespace std; int f_gold ( string n ) { int len = n . length ( ); int count = 0; if ( len == 1 ) { int oneDigit = n [ 0 ] - '0'; if ( oneDigit % 8 == 0 ) return 1; return 0; } if ( len == 2 ) { int first = ( n [ 0 ] - '0' ) * 10 + ( n [ 1 ] - '0' ); int second = ( n [ 1 ] - '0' ) * 10 + ( n [ 0 ] - '0' ); if ( first % 8 == 0 ) count ++; if ( second % 8 == 0 ) count ++; return count; } int threeDigit; for ( int i = 0; i < ( len - 2 ); i ++ ) { threeDigit = ( n [ i ] - '0' ) * 100 + ( n [ i + 1 ] - '0' ) * 10 + ( n [ i + 2 ] - '0' ); if ( threeDigit % 8 == 0 ) count ++; } threeDigit = ( n [ len - 1 ] - '0' ) * 100 + ( n [ 0 ] - '0' ) * 10 + ( n [ 1 ] - '0' ); if ( threeDigit % 8 == 0 ) count ++; threeDigit = ( n [ len - 2 ] - '0' ) * 100 + ( n [ len - 1 ] - '0' ) * 10 + ( n [ 0 ] - '0' ); if ( threeDigit % 8 == 0 ) count ++; return count; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add(" MwBVIb"); param0.add("37291205493"); param0.add("0111111"); param0.add("BrrQon"); param0.add("226051"); param0.add("1001101"); param0.add("eREctoEen"); param0.add("299967"); param0.add("000111"); param0.add("GJUYuqbampKo"); 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()); } }
null
int main() { int n_success = 0; vector<string> param0 {" MwBVIb","37291205493","0111111","BrrQon","226051","1001101","eREctoEen","299967","000111","GJUYuqbampKo"}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS_1{ static int f_gold ( int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += i * ( n - i ) ; return 2 * sum ; }
def f_gold ( n ) : sum = 0 for i in range ( n ) : sum += i * ( n - i ) return 2 * sum
using namespace std; int f_gold ( int n ) { int sum = 0; for ( int i = 0; i < n; i ++ ) sum += i * ( n - i ); return 2 * sum; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(63); param0.add(72); param0.add(28); param0.add(35); param0.add(6); param0.add(70); param0.add(20); param0.add(8); param0.add(8); param0.add(35); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (63,), (72,), (28,), (35,), (6,), (70,), (20,), (8,), (8,), (35,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {63,72,28,35,6,70,20,8,8,35}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
NUMBER_JUMP_REQUIRED_GIVEN_LENGTH_REACH_POINT_FORM_D_0_ORIGIN_2D_PLANE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_JUMP_REQUIRED_GIVEN_LENGTH_REACH_POINT_FORM_D_0_ORIGIN_2D_PLANE{ static int f_gold ( int a , int b , int d ) { int temp = a ; a = Math . min ( a , b ) ; b = Math . max ( temp , b ) ; if ( d >= b ) return ( d + b - 1 ) / b ; if ( d == 0 ) return 0 ; if ( d == a ) return 1 ; return 2 ; }
def f_gold ( a , b , d ) : temp = a a = min ( a , b ) b = max ( temp , b ) if ( d >= b ) : return ( d + b - 1 ) / b if ( d == 0 ) : return 0 if ( d == a ) : return 1 return 2
using namespace std; int f_gold ( int a, int b, int d ) { int temp = a; a = min ( a, b ); b = max ( temp, b ); if ( d >= b ) return ( d + b - 1 ) / b; if ( d == 0 ) return 0; if ( d == a ) return 1; return 2; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(35); param0.add(85); param0.add(22); param0.add(8); param0.add(12); param0.add(58); param0.add(65); param0.add(10); param0.add(23); param0.add(5); List<Integer> param1 = new ArrayList<>(); param1.add(8); param1.add(55); param1.add(23); param1.add(43); param1.add(64); param1.add(25); param1.add(4); param1.add(95); param1.add(13); param1.add(50); List<Integer> param2 = new ArrayList<>(); param2.add(77); param2.add(33); param2.add(64); param2.add(29); param2.add(11); param2.add(26); param2.add(28); param2.add(55); param2.add(54); param2.add(71); 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()); } }
if __name__ == '__main__': param = [ (35,8,77,), (85,55,33,), (22,23,64,), (8,43,29,), (12,64,11,), (58,25,26,), (65,4,28,), (10,95,55,), (23,13,54,), (5,50,71,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {35,85,22,8,12,58,65,10,23,5}; vector<int> param1 {8,55,23,43,64,25,4,95,13,50}; vector<int> param2 {77,33,64,29,11,26,28,55,54,71}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i],param2[i]) == f_gold(param0[i],param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CHECK_IF_A_NUMBER_IS_POWER_OF_ANOTHER_NUMBER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_IF_A_NUMBER_IS_POWER_OF_ANOTHER_NUMBER{ public static boolean f_gold ( int x , int y ) { if ( x == 1 ) return ( y == 1 ) ; int pow = 1 ; while ( pow < y ) pow = pow * x ; return ( pow == y ) ; }
def f_gold ( x , y ) : if ( x == 1 ) : return ( y == 1 ) pow = 1 while ( pow < y ) : pow = pow * x return ( pow == y )
using namespace std; bool f_gold ( int x, long int y ) { if ( x == 1 ) return ( y == 1 ); long int pow = 1; while ( pow < y ) pow *= x; return ( pow == y ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(57); param0.add(3); param0.add(10); param0.add(10); param0.add(6); param0.add(2); param0.add(1); param0.add(20); param0.add(96); param0.add(25); List<Integer> param1 = new ArrayList<>(); param1.add(1); param1.add(9); param1.add(101); param1.add(10000); param1.add(46656); param1.add(2048); param1.add(40); param1.add(79); param1.add(98); param1.add(5); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (57,1,), (3,9,), (10,101,), (10,10000,), (6,46656,), (2,2048,), (1,40,), (20,79,), (96,98,), (25,5,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {57,3,10,10,6,2,1,20,96,25}; vector<int> param1 {1,9,101,10000,46656,2048,40,79,98,5}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MINIMUM_FLIP_REQUIRED_MAKE_BINARY_MATRIX_SYMMETRIC_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_FLIP_REQUIRED_MAKE_BINARY_MATRIX_SYMMETRIC_1{ static int f_gold ( int mat [ ] [ ] , int n ) { int flip = 0 ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < i ; j ++ ) if ( mat [ i ] [ j ] != mat [ j ] [ i ] ) flip ++ ; return flip ; }
def f_gold ( mat , n ) : flip = 0 for i in range ( n ) : for j in range ( i ) : if mat [ i ] [ j ] != mat [ j ] [ i ] : flip += 1 return flip
null
public static void main(String args[]) { int n_success = 0; List<int [ ] [ ]> param0 = new ArrayList<>(); param0.add(new int[][]{new int[]{16,16,47,49,50,64,70,83,88},new int[]{11,12,24,32,36,39,48,58,62},new int[]{29,31,35,49,71,78,82,92,96},new int[]{6,21,46,53,83,88,94,94,97},new int[]{29,36,41,52,83,89,89,90,90},new int[]{3,11,35,45,47,79,81,85,96},new int[]{31,43,62,62,62,65,66,68,81},new int[]{8,9,10,26,36,43,58,70,95},new int[]{2,8,24,31,42,43,58,90,94}}); param0.add(new int[][]{new int[]{20,8,-42,-16,58,58,80},new int[]{-28,-20,54,94,62,22,-86},new int[]{-26,86,48,-28,10,90,-40},new int[]{68,76,16,-50,-58,18,-86},new int[]{40,-52,8,-14,-8,54,78},new int[]{82,92,2,54,62,80,14},new int[]{-56,-90,74,-16,-92,76,32}}); param0.add(new int[][]{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,1,1,1},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},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,1,1},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,1,1},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,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,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},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,1,1},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,1,1,1,1},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,1,1,1,1},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,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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,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,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},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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,1,1,1,1},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,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,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},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,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,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},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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,1,1,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,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},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,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,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},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},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,1,1,1,1},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,1,1},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,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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,1,1},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,1,1,1,1},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,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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},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},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,1,1},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,1,1},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,1,1},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,1,1,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,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},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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},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},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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}}); param0.add(new int[][]{new int[]{66,95,76,26,11,80,1,59,16},new int[]{79,5,47,12,55,11,49,12,84},new int[]{77,16,8,92,95,71,16,71,44},new int[]{14,17,30,80,42,42,35,62,87},new int[]{47,75,69,34,25,54,87,49,62},new int[]{9,20,35,98,95,57,51,64,72},new int[]{66,38,22,59,82,49,40,46,64},new int[]{31,15,63,84,6,18,93,36,62},new int[]{96,13,34,87,16,6,91,65,13}}); param0.add(new int[][]{new int[]{-94,-68,-54,-36,-32,-28,-10,10,30,38,58,66,78,90},new int[]{-98,-62,-44,-38,-36,-34,-34,-26,28,30,34,64,90,98},new int[]{-90,-88,-84,-62,-54,-24,4,6,30,32,40,50,56,68},new int[]{-98,-80,-74,-48,-18,-14,-10,10,24,42,54,54,74,96},new int[]{-84,-68,-52,-32,-16,-8,-4,6,44,48,50,78,80,84},new int[]{-96,-84,-78,-42,-38,-36,-16,-14,2,14,16,24,28,40},new int[]{-94,-92,-86,-84,-62,-58,-52,-46,-22,-12,16,32,62,68},new int[]{-92,-72,-68,-62,-50,-50,-38,-12,22,40,40,42,48,70},new int[]{-90,-72,-42,-28,16,22,26,36,42,50,68,82,90,94},new int[]{-86,-78,-66,-60,-46,-30,-26,-20,-14,54,60,66,76,84},new int[]{-98,-96,-76,-64,-30,-16,-4,14,22,28,48,64,74,96},new int[]{-88,-68,-58,-50,-28,-16,-8,2,18,20,28,58,60,82},new int[]{-94,-82,-70,14,14,24,30,36,48,50,50,76,78,96},new int[]{-88,-74,-12,6,10,18,28,46,56,58,84,90,90,96}}); param0.add(new int[][]{new int[]{1,0,1,1,1,0,0,1,1,1,0,0,0,0,0,1,1,0,0,0,1,1,1,0,0,1,1,1,1},new int[]{0,0,0,0,0,1,0,1,0,0,0,0,1,1,0,0,1,0,1,0,0,1,1,0,1,0,1,1,0},new int[]{0,1,0,0,0,1,1,1,1,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,1,1,1},new int[]{0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,1,0,1,0,1},new int[]{1,0,0,0,1,0,1,0,0,0,0,0,1,1,0,1,1,0,1,0,1,0,0,1,1,1,1,1,1},new int[]{0,0,1,1,1,1,0,1,1,0,1,0,1,0,1,1,0,0,0,0,1,0,0,0,1,1,1,0,0},new int[]{1,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,0,1,1,1,1,0},new int[]{0,1,1,1,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,1,0},new int[]{0,0,1,1,1,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,1,1,1},new int[]{1,1,1,0,0,0,1,0,0,0,1,0,0,1,0,1,0,0,1,1,1,0,1,1,1,1,1,1,0},new int[]{0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1,1,1,1,0,1,0,1},new int[]{1,0,1,0,1,1,0,1,1,0,1,1,1,1,1,1,0,0,1,0,1,0,0,1,0,1,0,0,0},new int[]{0,1,1,1,1,1,0,1,0,1,1,0,1,0,1,0,0,1,1,1,0,0,0,0,1,0,0,0,1},new int[]{1,1,0,0,0,1,0,0,1,0,1,0,0,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,0},new int[]{1,1,1,1,1,0,0,1,0,1,1,1,0,1,0,1,1,0,0,0,0,1,1,0,0,1,0,0,1},new int[]{1,0,0,1,0,1,1,0,1,0,1,1,1,1,1,1,1,0,0,1,1,0,0,0,1,0,0,1,1},new int[]{1,0,0,1,0,1,1,1,0,1,1,0,1,0,0,1,1,0,1,0,0,0,1,1,0,1,1,1,1},new int[]{1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,0,1,0,0,1},new int[]{0,1,1,0,0,0,0,1,1,0,0,0,1,0,0,1,0,1,0,0,0,1,1,1,1,0,0,1,0},new int[]{1,0,1,1,1,0,1,1,1,0,0,1,1,0,1,0,1,1,0,0,0,0,1,1,1,1,0,1,0},new int[]{1,1,1,0,0,0,1,0,1,0,1,1,1,0,1,0,1,0,0,1,1,1,0,1,1,1,1,1,1},new int[]{0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,1,0,1,1,0,1,0,0,1,0,1,1,0,1},new int[]{0,1,1,1,1,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,1,1,0,1,1,0,1,0,1},new int[]{0,1,0,0,0,1,1,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,1,0,0,0,1},new int[]{0,1,0,1,0,1,1,1,1,1,0,1,0,1,0,0,1,0,1,1,1,1,0,0,1,0,1,0,0},new int[]{1,1,1,0,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,1,1,1,0,1,0,1,0,1},new int[]{0,1,1,1,1,0,1,0,1,0,0,1,0,0,1,0,0,1,1,0,1,0,0,0,0,1,0,1,0},new int[]{1,1,1,0,0,1,1,1,0,0,1,1,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0},new int[]{0,0,1,1,0,1,1,0,1,0,0,0,1,1,1,1,0,0,1,1,0,0,0,1,0,1,0,1,1}}); param0.add(new int[][]{new int[]{1,4,11,16,18,19,20,25,27,29,30,30,33,34,35,36,37,38,40,40,49,49,51,51,53,56,57,59,60,61,61,62,63,69,72,77,79,82,85,86,89,94,97,98},new int[]{2,6,8,10,11,11,11,14,15,19,20,21,21,23,26,31,31,34,37,37,40,40,41,47,47,48,52,53,55,59,67,77,81,82,82,83,88,92,92,93,94,96,97,98},new int[]{3,4,4,6,10,13,13,13,16,18,24,25,26,27,28,31,32,34,35,38,45,50,52,53,55,57,57,58,62,64,65,70,71,72,75,77,82,86,86,92,93,94,98,99},new int[]{2,4,5,8,10,10,13,14,15,18,19,21,21,21,24,24,28,30,30,31,36,37,38,48,48,52,53,58,59,60,61,67,75,77,77,78,80,81,86,87,89,89,96,96},new int[]{2,4,8,16,20,20,24,26,27,28,29,36,37,43,43,43,44,45,46,46,47,48,49,50,51,52,56,59,59,62,70,71,71,72,73,79,79,86,86,89,91,91,91,97},new int[]{1,1,2,5,6,10,17,21,22,23,23,28,31,34,36,38,41,42,43,44,52,53,54,56,56,58,59,62,64,67,67,68,70,71,77,81,82,83,83,85,88,89,90,98},new int[]{1,1,2,3,3,4,6,6,7,10,11,12,13,14,15,15,19,21,25,27,42,45,46,50,51,51,52,55,60,60,67,70,71,71,77,78,81,85,86,86,87,90,95,99},new int[]{2,4,7,9,9,11,15,17,19,22,27,27,30,32,34,35,35,36,41,42,46,46,48,54,55,56,59,61,61,65,66,67,70,73,80,81,85,89,90,91,92,96,96,97},new int[]{7,8,12,14,17,19,21,24,27,28,34,36,38,48,54,57,59,59,62,66,66,67,70,71,71,71,72,73,74,74,76,76,78,79,80,80,83,88,88,90,92,95,96,98},new int[]{3,3,8,10,10,15,16,20,25,25,25,29,34,36,42,50,52,54,56,58,59,63,64,65,71,73,73,74,75,75,76,76,78,80,82,86,86,87,87,92,94,94,96,99},new int[]{7,9,12,15,24,24,25,26,27,28,32,37,38,43,44,46,50,50,52,52,55,56,56,56,58,58,59,62,64,65,68,72,72,80,85,85,86,90,91,92,98,98,98,99},new int[]{2,7,9,18,28,29,31,32,32,38,39,39,41,41,45,48,49,49,49,50,50,58,58,62,62,63,68,69,69,71,72,74,74,75,77,78,79,81,82,82,83,83,95,98},new int[]{3,5,6,6,7,10,10,13,15,17,22,23,25,25,25,25,27,29,35,37,38,46,47,50,50,51,53,56,56,59,71,71,72,74,77,79,80,83,84,90,90,92,95,98},new int[]{1,9,19,20,22,22,22,23,24,28,32,32,32,36,36,37,37,39,45,50,53,56,58,58,60,64,66,68,68,69,72,73,73,73,75,75,79,80,80,82,86,87,91,99},new int[]{5,9,12,13,14,18,23,25,25,28,29,32,33,34,39,41,46,49,50,52,55,55,56,59,61,63,65,65,67,69,69,74,75,78,80,81,85,85,86,88,88,92,96,98},new int[]{4,4,9,11,12,20,23,23,24,27,33,35,37,40,41,43,44,45,45,49,50,51,54,54,56,58,63,65,71,71,72,73,75,76,76,78,81,84,86,88,90,90,96,99},new int[]{1,2,8,9,10,15,17,18,18,19,20,21,21,21,26,27,29,32,33,34,34,39,44,47,55,56,58,60,62,64,65,70,70,72,74,74,75,76,79,81,84,86,90,93},new int[]{2,2,6,8,9,13,15,16,16,17,18,20,24,28,33,34,36,39,40,44,46,48,50,53,53,54,61,67,69,71,72,75,76,78,83,87,88,91,93,94,94,96,97,98},new int[]{2,6,9,10,12,13,14,15,16,17,21,22,29,29,31,31,34,38,38,39,40,43,44,46,48,50,52,52,57,62,65,66,68,69,69,73,74,77,79,80,83,84,87,95},new int[]{7,7,13,14,19,22,24,24,25,30,30,32,39,41,43,48,49,50,50,52,53,54,58,61,62,65,65,66,66,67,69,70,73,73,75,77,88,89,92,92,96,96,97,98},new int[]{1,3,3,4,12,14,27,32,32,33,33,37,42,42,42,43,47,49,53,55,56,57,59,60,61,61,61,65,66,66,67,71,72,73,78,79,80,82,87,89,92,94,95,96},new int[]{5,6,6,11,11,13,18,18,19,21,25,28,31,37,40,40,43,45,51,53,53,58,63,64,67,68,73,75,75,77,82,84,84,86,88,91,92,94,94,96,97,97,98,99},new int[]{1,2,3,7,8,8,8,17,23,23,24,31,33,33,36,37,38,38,43,44,47,47,47,49,52,55,56,56,59,68,71,72,72,75,79,79,80,82,83,92,93,97,97,98},new int[]{1,2,6,6,11,13,15,15,17,20,20,24,27,27,28,30,30,33,36,37,38,40,40,40,40,42,46,51,58,60,64,65,67,71,72,75,78,82,85,87,89,97,98,98},new int[]{1,2,3,5,7,7,7,16,16,18,20,20,23,23,32,32,33,33,34,38,39,41,42,43,45,47,47,50,50,53,53,56,59,60,61,64,72,79,79,84,85,89,94,98},new int[]{2,9,11,11,14,25,26,27,29,31,32,34,35,38,38,38,40,46,47,47,48,49,51,55,58,63,63,66,67,67,68,69,70,77,80,81,83,85,89,90,92,95,97,98},new int[]{1,2,5,8,8,9,12,12,17,19,20,28,29,35,38,38,38,41,43,45,48,51,56,62,68,69,70,73,74,74,77,79,81,83,84,87,88,89,92,93,93,97,98,99},new int[]{2,3,4,5,6,6,10,11,11,13,14,14,18,18,19,20,26,30,31,32,32,34,34,35,38,42,43,44,48,53,55,56,59,59,65,72,78,84,85,88,90,97,97,98},new int[]{1,9,10,15,17,17,18,18,20,24,25,26,30,31,33,35,36,42,43,43,44,46,46,48,49,49,49,49,51,51,52,59,62,64,65,71,72,74,79,79,89,90,94,97},new int[]{1,2,10,11,15,18,18,19,21,22,25,28,28,30,37,38,40,41,46,46,49,51,52,53,53,56,64,69,69,72,72,74,77,77,77,78,78,84,85,96,97,98,98,99},new int[]{1,6,6,6,7,7,10,11,16,17,18,18,27,27,33,33,35,38,41,46,47,53,54,54,56,62,63,63,66,67,67,77,77,78,79,83,88,88,89,92,95,95,96,99},new int[]{3,4,6,8,8,8,10,12,15,17,19,19,22,22,25,28,28,29,34,34,39,41,42,43,46,46,46,53,53,54,56,56,56,63,64,68,70,75,82,84,85,94,95,96},new int[]{3,4,4,5,8,9,17,21,23,25,31,32,35,38,38,39,39,43,49,54,56,61,61,64,64,65,65,65,69,70,70,70,71,72,74,74,77,78,78,80,84,90,96,99},new int[]{1,3,6,12,13,13,13,20,21,21,24,29,33,33,38,40,42,42,45,46,47,49,55,57,58,60,60,62,63,63,67,68,69,70,72,72,74,75,75,77,77,88,95,99},new int[]{3,4,4,8,9,9,9,11,12,12,15,16,17,18,20,21,22,22,25,28,29,33,34,35,36,43,46,57,58,59,63,68,69,72,76,78,83,89,90,91,93,96,97,99},new int[]{1,9,11,12,13,15,19,26,27,32,34,42,42,44,48,54,54,56,57,58,60,64,76,80,81,82,82,82,83,84,85,85,85,86,87,92,94,95,96,97,97,97,98,98},new int[]{5,7,16,20,21,22,27,29,30,31,32,33,36,37,38,44,47,47,50,53,54,56,58,60,60,61,62,63,63,64,64,68,69,77,81,81,82,82,84,86,87,90,92,96},new int[]{3,3,6,6,8,8,9,13,20,21,27,27,29,32,34,40,43,47,49,49,50,53,54,54,57,61,63,65,66,71,72,72,73,73,74,75,75,75,79,82,85,90,92,94},new int[]{2,3,5,5,9,9,14,17,20,21,23,27,29,31,33,36,38,42,43,45,45,46,47,47,48,53,54,55,56,58,60,64,67,67,69,77,77,84,87,92,92,93,94,98},new int[]{4,9,10,12,13,15,16,20,24,25,26,27,31,34,38,38,40,41,43,44,46,46,47,47,48,57,64,74,77,78,79,82,82,85,87,87,88,89,91,92,94,96,97,99},new int[]{2,2,4,8,10,12,13,20,21,21,29,32,34,40,40,40,43,45,46,47,47,48,49,51,57,67,68,68,70,72,76,76,77,78,79,81,84,88,89,91,94,95,97,98},new int[]{3,4,4,6,8,8,9,11,14,14,15,16,16,22,22,23,25,30,30,33,33,35,36,37,40,40,42,42,44,52,55,56,56,58,60,64,64,66,67,69,80,81,81,91},new int[]{7,10,10,11,13,13,13,15,23,25,27,28,28,30,34,35,37,38,39,44,45,46,49,50,53,53,56,60,60,64,64,65,66,68,68,70,77,78,79,80,81,85,92,95},new int[]{1,3,7,7,9,11,12,19,19,20,22,22,25,26,34,38,43,45,47,49,50,54,55,55,57,60,62,62,64,69,70,72,72,76,77,79,83,89,93,94,95,98,99,99}}); param0.add(new int[][]{new int[]{-6}}); param0.add(new int[][]{new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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},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},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},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},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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,1,1,1,1},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},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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},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},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},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},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},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},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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,1,1,1,1},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},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},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},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},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},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},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},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},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},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,1,1},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},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},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},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},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},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},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},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},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},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},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},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}}); param0.add(new int[][]{new int[]{57,35,39,48,79,25,49,44,40,59,90,18,4,14,32,39,2,15,34,91,11,16,23,1,7,3,40,93,14,33,51,35,78,35,67,3,38,71},new int[]{57,4,10,9,40,48,47,9,33,91,47,12,66,45,90,89,94,69,71,43,83,23,30,15,52,78,42,34,65,45,35,9,48,4,6,1,40,13},new int[]{58,15,43,30,58,15,58,90,96,92,80,66,14,16,79,49,91,19,1,64,21,27,41,48,21,21,21,26,70,97,63,35,92,96,61,3,86,47},new int[]{92,91,51,18,77,83,67,81,77,78,53,40,53,35,43,16,39,69,10,38,19,3,33,94,60,84,95,76,23,52,72,67,14,61,26,52,81,62},new int[]{27,60,67,50,57,97,65,22,57,91,71,61,5,56,59,55,67,23,89,88,61,21,70,69,63,59,36,29,63,60,82,33,60,83,24,22,69,96},new int[]{89,59,51,55,68,44,41,11,19,44,14,47,14,3,23,84,76,95,19,69,67,62,42,69,43,18,93,93,6,18,16,37,28,46,53,82,5,64},new int[]{73,22,7,71,4,28,4,43,3,28,82,66,45,52,59,66,80,50,84,82,22,52,98,13,48,33,58,15,44,79,91,80,30,67,72,23,14,1},new int[]{70,78,31,58,42,81,50,88,23,99,7,59,1,63,60,8,69,81,19,96,61,16,37,47,69,83,70,77,72,45,41,34,78,71,71,6,94,53},new int[]{38,46,91,77,24,94,98,68,4,23,30,65,12,71,20,21,84,39,83,98,79,72,76,71,99,73,27,47,55,43,4,10,38,93,14,65,18,98},new int[]{66,76,94,19,66,43,17,53,69,25,48,29,70,65,90,93,6,85,21,33,12,90,66,32,14,88,13,6,12,5,57,75,87,44,72,45,66,48},new int[]{66,44,52,38,99,65,41,88,18,93,96,39,45,19,35,53,68,76,14,6,74,30,18,28,39,67,20,48,9,77,25,45,72,48,36,24,36,16},new int[]{14,90,11,65,5,97,61,91,5,47,11,85,83,39,69,12,76,44,52,24,35,99,23,94,56,55,71,19,3,86,7,1,44,20,95,81,77,43},new int[]{10,93,48,53,66,88,68,58,67,17,7,54,16,33,46,15,34,56,84,18,46,93,54,99,63,47,28,48,35,94,77,34,56,36,43,12,73,90},new int[]{8,56,60,26,78,18,28,30,65,81,84,40,74,17,52,46,28,4,14,41,2,91,9,16,85,82,59,58,63,35,1,13,48,39,1,12,31,34},new int[]{48,3,7,11,44,41,4,35,30,23,86,98,35,82,72,49,58,32,71,58,92,49,88,84,80,3,86,37,65,91,12,7,44,74,50,65,52,16},new int[]{27,21,48,22,70,83,45,34,84,45,39,9,33,76,51,19,82,27,30,83,93,62,21,84,13,24,22,95,86,33,18,74,88,95,41,91,51,7},new int[]{62,22,26,38,15,3,28,93,54,23,46,10,36,83,66,14,32,80,73,58,79,51,34,94,70,24,7,64,76,96,3,85,93,79,12,37,94,93},new int[]{33,20,76,50,37,56,92,79,66,76,28,69,38,6,90,30,51,95,34,15,40,24,47,99,50,3,5,8,50,35,27,30,44,31,64,79,13,73},new int[]{69,56,99,12,4,16,97,89,62,15,41,67,82,6,20,80,98,42,78,86,77,59,21,11,96,96,34,69,84,67,91,64,67,75,50,47,59,79},new int[]{82,78,57,77,3,60,27,93,26,98,24,38,49,31,57,44,23,33,68,66,26,17,4,76,11,10,7,98,73,57,55,37,41,57,82,29,80,86},new int[]{78,61,89,44,96,59,79,39,55,23,94,23,59,4,37,19,10,94,72,90,25,86,50,68,71,34,56,72,46,45,28,85,91,50,34,71,49,68},new int[]{46,60,27,21,44,61,86,9,64,78,53,97,30,57,24,67,38,30,61,87,79,40,20,59,31,20,2,22,96,63,9,8,81,96,19,60,97,40},new int[]{61,59,30,75,21,33,92,89,85,72,98,3,23,61,87,93,92,83,9,82,44,89,68,54,14,76,49,29,44,33,94,23,17,46,45,50,1,88},new int[]{53,90,59,33,63,59,94,93,7,61,96,16,51,52,3,42,9,10,94,66,14,89,72,94,99,14,74,45,78,99,54,53,80,19,87,48,12,38},new int[]{9,17,96,94,10,97,46,40,35,37,16,11,88,65,94,87,75,42,16,32,95,4,54,42,62,10,90,31,79,45,42,88,96,47,88,4,10,76},new int[]{1,14,14,41,6,62,47,66,23,51,65,6,16,47,32,22,93,54,72,82,40,24,94,62,25,61,41,14,95,50,98,30,65,22,85,79,3,10},new int[]{64,40,52,51,32,35,71,5,89,12,91,33,78,88,39,68,44,30,5,57,18,30,58,57,22,44,12,16,50,42,80,85,53,29,5,56,14,92},new int[]{35,81,5,71,97,39,34,19,78,75,51,49,39,12,80,2,90,35,25,48,87,75,23,92,33,78,39,37,70,74,62,92,12,99,18,33,89,28},new int[]{79,82,20,51,35,70,24,9,34,25,27,53,84,45,31,20,58,55,12,51,78,45,48,66,92,7,93,72,93,59,70,66,67,11,10,95,57,65},new int[]{56,23,53,92,41,98,86,27,56,38,95,34,5,83,80,49,10,71,54,40,81,44,91,61,96,22,53,7,60,35,65,93,2,59,92,60,80,70},new int[]{58,75,10,84,37,32,71,91,66,98,51,28,17,91,45,22,13,19,93,85,19,11,66,2,87,58,24,42,15,21,95,59,67,27,39,48,94,53},new int[]{48,39,19,44,34,20,42,38,95,24,69,5,12,75,17,5,72,70,91,24,20,45,14,29,43,10,27,98,93,21,89,23,40,38,36,99,90,82},new int[]{38,1,96,18,20,6,20,88,73,92,41,90,2,18,78,89,7,81,34,8,36,88,60,64,56,70,53,27,41,54,35,94,30,20,90,47,18,75},new int[]{49,44,96,84,67,89,40,83,21,42,41,3,19,59,94,65,56,16,79,61,59,63,35,32,2,8,73,65,87,56,83,16,85,83,80,11,92,74},new int[]{59,63,9,66,85,47,15,81,41,75,3,5,73,2,99,89,87,67,10,2,97,20,57,75,18,77,66,36,78,43,5,76,31,3,87,62,13,38},new int[]{68,88,92,3,70,43,61,91,7,17,56,91,74,15,31,8,17,25,75,5,55,46,73,48,21,53,9,23,45,30,63,67,29,53,30,68,58,41},new int[]{14,51,22,93,95,99,28,63,48,48,31,5,8,96,86,98,21,34,16,31,2,27,25,34,30,68,27,86,30,24,25,14,72,6,28,5,30,97},new int[]{93,73,8,62,72,47,31,64,16,42,84,12,40,49,52,62,96,3,95,10,35,62,69,77,31,90,51,13,91,58,6,77,5,86,81,19,76,12}}); List<Integer> param1 = new ArrayList<>(); param1.add(8); param1.add(6); param1.add(38); param1.add(7); param1.add(11); param1.add(14); param1.add(22); param1.add(0); param1.add(37); 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()); } }
if __name__ == '__main__': param = [ ([[16, 16, 47, 49, 50, 64, 70, 83, 88], [11, 12, 24, 32, 36, 39, 48, 58, 62], [29, 31, 35, 49, 71, 78, 82, 92, 96], [6, 21, 46, 53, 83, 88, 94, 94, 97], [29, 36, 41, 52, 83, 89, 89, 90, 90], [3, 11, 35, 45, 47, 79, 81, 85, 96], [31, 43, 62, 62, 62, 65, 66, 68, 81], [8, 9, 10, 26, 36, 43, 58, 70, 95], [2, 8, 24, 31, 42, 43, 58, 90, 94]],8,), ([[20, 8, -42, -16, 58, 58, 80], [-28, -20, 54, 94, 62, 22, -86], [-26, 86, 48, -28, 10, 90, -40], [68, 76, 16, -50, -58, 18, -86], [40, -52, 8, -14, -8, 54, 78], [82, 92, 2, 54, 62, 80, 14], [-56, -90, 74, -16, -92, 76, 32]],6,), ([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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], [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, 1, 1], [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, 1, 1], [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, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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, 1, 1], [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, 1], [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, 1], [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, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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, 1], [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, 1, 1, 1], [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, 1, 1, 1], [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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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, 1, 1, 1], [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, 1], [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, 1, 1], [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, 1, 1, 1], [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], [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, 1], [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, 1, 1], [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, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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, 1, 1], [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, 1], [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, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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], [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], [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, 1, 1], [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, 1, 1], [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, 1, 1], [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, 1, 1, 1], [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, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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], [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], [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, 1, 1, 1]],38,), ([[66, 95, 76, 26, 11, 80, 1, 59, 16], [79, 5, 47, 12, 55, 11, 49, 12, 84], [77, 16, 8, 92, 95, 71, 16, 71, 44], [14, 17, 30, 80, 42, 42, 35, 62, 87], [47, 75, 69, 34, 25, 54, 87, 49, 62], [9, 20, 35, 98, 95, 57, 51, 64, 72], [66, 38, 22, 59, 82, 49, 40, 46, 64], [31, 15, 63, 84, 6, 18, 93, 36, 62], [96, 13, 34, 87, 16, 6, 91, 65, 13]],7,), ([[-94, -68, -54, -36, -32, -28, -10, 10, 30, 38, 58, 66, 78, 90], [-98, -62, -44, -38, -36, -34, -34, -26, 28, 30, 34, 64, 90, 98], [-90, -88, -84, -62, -54, -24, 4, 6, 30, 32, 40, 50, 56, 68], [-98, -80, -74, -48, -18, -14, -10, 10, 24, 42, 54, 54, 74, 96], [-84, -68, -52, -32, -16, -8, -4, 6, 44, 48, 50, 78, 80, 84], [-96, -84, -78, -42, -38, -36, -16, -14, 2, 14, 16, 24, 28, 40], [-94, -92, -86, -84, -62, -58, -52, -46, -22, -12, 16, 32, 62, 68], [-92, -72, -68, -62, -50, -50, -38, -12, 22, 40, 40, 42, 48, 70], [-90, -72, -42, -28, 16, 22, 26, 36, 42, 50, 68, 82, 90, 94], [-86, -78, -66, -60, -46, -30, -26, -20, -14, 54, 60, 66, 76, 84], [-98, -96, -76, -64, -30, -16, -4, 14, 22, 28, 48, 64, 74, 96], [-88, -68, -58, -50, -28, -16, -8, 2, 18, 20, 28, 58, 60, 82], [-94, -82, -70, 14, 14, 24, 30, 36, 48, 50, 50, 76, 78, 96], [-88, -74, -12, 6, 10, 18, 28, 46, 56, 58, 84, 90, 90, 96]],11,), ([[1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0], [0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1], [0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1], [1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0], [0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0], [0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0], [1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1], [1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1], [1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1], [1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1], [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0], [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0], [1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1], [0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1], [0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0], [1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1], [0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0], [1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1]],14,), ([[1, 4, 11, 16, 18, 19, 20, 25, 27, 29, 30, 30, 33, 34, 35, 36, 37, 38, 40, 40, 49, 49, 51, 51, 53, 56, 57, 59, 60, 61, 61, 62, 63, 69, 72, 77, 79, 82, 85, 86, 89, 94, 97, 98], [2, 6, 8, 10, 11, 11, 11, 14, 15, 19, 20, 21, 21, 23, 26, 31, 31, 34, 37, 37, 40, 40, 41, 47, 47, 48, 52, 53, 55, 59, 67, 77, 81, 82, 82, 83, 88, 92, 92, 93, 94, 96, 97, 98], [3, 4, 4, 6, 10, 13, 13, 13, 16, 18, 24, 25, 26, 27, 28, 31, 32, 34, 35, 38, 45, 50, 52, 53, 55, 57, 57, 58, 62, 64, 65, 70, 71, 72, 75, 77, 82, 86, 86, 92, 93, 94, 98, 99], [2, 4, 5, 8, 10, 10, 13, 14, 15, 18, 19, 21, 21, 21, 24, 24, 28, 30, 30, 31, 36, 37, 38, 48, 48, 52, 53, 58, 59, 60, 61, 67, 75, 77, 77, 78, 80, 81, 86, 87, 89, 89, 96, 96], [2, 4, 8, 16, 20, 20, 24, 26, 27, 28, 29, 36, 37, 43, 43, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 56, 59, 59, 62, 70, 71, 71, 72, 73, 79, 79, 86, 86, 89, 91, 91, 91, 97], [1, 1, 2, 5, 6, 10, 17, 21, 22, 23, 23, 28, 31, 34, 36, 38, 41, 42, 43, 44, 52, 53, 54, 56, 56, 58, 59, 62, 64, 67, 67, 68, 70, 71, 77, 81, 82, 83, 83, 85, 88, 89, 90, 98], [1, 1, 2, 3, 3, 4, 6, 6, 7, 10, 11, 12, 13, 14, 15, 15, 19, 21, 25, 27, 42, 45, 46, 50, 51, 51, 52, 55, 60, 60, 67, 70, 71, 71, 77, 78, 81, 85, 86, 86, 87, 90, 95, 99], [2, 4, 7, 9, 9, 11, 15, 17, 19, 22, 27, 27, 30, 32, 34, 35, 35, 36, 41, 42, 46, 46, 48, 54, 55, 56, 59, 61, 61, 65, 66, 67, 70, 73, 80, 81, 85, 89, 90, 91, 92, 96, 96, 97], [7, 8, 12, 14, 17, 19, 21, 24, 27, 28, 34, 36, 38, 48, 54, 57, 59, 59, 62, 66, 66, 67, 70, 71, 71, 71, 72, 73, 74, 74, 76, 76, 78, 79, 80, 80, 83, 88, 88, 90, 92, 95, 96, 98], [3, 3, 8, 10, 10, 15, 16, 20, 25, 25, 25, 29, 34, 36, 42, 50, 52, 54, 56, 58, 59, 63, 64, 65, 71, 73, 73, 74, 75, 75, 76, 76, 78, 80, 82, 86, 86, 87, 87, 92, 94, 94, 96, 99], [7, 9, 12, 15, 24, 24, 25, 26, 27, 28, 32, 37, 38, 43, 44, 46, 50, 50, 52, 52, 55, 56, 56, 56, 58, 58, 59, 62, 64, 65, 68, 72, 72, 80, 85, 85, 86, 90, 91, 92, 98, 98, 98, 99], [2, 7, 9, 18, 28, 29, 31, 32, 32, 38, 39, 39, 41, 41, 45, 48, 49, 49, 49, 50, 50, 58, 58, 62, 62, 63, 68, 69, 69, 71, 72, 74, 74, 75, 77, 78, 79, 81, 82, 82, 83, 83, 95, 98], [3, 5, 6, 6, 7, 10, 10, 13, 15, 17, 22, 23, 25, 25, 25, 25, 27, 29, 35, 37, 38, 46, 47, 50, 50, 51, 53, 56, 56, 59, 71, 71, 72, 74, 77, 79, 80, 83, 84, 90, 90, 92, 95, 98], [1, 9, 19, 20, 22, 22, 22, 23, 24, 28, 32, 32, 32, 36, 36, 37, 37, 39, 45, 50, 53, 56, 58, 58, 60, 64, 66, 68, 68, 69, 72, 73, 73, 73, 75, 75, 79, 80, 80, 82, 86, 87, 91, 99], [5, 9, 12, 13, 14, 18, 23, 25, 25, 28, 29, 32, 33, 34, 39, 41, 46, 49, 50, 52, 55, 55, 56, 59, 61, 63, 65, 65, 67, 69, 69, 74, 75, 78, 80, 81, 85, 85, 86, 88, 88, 92, 96, 98], [4, 4, 9, 11, 12, 20, 23, 23, 24, 27, 33, 35, 37, 40, 41, 43, 44, 45, 45, 49, 50, 51, 54, 54, 56, 58, 63, 65, 71, 71, 72, 73, 75, 76, 76, 78, 81, 84, 86, 88, 90, 90, 96, 99], [1, 2, 8, 9, 10, 15, 17, 18, 18, 19, 20, 21, 21, 21, 26, 27, 29, 32, 33, 34, 34, 39, 44, 47, 55, 56, 58, 60, 62, 64, 65, 70, 70, 72, 74, 74, 75, 76, 79, 81, 84, 86, 90, 93], [2, 2, 6, 8, 9, 13, 15, 16, 16, 17, 18, 20, 24, 28, 33, 34, 36, 39, 40, 44, 46, 48, 50, 53, 53, 54, 61, 67, 69, 71, 72, 75, 76, 78, 83, 87, 88, 91, 93, 94, 94, 96, 97, 98], [2, 6, 9, 10, 12, 13, 14, 15, 16, 17, 21, 22, 29, 29, 31, 31, 34, 38, 38, 39, 40, 43, 44, 46, 48, 50, 52, 52, 57, 62, 65, 66, 68, 69, 69, 73, 74, 77, 79, 80, 83, 84, 87, 95], [7, 7, 13, 14, 19, 22, 24, 24, 25, 30, 30, 32, 39, 41, 43, 48, 49, 50, 50, 52, 53, 54, 58, 61, 62, 65, 65, 66, 66, 67, 69, 70, 73, 73, 75, 77, 88, 89, 92, 92, 96, 96, 97, 98], [1, 3, 3, 4, 12, 14, 27, 32, 32, 33, 33, 37, 42, 42, 42, 43, 47, 49, 53, 55, 56, 57, 59, 60, 61, 61, 61, 65, 66, 66, 67, 71, 72, 73, 78, 79, 80, 82, 87, 89, 92, 94, 95, 96], [5, 6, 6, 11, 11, 13, 18, 18, 19, 21, 25, 28, 31, 37, 40, 40, 43, 45, 51, 53, 53, 58, 63, 64, 67, 68, 73, 75, 75, 77, 82, 84, 84, 86, 88, 91, 92, 94, 94, 96, 97, 97, 98, 99], [1, 2, 3, 7, 8, 8, 8, 17, 23, 23, 24, 31, 33, 33, 36, 37, 38, 38, 43, 44, 47, 47, 47, 49, 52, 55, 56, 56, 59, 68, 71, 72, 72, 75, 79, 79, 80, 82, 83, 92, 93, 97, 97, 98], [1, 2, 6, 6, 11, 13, 15, 15, 17, 20, 20, 24, 27, 27, 28, 30, 30, 33, 36, 37, 38, 40, 40, 40, 40, 42, 46, 51, 58, 60, 64, 65, 67, 71, 72, 75, 78, 82, 85, 87, 89, 97, 98, 98], [1, 2, 3, 5, 7, 7, 7, 16, 16, 18, 20, 20, 23, 23, 32, 32, 33, 33, 34, 38, 39, 41, 42, 43, 45, 47, 47, 50, 50, 53, 53, 56, 59, 60, 61, 64, 72, 79, 79, 84, 85, 89, 94, 98], [2, 9, 11, 11, 14, 25, 26, 27, 29, 31, 32, 34, 35, 38, 38, 38, 40, 46, 47, 47, 48, 49, 51, 55, 58, 63, 63, 66, 67, 67, 68, 69, 70, 77, 80, 81, 83, 85, 89, 90, 92, 95, 97, 98], [1, 2, 5, 8, 8, 9, 12, 12, 17, 19, 20, 28, 29, 35, 38, 38, 38, 41, 43, 45, 48, 51, 56, 62, 68, 69, 70, 73, 74, 74, 77, 79, 81, 83, 84, 87, 88, 89, 92, 93, 93, 97, 98, 99], [2, 3, 4, 5, 6, 6, 10, 11, 11, 13, 14, 14, 18, 18, 19, 20, 26, 30, 31, 32, 32, 34, 34, 35, 38, 42, 43, 44, 48, 53, 55, 56, 59, 59, 65, 72, 78, 84, 85, 88, 90, 97, 97, 98], [1, 9, 10, 15, 17, 17, 18, 18, 20, 24, 25, 26, 30, 31, 33, 35, 36, 42, 43, 43, 44, 46, 46, 48, 49, 49, 49, 49, 51, 51, 52, 59, 62, 64, 65, 71, 72, 74, 79, 79, 89, 90, 94, 97], [1, 2, 10, 11, 15, 18, 18, 19, 21, 22, 25, 28, 28, 30, 37, 38, 40, 41, 46, 46, 49, 51, 52, 53, 53, 56, 64, 69, 69, 72, 72, 74, 77, 77, 77, 78, 78, 84, 85, 96, 97, 98, 98, 99], [1, 6, 6, 6, 7, 7, 10, 11, 16, 17, 18, 18, 27, 27, 33, 33, 35, 38, 41, 46, 47, 53, 54, 54, 56, 62, 63, 63, 66, 67, 67, 77, 77, 78, 79, 83, 88, 88, 89, 92, 95, 95, 96, 99], [3, 4, 6, 8, 8, 8, 10, 12, 15, 17, 19, 19, 22, 22, 25, 28, 28, 29, 34, 34, 39, 41, 42, 43, 46, 46, 46, 53, 53, 54, 56, 56, 56, 63, 64, 68, 70, 75, 82, 84, 85, 94, 95, 96], [3, 4, 4, 5, 8, 9, 17, 21, 23, 25, 31, 32, 35, 38, 38, 39, 39, 43, 49, 54, 56, 61, 61, 64, 64, 65, 65, 65, 69, 70, 70, 70, 71, 72, 74, 74, 77, 78, 78, 80, 84, 90, 96, 99], [1, 3, 6, 12, 13, 13, 13, 20, 21, 21, 24, 29, 33, 33, 38, 40, 42, 42, 45, 46, 47, 49, 55, 57, 58, 60, 60, 62, 63, 63, 67, 68, 69, 70, 72, 72, 74, 75, 75, 77, 77, 88, 95, 99], [3, 4, 4, 8, 9, 9, 9, 11, 12, 12, 15, 16, 17, 18, 20, 21, 22, 22, 25, 28, 29, 33, 34, 35, 36, 43, 46, 57, 58, 59, 63, 68, 69, 72, 76, 78, 83, 89, 90, 91, 93, 96, 97, 99], [1, 9, 11, 12, 13, 15, 19, 26, 27, 32, 34, 42, 42, 44, 48, 54, 54, 56, 57, 58, 60, 64, 76, 80, 81, 82, 82, 82, 83, 84, 85, 85, 85, 86, 87, 92, 94, 95, 96, 97, 97, 97, 98, 98], [5, 7, 16, 20, 21, 22, 27, 29, 30, 31, 32, 33, 36, 37, 38, 44, 47, 47, 50, 53, 54, 56, 58, 60, 60, 61, 62, 63, 63, 64, 64, 68, 69, 77, 81, 81, 82, 82, 84, 86, 87, 90, 92, 96], [3, 3, 6, 6, 8, 8, 9, 13, 20, 21, 27, 27, 29, 32, 34, 40, 43, 47, 49, 49, 50, 53, 54, 54, 57, 61, 63, 65, 66, 71, 72, 72, 73, 73, 74, 75, 75, 75, 79, 82, 85, 90, 92, 94], [2, 3, 5, 5, 9, 9, 14, 17, 20, 21, 23, 27, 29, 31, 33, 36, 38, 42, 43, 45, 45, 46, 47, 47, 48, 53, 54, 55, 56, 58, 60, 64, 67, 67, 69, 77, 77, 84, 87, 92, 92, 93, 94, 98], [4, 9, 10, 12, 13, 15, 16, 20, 24, 25, 26, 27, 31, 34, 38, 38, 40, 41, 43, 44, 46, 46, 47, 47, 48, 57, 64, 74, 77, 78, 79, 82, 82, 85, 87, 87, 88, 89, 91, 92, 94, 96, 97, 99], [2, 2, 4, 8, 10, 12, 13, 20, 21, 21, 29, 32, 34, 40, 40, 40, 43, 45, 46, 47, 47, 48, 49, 51, 57, 67, 68, 68, 70, 72, 76, 76, 77, 78, 79, 81, 84, 88, 89, 91, 94, 95, 97, 98], [3, 4, 4, 6, 8, 8, 9, 11, 14, 14, 15, 16, 16, 22, 22, 23, 25, 30, 30, 33, 33, 35, 36, 37, 40, 40, 42, 42, 44, 52, 55, 56, 56, 58, 60, 64, 64, 66, 67, 69, 80, 81, 81, 91], [7, 10, 10, 11, 13, 13, 13, 15, 23, 25, 27, 28, 28, 30, 34, 35, 37, 38, 39, 44, 45, 46, 49, 50, 53, 53, 56, 60, 60, 64, 64, 65, 66, 68, 68, 70, 77, 78, 79, 80, 81, 85, 92, 95], [1, 3, 7, 7, 9, 11, 12, 19, 19, 20, 22, 22, 25, 26, 34, 38, 43, 45, 47, 49, 50, 54, 55, 55, 57, 60, 62, 62, 64, 69, 70, 72, 72, 76, 77, 79, 83, 89, 93, 94, 95, 98, 99, 99]],22,), ([[-6]],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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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], [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]],37,), ([[57, 35, 39, 48, 79, 25, 49, 44, 40, 59, 90, 18, 4, 14, 32, 39, 2, 15, 34, 91, 11, 16, 23, 1, 7, 3, 40, 93, 14, 33, 51, 35, 78, 35, 67, 3, 38, 71], [57, 4, 10, 9, 40, 48, 47, 9, 33, 91, 47, 12, 66, 45, 90, 89, 94, 69, 71, 43, 83, 23, 30, 15, 52, 78, 42, 34, 65, 45, 35, 9, 48, 4, 6, 1, 40, 13], [58, 15, 43, 30, 58, 15, 58, 90, 96, 92, 80, 66, 14, 16, 79, 49, 91, 19, 1, 64, 21, 27, 41, 48, 21, 21, 21, 26, 70, 97, 63, 35, 92, 96, 61, 3, 86, 47], [92, 91, 51, 18, 77, 83, 67, 81, 77, 78, 53, 40, 53, 35, 43, 16, 39, 69, 10, 38, 19, 3, 33, 94, 60, 84, 95, 76, 23, 52, 72, 67, 14, 61, 26, 52, 81, 62], [27, 60, 67, 50, 57, 97, 65, 22, 57, 91, 71, 61, 5, 56, 59, 55, 67, 23, 89, 88, 61, 21, 70, 69, 63, 59, 36, 29, 63, 60, 82, 33, 60, 83, 24, 22, 69, 96], [89, 59, 51, 55, 68, 44, 41, 11, 19, 44, 14, 47, 14, 3, 23, 84, 76, 95, 19, 69, 67, 62, 42, 69, 43, 18, 93, 93, 6, 18, 16, 37, 28, 46, 53, 82, 5, 64], [73, 22, 7, 71, 4, 28, 4, 43, 3, 28, 82, 66, 45, 52, 59, 66, 80, 50, 84, 82, 22, 52, 98, 13, 48, 33, 58, 15, 44, 79, 91, 80, 30, 67, 72, 23, 14, 1], [70, 78, 31, 58, 42, 81, 50, 88, 23, 99, 7, 59, 1, 63, 60, 8, 69, 81, 19, 96, 61, 16, 37, 47, 69, 83, 70, 77, 72, 45, 41, 34, 78, 71, 71, 6, 94, 53], [38, 46, 91, 77, 24, 94, 98, 68, 4, 23, 30, 65, 12, 71, 20, 21, 84, 39, 83, 98, 79, 72, 76, 71, 99, 73, 27, 47, 55, 43, 4, 10, 38, 93, 14, 65, 18, 98], [66, 76, 94, 19, 66, 43, 17, 53, 69, 25, 48, 29, 70, 65, 90, 93, 6, 85, 21, 33, 12, 90, 66, 32, 14, 88, 13, 6, 12, 5, 57, 75, 87, 44, 72, 45, 66, 48], [66, 44, 52, 38, 99, 65, 41, 88, 18, 93, 96, 39, 45, 19, 35, 53, 68, 76, 14, 6, 74, 30, 18, 28, 39, 67, 20, 48, 9, 77, 25, 45, 72, 48, 36, 24, 36, 16], [14, 90, 11, 65, 5, 97, 61, 91, 5, 47, 11, 85, 83, 39, 69, 12, 76, 44, 52, 24, 35, 99, 23, 94, 56, 55, 71, 19, 3, 86, 7, 1, 44, 20, 95, 81, 77, 43], [10, 93, 48, 53, 66, 88, 68, 58, 67, 17, 7, 54, 16, 33, 46, 15, 34, 56, 84, 18, 46, 93, 54, 99, 63, 47, 28, 48, 35, 94, 77, 34, 56, 36, 43, 12, 73, 90], [8, 56, 60, 26, 78, 18, 28, 30, 65, 81, 84, 40, 74, 17, 52, 46, 28, 4, 14, 41, 2, 91, 9, 16, 85, 82, 59, 58, 63, 35, 1, 13, 48, 39, 1, 12, 31, 34], [48, 3, 7, 11, 44, 41, 4, 35, 30, 23, 86, 98, 35, 82, 72, 49, 58, 32, 71, 58, 92, 49, 88, 84, 80, 3, 86, 37, 65, 91, 12, 7, 44, 74, 50, 65, 52, 16], [27, 21, 48, 22, 70, 83, 45, 34, 84, 45, 39, 9, 33, 76, 51, 19, 82, 27, 30, 83, 93, 62, 21, 84, 13, 24, 22, 95, 86, 33, 18, 74, 88, 95, 41, 91, 51, 7], [62, 22, 26, 38, 15, 3, 28, 93, 54, 23, 46, 10, 36, 83, 66, 14, 32, 80, 73, 58, 79, 51, 34, 94, 70, 24, 7, 64, 76, 96, 3, 85, 93, 79, 12, 37, 94, 93], [33, 20, 76, 50, 37, 56, 92, 79, 66, 76, 28, 69, 38, 6, 90, 30, 51, 95, 34, 15, 40, 24, 47, 99, 50, 3, 5, 8, 50, 35, 27, 30, 44, 31, 64, 79, 13, 73], [69, 56, 99, 12, 4, 16, 97, 89, 62, 15, 41, 67, 82, 6, 20, 80, 98, 42, 78, 86, 77, 59, 21, 11, 96, 96, 34, 69, 84, 67, 91, 64, 67, 75, 50, 47, 59, 79], [82, 78, 57, 77, 3, 60, 27, 93, 26, 98, 24, 38, 49, 31, 57, 44, 23, 33, 68, 66, 26, 17, 4, 76, 11, 10, 7, 98, 73, 57, 55, 37, 41, 57, 82, 29, 80, 86], [78, 61, 89, 44, 96, 59, 79, 39, 55, 23, 94, 23, 59, 4, 37, 19, 10, 94, 72, 90, 25, 86, 50, 68, 71, 34, 56, 72, 46, 45, 28, 85, 91, 50, 34, 71, 49, 68], [46, 60, 27, 21, 44, 61, 86, 9, 64, 78, 53, 97, 30, 57, 24, 67, 38, 30, 61, 87, 79, 40, 20, 59, 31, 20, 2, 22, 96, 63, 9, 8, 81, 96, 19, 60, 97, 40], [61, 59, 30, 75, 21, 33, 92, 89, 85, 72, 98, 3, 23, 61, 87, 93, 92, 83, 9, 82, 44, 89, 68, 54, 14, 76, 49, 29, 44, 33, 94, 23, 17, 46, 45, 50, 1, 88], [53, 90, 59, 33, 63, 59, 94, 93, 7, 61, 96, 16, 51, 52, 3, 42, 9, 10, 94, 66, 14, 89, 72, 94, 99, 14, 74, 45, 78, 99, 54, 53, 80, 19, 87, 48, 12, 38], [9, 17, 96, 94, 10, 97, 46, 40, 35, 37, 16, 11, 88, 65, 94, 87, 75, 42, 16, 32, 95, 4, 54, 42, 62, 10, 90, 31, 79, 45, 42, 88, 96, 47, 88, 4, 10, 76], [1, 14, 14, 41, 6, 62, 47, 66, 23, 51, 65, 6, 16, 47, 32, 22, 93, 54, 72, 82, 40, 24, 94, 62, 25, 61, 41, 14, 95, 50, 98, 30, 65, 22, 85, 79, 3, 10], [64, 40, 52, 51, 32, 35, 71, 5, 89, 12, 91, 33, 78, 88, 39, 68, 44, 30, 5, 57, 18, 30, 58, 57, 22, 44, 12, 16, 50, 42, 80, 85, 53, 29, 5, 56, 14, 92], [35, 81, 5, 71, 97, 39, 34, 19, 78, 75, 51, 49, 39, 12, 80, 2, 90, 35, 25, 48, 87, 75, 23, 92, 33, 78, 39, 37, 70, 74, 62, 92, 12, 99, 18, 33, 89, 28], [79, 82, 20, 51, 35, 70, 24, 9, 34, 25, 27, 53, 84, 45, 31, 20, 58, 55, 12, 51, 78, 45, 48, 66, 92, 7, 93, 72, 93, 59, 70, 66, 67, 11, 10, 95, 57, 65], [56, 23, 53, 92, 41, 98, 86, 27, 56, 38, 95, 34, 5, 83, 80, 49, 10, 71, 54, 40, 81, 44, 91, 61, 96, 22, 53, 7, 60, 35, 65, 93, 2, 59, 92, 60, 80, 70], [58, 75, 10, 84, 37, 32, 71, 91, 66, 98, 51, 28, 17, 91, 45, 22, 13, 19, 93, 85, 19, 11, 66, 2, 87, 58, 24, 42, 15, 21, 95, 59, 67, 27, 39, 48, 94, 53], [48, 39, 19, 44, 34, 20, 42, 38, 95, 24, 69, 5, 12, 75, 17, 5, 72, 70, 91, 24, 20, 45, 14, 29, 43, 10, 27, 98, 93, 21, 89, 23, 40, 38, 36, 99, 90, 82], [38, 1, 96, 18, 20, 6, 20, 88, 73, 92, 41, 90, 2, 18, 78, 89, 7, 81, 34, 8, 36, 88, 60, 64, 56, 70, 53, 27, 41, 54, 35, 94, 30, 20, 90, 47, 18, 75], [49, 44, 96, 84, 67, 89, 40, 83, 21, 42, 41, 3, 19, 59, 94, 65, 56, 16, 79, 61, 59, 63, 35, 32, 2, 8, 73, 65, 87, 56, 83, 16, 85, 83, 80, 11, 92, 74], [59, 63, 9, 66, 85, 47, 15, 81, 41, 75, 3, 5, 73, 2, 99, 89, 87, 67, 10, 2, 97, 20, 57, 75, 18, 77, 66, 36, 78, 43, 5, 76, 31, 3, 87, 62, 13, 38], [68, 88, 92, 3, 70, 43, 61, 91, 7, 17, 56, 91, 74, 15, 31, 8, 17, 25, 75, 5, 55, 46, 73, 48, 21, 53, 9, 23, 45, 30, 63, 67, 29, 53, 30, 68, 58, 41], [14, 51, 22, 93, 95, 99, 28, 63, 48, 48, 31, 5, 8, 96, 86, 98, 21, 34, 16, 31, 2, 27, 25, 34, 30, 68, 27, 86, 30, 24, 25, 14, 72, 6, 28, 5, 30, 97], [93, 73, 8, 62, 72, 47, 31, 64, 16, 42, 84, 12, 40, 49, 52, 62, 96, 3, 95, 10, 35, 62, 69, 77, 31, 90, 51, 13, 91, 58, 6, 77, 5, 86, 81, 19, 76, 12]],30,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
null
SUM_SERIES_12_32_52_2N_12
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_SERIES_12_32_52_2N_12{ static int f_gold ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) sum = sum + ( 2 * i - 1 ) * ( 2 * i - 1 ) ; return sum ; }
def f_gold ( n ) : sum = 0 for i in range ( 1 , n + 1 ) : sum = sum + ( 2 * i - 1 ) * ( 2 * i - 1 ) return sum
using namespace std; int f_gold ( int n ) { int sum = 0; for ( int i = 1; i <= n; i ++ ) sum = sum + ( 2 * i - 1 ) * ( 2 * i - 1 ); return sum; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(14); param0.add(61); param0.add(37); param0.add(86); param0.add(47); param0.add(98); param0.add(70); param0.add(24); param0.add(76); param0.add(24); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (14,), (61,), (37,), (86,), (47,), (98,), (70,), (24,), (76,), (24,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {14,61,37,86,47,98,70,24,76,24}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SWAP_TWO_NUMBERS_WITHOUT_USING_TEMPORARY_VARIABLE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; class SWAP_TWO_NUMBERS_WITHOUT_USING_TEMPORARY_VARIABLE{ static void f_gold ( int [ ] xp , int [ ] yp ) { xp [ 0 ] = xp [ 0 ] ^ yp [ 0 ] ; yp [ 0 ] = xp [ 0 ] ^ yp [ 0 ] ; xp [ 0 ] = xp [ 0 ] ^ yp [ 0 ] ; }
def f_gold ( xp , yp ) : xp [ 0 ] = xp [ 0 ] ^ yp [ 0 ] yp [ 0 ] = xp [ 0 ] ^ yp [ 0 ] xp [ 0 ] = xp [ 0 ] ^ yp [ 0 ]
null
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,7,12,13,15,17,24,27,28,31,36,44,55,55,56,58,60,62,64,73,75,77,89,90,93,93,95,97,98}); param0.add(new int[]{36,51,6,25,13,-36,23,14,-80,-84,45,-81,20,36,66,-62,81,-7,5,0,-10,59,-56,88,-24,45,-21,-27,67,70,76,40,-4,-11,3,46,-94,22,71,16,63,82,-38,97,44,36,-11,-4}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{63,87,32,10,11,70,62,47,34,17,54,76,85,40,19,67,82,53,64,83,47,6,16,72,18,52,48,43,39,49,12,10,71,55,1,49,36,21,37,24,55,25,7,81,93,94,71,97,71}); param0.add(new int[]{-85,3}); param0.add(new int[]{1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1}); param0.add(new int[]{2,3,4,5,6,8,14,16,16,17,19,21,21,25,26,26,29,33,36,39,46,53,55,56,66,77,81,84,84,86,86,88,89,89,92,97}); param0.add(new int[]{15,-37,13,-6,-52,91,-88,56,72,71,45,-60,77,-15,-43,-13,-16,92,85,21,-26,7,24,98,0,-57,19,-77,55,86,-63,34,-35,34,78,-78,5,-12,53,25,-21,-10,-49,76,2,98,6}); 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,1}); param0.add(new int[]{75,24,60,95,55}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{5,8,12,13,14,20,23,25,27,28,31,33,33,37,38,39,42,42,43,47,52,54,62,67,71,72,73,76,77,79,81,81,85,86,89,91,91,96,96,99}); param1.add(new int[]{-14,59,38,84,21,-24,-8,-30,48,33,-77,37,-42,87,82,-54,-78,92,-92,23,-80,79,-22,-61,-63,78}); param1.add(new int[]{0,0,0,0,0,1,1,1,1,1}); param1.add(new int[]{11,73,12,35,63,68,92,57,13,23,83,39,88,80,97,12,34,71,75,31,93,62,13,31}); param1.add(new int[]{-84,-71,-66,-63,-25,-23,-19,3,67,94,96}); param1.add(new int[]{0,0,0,1,0,1,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,1,0}); param1.add(new int[]{5,13,22,24,27,33,46,67,74,77,78,82,86,90,91}); param1.add(new int[]{-40}); param1.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,1,1,1,1,1,1}); param1.add(new int[]{80,24,77,24,54,26,66,80,38,65,75,51,35}); List<int [ ]> filled_function_param0 = new ArrayList<>(); filled_function_param0.add(new int[]{2,7,12,13,15,17,24,27,28,31,36,44,55,55,56,58,60,62,64,73,75,77,89,90,93,93,95,97,98}); filled_function_param0.add(new int[]{36,51,6,25,13,-36,23,14,-80,-84,45,-81,20,36,66,-62,81,-7,5,0,-10,59,-56,88,-24,45,-21,-27,67,70,76,40,-4,-11,3,46,-94,22,71,16,63,82,-38,97,44,36,-11,-4}); filled_function_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}); filled_function_param0.add(new int[]{63,87,32,10,11,70,62,47,34,17,54,76,85,40,19,67,82,53,64,83,47,6,16,72,18,52,48,43,39,49,12,10,71,55,1,49,36,21,37,24,55,25,7,81,93,94,71,97,71}); filled_function_param0.add(new int[]{-85,3}); filled_function_param0.add(new int[]{1,1,0,0,1,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1}); filled_function_param0.add(new int[]{2,3,4,5,6,8,14,16,16,17,19,21,21,25,26,26,29,33,36,39,46,53,55,56,66,77,81,84,84,86,86,88,89,89,92,97}); filled_function_param0.add(new int[]{15,-37,13,-6,-52,91,-88,56,72,71,45,-60,77,-15,-43,-13,-16,92,85,21,-26,7,24,98,0,-57,19,-77,55,86,-63,34,-35,34,78,-78,5,-12,53,25,-21,-10,-49,76,2,98,6}); filled_function_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,1}); filled_function_param0.add(new int[]{75,24,60,95,55}); List<int [ ]> filled_function_param1 = new ArrayList<>(); filled_function_param1.add(new int[]{5,8,12,13,14,20,23,25,27,28,31,33,33,37,38,39,42,42,43,47,52,54,62,67,71,72,73,76,77,79,81,81,85,86,89,91,91,96,96,99}); filled_function_param1.add(new int[]{-14,59,38,84,21,-24,-8,-30,48,33,-77,37,-42,87,82,-54,-78,92,-92,23,-80,79,-22,-61,-63,78}); filled_function_param1.add(new int[]{0,0,0,0,0,1,1,1,1,1}); filled_function_param1.add(new int[]{11,73,12,35,63,68,92,57,13,23,83,39,88,80,97,12,34,71,75,31,93,62,13,31}); filled_function_param1.add(new int[]{-84,-71,-66,-63,-25,-23,-19,3,67,94,96}); filled_function_param1.add(new int[]{0,0,0,1,0,1,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,1,0}); filled_function_param1.add(new int[]{5,13,22,24,27,33,46,67,74,77,78,82,86,90,91}); filled_function_param1.add(new int[]{-40}); filled_function_param1.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,1,1,1,1,1,1}); filled_function_param1.add(new int[]{80,24,77,24,54,26,66,80,38,65,75,51,35}); 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)) && Arrays.equals(param1.get(i), filled_function_param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([2, 7, 12, 13, 15, 17, 24, 27, 28, 31, 36, 44, 55, 55, 56, 58, 60, 62, 64, 73, 75, 77, 89, 90, 93, 93, 95, 97, 98],[5, 8, 12, 13, 14, 20, 23, 25, 27, 28, 31, 33, 33, 37, 38, 39, 42, 42, 43, 47, 52, 54, 62, 67, 71, 72, 73, 76, 77, 79, 81, 81, 85, 86, 89, 91, 91, 96, 96, 99],), ([36, 51, 6, 25, 13, -36, 23, 14, -80, -84, 45, -81, 20, 36, 66, -62, 81, -7, 5, 0, -10, 59, -56, 88, -24, 45, -21, -27, 67, 70, 76, 40, -4, -11, 3, 46, -94, 22, 71, 16, 63, 82, -38, 97, 44, 36, -11, -4],[-14, 59, 38, 84, 21, -24, -8, -30, 48, 33, -77, 37, -42, 87, 82, -54, -78, 92, -92, 23, -80, 79, -22, -61, -63, 78],), ([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],[0, 0, 0, 0, 0, 1, 1, 1, 1, 1],), ([63, 87, 32, 10, 11, 70, 62, 47, 34, 17, 54, 76, 85, 40, 19, 67, 82, 53, 64, 83, 47, 6, 16, 72, 18, 52, 48, 43, 39, 49, 12, 10, 71, 55, 1, 49, 36, 21, 37, 24, 55, 25, 7, 81, 93, 94, 71, 97, 71],[11, 73, 12, 35, 63, 68, 92, 57, 13, 23, 83, 39, 88, 80, 97, 12, 34, 71, 75, 31, 93, 62, 13, 31],), ([-85, 3],[-84, -71, -66, -63, -25, -23, -19, 3, 67, 94, 96],), ([1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1],[0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0],), ([2, 3, 4, 5, 6, 8, 14, 16, 16, 17, 19, 21, 21, 25, 26, 26, 29, 33, 36, 39, 46, 53, 55, 56, 66, 77, 81, 84, 84, 86, 86, 88, 89, 89, 92, 97],[5, 13, 22, 24, 27, 33, 46, 67, 74, 77, 78, 82, 86, 90, 91],), ([15, -37, 13, -6, -52, 91, -88, 56, 72, 71, 45, -60, 77, -15, -43, -13, -16, 92, 85, 21, -26, 7, 24, 98, 0, -57, 19, -77, 55, 86, -63, 34, -35, 34, 78, -78, 5, -12, 53, 25, -21, -10, -49, 76, 2, 98, 6],[-40],), ([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],[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, 1],), ([75, 24, 60, 95, 55],[80, 24, 77, 24, 54, 26, 66, 80, 38, 65, 75, 51, 35],) ] filled_function_param = [ ([2, 7, 12, 13, 15, 17, 24, 27, 28, 31, 36, 44, 55, 55, 56, 58, 60, 62, 64, 73, 75, 77, 89, 90, 93, 93, 95, 97, 98],[5, 8, 12, 13, 14, 20, 23, 25, 27, 28, 31, 33, 33, 37, 38, 39, 42, 42, 43, 47, 52, 54, 62, 67, 71, 72, 73, 76, 77, 79, 81, 81, 85, 86, 89, 91, 91, 96, 96, 99],), ([36, 51, 6, 25, 13, -36, 23, 14, -80, -84, 45, -81, 20, 36, 66, -62, 81, -7, 5, 0, -10, 59, -56, 88, -24, 45, -21, -27, 67, 70, 76, 40, -4, -11, 3, 46, -94, 22, 71, 16, 63, 82, -38, 97, 44, 36, -11, -4],[-14, 59, 38, 84, 21, -24, -8, -30, 48, 33, -77, 37, -42, 87, 82, -54, -78, 92, -92, 23, -80, 79, -22, -61, -63, 78],), ([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],[0, 0, 0, 0, 0, 1, 1, 1, 1, 1],), ([63, 87, 32, 10, 11, 70, 62, 47, 34, 17, 54, 76, 85, 40, 19, 67, 82, 53, 64, 83, 47, 6, 16, 72, 18, 52, 48, 43, 39, 49, 12, 10, 71, 55, 1, 49, 36, 21, 37, 24, 55, 25, 7, 81, 93, 94, 71, 97, 71],[11, 73, 12, 35, 63, 68, 92, 57, 13, 23, 83, 39, 88, 80, 97, 12, 34, 71, 75, 31, 93, 62, 13, 31],), ([-85, 3],[-84, -71, -66, -63, -25, -23, -19, 3, 67, 94, 96],), ([1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1],[0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0],), ([2, 3, 4, 5, 6, 8, 14, 16, 16, 17, 19, 21, 21, 25, 26, 26, 29, 33, 36, 39, 46, 53, 55, 56, 66, 77, 81, 84, 84, 86, 86, 88, 89, 89, 92, 97],[5, 13, 22, 24, 27, 33, 46, 67, 74, 77, 78, 82, 86, 90, 91],), ([15, -37, 13, -6, -52, 91, -88, 56, 72, 71, 45, -60, 77, -15, -43, -13, -16, 92, 85, 21, -26, 7, 24, 98, 0, -57, 19, -77, 55, 86, -63, 34, -35, 34, 78, -78, 5, -12, 53, 25, -21, -10, -49, 76, 2, 98, 6],[-40],), ([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],[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, 1],), ([75, 24, 60, 95, 55],[80, 24, 77, 24, 54, 26, 66, 80, 38, 65, 75, 51, 35],) ] n_success = 0 for i, parameters_set in enumerate(param): f_filled(*(filled_function_param[i])) f_gold(*parameters_set) if parameters_set == filled_function_param[i]: n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
null
CHECK_IF_ALL_THE_ELEMENTS_CAN_BE_MADE_OF_SAME_PARITY_BY_INVERTING_ADJACENT_ELEMENTS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_IF_ALL_THE_ELEMENTS_CAN_BE_MADE_OF_SAME_PARITY_BY_INVERTING_ADJACENT_ELEMENTS{ static boolean f_gold ( int [ ] a , int n ) { int count_odd = 0 , count_even = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( a [ i ] & 1 ) == 1 ) count_odd ++ ; else count_even ++ ; } if ( count_odd % 2 == 1 && count_even % 2 == 1 ) return false ; else return true ; }
def f_gold ( a , n ) : count_odd = 0 ; count_even = 0 ; for i in range ( n ) : if ( a [ i ] & 1 ) : count_odd += 1 ; else : count_even += 1 ; if ( count_odd % 2 and count_even % 2 ) : return False ; else : return True ;
using namespace std; bool f_gold ( int a [ ], int n ) { int count_odd = 0, count_even = 0; for ( int i = 0; i < n; i ++ ) { if ( a [ i ] & 1 ) count_odd ++; else count_even ++; } if ( count_odd % 2 && count_even % 2 ) return false; else return true; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,1,1,7,7,8,10,10,10,14,15,18,20,23,24,24,26,30,32,32,33,36,42,43,46,48,51,51,52,53,58,58,59,59,59,60,67,71,72,74,76,77,83,84,86,90,91}); param0.add(new int[]{-90,-20,-60,-64,-24,84,-2,-32,28,-54,44,-96,52,88,20,-56,-2}); 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}); param0.add(new int[]{98,70,24,18,7,4,78,19,70,56,99,54,69,15,88,20,40,13,19,56,62}); param0.add(new int[]{-72,-66,-58,-20,36,80,92}); param0.add(new int[]{0,1}); param0.add(new int[]{6,13,14,16,21,26,26,28,29,35,38,42,47,47,62,67,77,81,81,83,84,88,90,96,97,98}); param0.add(new int[]{-48,-8,20,32,-90,-42,-6,-88,-72,42,66,-62,82,-4,8,12,-22,82,56,96,-54,92,-42,30,-18,14,-6,-66,34,16,-84,-94,48,-48,52,-60,-92,-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}); param0.add(new int[]{45,86,53,80,27,45,1,85,91,93,92,43,75,86,81,48,21,34,5,10,88,42,7,15,96,85,62,86,52,37}); List<Integer> param1 = new ArrayList<>(); param1.add(30); param1.add(12); param1.add(36); param1.add(19); param1.add(6); param1.add(1); param1.add(17); param1.add(35); param1.add(14); param1.add(29); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([1, 1, 1, 7, 7, 8, 10, 10, 10, 14, 15, 18, 20, 23, 24, 24, 26, 30, 32, 32, 33, 36, 42, 43, 46, 48, 51, 51, 52, 53, 58, 58, 59, 59, 59, 60, 67, 71, 72, 74, 76, 77, 83, 84, 86, 90, 91],30,), ([-90, -20, -60, -64, -24, 84, -2, -32, 28, -54, 44, -96, 52, 88, 20, -56, -2],12,), ([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],36,), ([98, 70, 24, 18, 7, 4, 78, 19, 70, 56, 99, 54, 69, 15, 88, 20, 40, 13, 19, 56, 62],19,), ([-72, -66, -58, -20, 36, 80, 92],6,), ([0, 1],1,), ([6, 13, 14, 16, 21, 26, 26, 28, 29, 35, 38, 42, 47, 47, 62, 67, 77, 81, 81, 83, 84, 88, 90, 96, 97, 98],17,), ([-48, -8, 20, 32, -90, -42, -6, -88, -72, 42, 66, -62, 82, -4, 8, 12, -22, 82, 56, 96, -54, 92, -42, 30, -18, 14, -6, -66, 34, 16, -84, -94, 48, -48, 52, -60, -92, -16],35,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1],14,), ([45, 86, 53, 80, 27, 45, 1, 85, 91, 93, 92, 43, 75, 86, 81, 48, 21, 34, 5, 10, 88, 42, 7, 15, 96, 85, 62, 86, 52, 37],29,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{1,1,1,7,7,8,10,10,10,14,15,18,20,23,24,24,26,30,32,32,33,36,42,43,46,48,51,51,52,53,58,58,59,59,59,60,67,71,72,74,76,77,83,84,86,90,91},{-90,-20,-60,-64,-24,84,-2,-32,28,-54,44,-96,52,88,20,-56,-2},{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},{98,70,24,18,7,4,78,19,70,56,99,54,69,15,88,20,40,13,19,56,62},{-72,-66,-58,-20,36,80,92},{0,1},{6,13,14,16,21,26,26,28,29,35,38,42,47,47,62,67,77,81,81,83,84,88,90,96,97,98},{-48,-8,20,32,-90,-42,-6,-88,-72,42,66,-62,82,-4,8,12,-22,82,56,96,-54,92,-42,30,-18,14,-6,-66,34,16,-84,-94,48,-48,52,-60,-92,-16},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},{45,86,53,80,27,45,1,85,91,93,92,43,75,86,81,48,21,34,5,10,88,42,7,15,96,85,62,86,52,37}}; vector<int> param1 {30,12,36,19,6,1,17,35,14,29}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CHECK_WHETHER_TRIANGLE_VALID_NOT_SIDES_GIVEN
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_WHETHER_TRIANGLE_VALID_NOT_SIDES_GIVEN{ public static int f_gold ( int a , int b , int c ) { if ( a + b <= c || a + c <= b || b + c <= a ) return 0 ; else return 1 ; }
def f_gold ( a , b , c ) : if ( a + b <= c ) or ( a + c <= b ) or ( b + c <= a ) : return False else : return True
using namespace std; bool f_gold ( int a, int b, int c ) { if ( a + b <= c || a + c <= b || b + c <= a ) return false; else return true; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(29); param0.add(83); param0.add(48); param0.add(59); param0.add(56); param0.add(68); param0.add(63); param0.add(95); param0.add(2); param0.add(11); List<Integer> param1 = new ArrayList<>(); param1.add(19); param1.add(34); param1.add(14); param1.add(12); param1.add(39); param1.add(85); param1.add(36); param1.add(34); param1.add(90); param1.add(16); List<Integer> param2 = new ArrayList<>(); param2.add(52); param2.add(49); param2.add(65); param2.add(94); param2.add(22); param2.add(9); param2.add(41); param2.add(37); param2.add(27); 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()); } }
if __name__ == '__main__': param = [ (29,19,52,), (83,34,49,), (48,14,65,), (59,12,94,), (56,39,22,), (68,85,9,), (63,36,41,), (95,34,37,), (2,90,27,), (11,16,1,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {29,83,48,59,56,68,63,95,2,11}; vector<int> param1 {19,34,14,12,39,85,36,34,90,16}; vector<int> param2 {52,49,65,94,22,9,41,37,27,1}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i],param2[i]) == f_gold(param0[i],param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
TOTAL_NUMBER_OF_NON_DECREASING_NUMBERS_WITH_N_DIGITS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class TOTAL_NUMBER_OF_NON_DECREASING_NUMBERS_WITH_N_DIGITS{ static int f_gold ( int n ) { int dp [ ] [ ] = new int [ 10 ] [ n + 1 ] ; for ( int i = 0 ; i < 10 ; i ++ ) dp [ i ] [ 1 ] = 1 ; for ( int digit = 0 ; digit <= 9 ; digit ++ ) { for ( int len = 2 ; len <= n ; len ++ ) { for ( int x = 0 ; x <= digit ; x ++ ) dp [ digit ] [ len ] += dp [ x ] [ len - 1 ] ; } } int count = 0 ; for ( int i = 0 ; i < 10 ; i ++ ) count += dp [ i ] [ n ] ; return count ; }
def f_gold ( n ) : dp = [ [ 0 for i in range ( n + 1 ) ] for i in range ( 10 ) ] for i in range ( 10 ) : dp [ i ] [ 1 ] = 1 for digit in range ( 10 ) : for len in range ( 2 , n + 1 ) : for x in range ( digit + 1 ) : dp [ digit ] [ len ] += dp [ x ] [ len - 1 ] count = 0 for i in range ( 10 ) : count += dp [ i ] [ n ] return count
using namespace std; long long int f_gold ( int n ) { long long int dp [ 10 ] [ n + 1 ]; memset ( dp, 0, sizeof dp ); for ( int i = 0; i < 10; i ++ ) dp [ i ] [ 1 ] = 1; for ( int digit = 0; digit <= 9; digit ++ ) { for ( int len = 2; len <= n; len ++ ) { for ( int x = 0; x <= digit; x ++ ) dp [ digit ] [ len ] += dp [ x ] [ len - 1 ]; } } long long int count = 0; for ( int i = 0; i < 10; i ++ ) count += dp [ i ] [ n ]; return count; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(21); param0.add(40); param0.add(83); param0.add(93); param0.add(43); param0.add(98); param0.add(35); param0.add(86); param0.add(76); param0.add(88); 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()); } }
if __name__ == '__main__': param = [ (21,), (40,), (83,), (93,), (43,), (98,), (35,), (86,), (76,), (88,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {21,40,83,93,43,98,35,86,76,88}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MAXIMUM_PROFIT_BY_BUYING_AND_SELLING_A_SHARE_AT_MOST_TWICE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_PROFIT_BY_BUYING_AND_SELLING_A_SHARE_AT_MOST_TWICE{ static int f_gold ( int price [ ] , int n ) { int profit [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) profit [ i ] = 0 ; int max_price = price [ n - 1 ] ; for ( int i = n - 2 ; i >= 0 ; i -- ) { if ( price [ i ] > max_price ) max_price = price [ i ] ; profit [ i ] = Math . max ( profit [ i + 1 ] , max_price - price [ i ] ) ; } int min_price = price [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { if ( price [ i ] < min_price ) min_price = price [ i ] ; profit [ i ] = Math . max ( profit [ i - 1 ] , profit [ i ] + ( price [ i ] - min_price ) ) ; } int result = profit [ n - 1 ] ; return result ; }
def f_gold(price, n): profit = [0] * n max_price = price[n - 1] for i in range(n - 2, 0, - 1): if price[i] > max_price: max_price = price[i] profit[i] = max(profit[i + 1], max_price - price[i]) min_price = price[0] for i in range(1, n): if price[i] < min_price: min_price = price[i] profit[i] = max(profit[i - 1], profit[i] + (price[i] - min_price)) result = profit[n - 1] return result
using namespace std; int f_gold ( int price [ ], int n ) { int * profit = new int [ n ]; for ( int i = 0; i < n; i ++ ) profit [ i ] = 0; int max_price = price [ n - 1 ]; for ( int i = n - 2; i >= 0; i -- ) { if ( price [ i ] > max_price ) max_price = price [ i ]; profit [ i ] = max ( profit [ i + 1 ], max_price - price [ i ] ); } int min_price = price [ 0 ]; for ( int i = 1; i < n; i ++ ) { if ( price [ i ] < min_price ) min_price = price [ i ]; profit [ i ] = max ( profit [ i - 1 ], profit [ i ] + ( price [ i ] - min_price ) ); } int result = profit [ n - 1 ]; delete [ ] profit; return result; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{9,10,10,12,17,18,23,32,41,44,47,50,59,69,69,75,82,84,87,89,97,99}); param0.add(new int[]{6,6,60,40,32,-70,-92,88,10,-8,-54,4,16,8,-44,80,-70,36,36,-74,-94,18,-64,-66,-46,0,-54,-84,16,-88,-34,-24,92,84,62}); param0.add(new int[]{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{2,67,50,8,20,42,37,69,86,74,85,96,78,89,91}); param0.add(new int[]{-68,-52,-14,-2,18,22,30,34,64,64,70}); param0.add(new int[]{1,1,0,0,0,1,0,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,0,0,1,1,0,1}); param0.add(new int[]{4,17,19,28,29,30,30,30,35,36,36,38,40,40,42,43,45,51,55,57,58,59,64,65,66,82,84,85,87,91,92,94,98,98}); param0.add(new int[]{52,88,-40,60,30,8,-96,66,-96,-28,-56,-14,76,-92,56,58,64,-60,-90,26,64,-2,54,-24,54,-46,-44}); 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}); param0.add(new int[]{82,14,51,12,5,15,50,88,91,82,16,98,23,58,86,91,30,81,7,73,67,47,10,50,43,31,19,2,22}); List<Integer> param1 = new ArrayList<>(); param1.add(20); param1.add(34); param1.add(13); param1.add(8); param1.add(9); param1.add(21); param1.add(25); param1.add(14); param1.add(22); param1.add(18); 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()); } }
if __name__ == '__main__': param = [ ([9, 10, 10, 12, 17, 18, 23, 32, 41, 44, 47, 50, 59, 69, 69, 75, 82, 84, 87, 89, 97, 99], 20,), ([6, 6, 60, 40, 32, -70, -92, 88, 10, -8, -54, 4, 16, 8, -44, 80, -70, 36, 36, - 74, -94, 18, -64, -66, -46, 0, -54, -84, 16, -88, -34, -24, 92, 84, 62], 34,), ([0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 13,), ([2, 67, 50, 8, 20, 42, 37, 69, 86, 74, 85, 96, 78, 89, 91], 8,), ([-68, -52, -14, -2, 18, 22, 30, 34, 64, 64, 70], 9,), ([1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1], 21,), ([4, 17, 19, 28, 29, 30, 30, 30, 35, 36, 36, 38, 40, 40, 42, 43, 45, 51, 55, 57, 58, 59, 64, 65, 66, 82, 84, 85, 87, 91, 92, 94, 98, 98], 25,), ([52, 88, -40, 60, 30, 8, -96, 66, -96, -28, -56, -14, 76, -92, 56, 58, 64, -60, -90, 26, 64, -2, 54, -24, 54, -46, -44], 14,), ([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], 22,), ([82, 14, 51, 12, 5, 15, 50, 88, 91, 82, 16, 98, 23, 58, 86, 91, 30, 81, 7, 73, 67, 47, 10, 50, 43, 31, 19, 2, 22], 18,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success += 1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{9,10,10,12,17,18,23,32,41,44,47,50,59,69,69,75,82,84,87,89,97,99},{6,6,60,40,32,-70,-92,88,10,-8,-54,4,16,8,-44,80,-70,36,36,-74,-94,18,-64,-66,-46,0,-54,-84,16,-88,-34,-24,92,84,62},{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1},{2,67,50,8,20,42,37,69,86,74,85,96,78,89,91},{-68,-52,-14,-2,18,22,30,34,64,64,70},{1,1,0,0,0,1,0,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,0,0,1,1,0,1},{4,17,19,28,29,30,30,30,35,36,36,38,40,40,42,43,45,51,55,57,58,59,64,65,66,82,84,85,87,91,92,94,98,98},{52,88,-40,60,30,8,-96,66,-96,-28,-56,-14,76,-92,56,58,64,-60,-90,26,64,-2,54,-24,54,-46,-44},{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},{82,14,51,12,5,15,50,88,91,82,16,98,23,58,86,91,30,81,7,73,67,47,10,50,43,31,19,2,22}}; vector<int> param1 {20,34,13,8,9,21,25,14,22,18}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MAXIMUM_POSSIBLE_SUM_WINDOW_ARRAY_ELEMENTS_WINDOW_ARRAY_UNIQUE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_POSSIBLE_SUM_WINDOW_ARRAY_ELEMENTS_WINDOW_ARRAY_UNIQUE{ static int f_gold ( int A [ ] , int B [ ] , int n ) { Set < Integer > mp = new HashSet < Integer > ( ) ; int result = 0 ; int curr_sum = 0 , curr_begin = 0 ; for ( int i = 0 ; i < n ; ++ i ) { while ( mp . contains ( A [ i ] ) ) { mp . remove ( A [ curr_begin ] ) ; curr_sum -= B [ curr_begin ] ; curr_begin ++ ; } mp . add ( A [ i ] ) ; curr_sum += B [ i ] ; result = Integer . max ( result , curr_sum ) ; } return result ; }
def f_gold ( A , B , n ) : mp = set ( ) result = 0 curr_sum = curr_begin = 0 for i in range ( 0 , n ) : while A [ i ] in mp : mp.remove ( A [ curr_begin ] ) curr_sum -= B [ curr_begin ] curr_begin += 1 mp.add ( A [ i ] ) curr_sum += B [ i ] result = max ( result , curr_sum ) return result
using namespace std; int f_gold ( int A [ ], int B [ ], int n ) { unordered_set < int > mp; int result = 0; int curr_sum = 0, curr_begin = 0; for ( int i = 0; i < n; ++ i ) { while ( mp . find ( A [ i ] ) != mp . end ( ) ) { mp . erase ( A [ curr_begin ] ); curr_sum -= B [ curr_begin ]; curr_begin ++; } mp . insert ( A [ i ] ); curr_sum += B [ i ]; result = max ( result, curr_sum ); } return result; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,8,10,10,16,23,33,36,43,47,50,55,56,72,84,85,86,86,88,90,92,99}); param0.add(new int[]{48,-22,84,76,50,-14,-82,28,86,-50,-40,10,48,20,-48,-84,-64,-48,-32,-84,-32,10,42,-10,-68,-16,-94,-76,42,-96,16,-64,60,8,-88,-62,82,-24,-28,40,18,8}); param0.add(new int[]{0,0,0,1}); param0.add(new int[]{74,64,93,72,75,90,46,72,91,98,57,58,76,29,88,3,86,1,78,74,56,54,57,3,94,2,14,32,67,62,1,30,78,95,40}); param0.add(new int[]{-94,-88,-68,-24,60,94}); param0.add(new int[]{0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,0,0,0,0,0,1,0,1,0,1,1,1,0,0}); param0.add(new int[]{3,7,12,15,17,23,31,31,32,37,41,54,57,60,62,62,64,70,71,74,75,83,97,98}); param0.add(new int[]{-2,26,-74,96,-70,56,92,-74,-38,-18,36,44,-10,-26,26,-22,-58,78,86,22,76,50,88,-86,-80,-36,-48,90,-34,62,46,-56,-32}); 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,1,1}); param0.add(new int[]{86,30,87,99,8,1,24,46,12,21,43,73,28,3,35,49,14,37,63,98,65,43,86,69,27,60,45,88,25,86,11,9,86,73,40,70,49,50,95,69,94}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{8,26,30,35,45,47,55,56,59,61,64,66,67,69,73,77,78,81,82,85,86,99}); param1.add(new int[]{82,94,34,12,18,-68,14,-16,-30,-16,6,74,-68,76,-76,52,-32,-38,78,64,-60,-46,82,-60,98,-70,-52,-96,-6,-44,66,-66,22,-42,-66,4,-2,-48,-94,72,56,88}); param1.add(new int[]{0,0,1,1}); param1.add(new int[]{9,50,22,60,36,46,76,48,90,64,16,24,41,12,36,36,93,52,26,38,68,5,55,19,35,5,7,96,67,64,24,85,6,33,7}); param1.add(new int[]{-80,-72,-60,-42,-24,-6}); param1.add(new int[]{1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,0,1,1,0,1,1,1,1,1,0}); param1.add(new int[]{3,10,10,12,12,14,15,19,19,20,25,27,27,28,40,41,50,51,53,57,60,65,75,99}); param1.add(new int[]{76,42,0,4,-96,-24,-50,-54,26,-8,-38,-46,42,-50,16,-2,-6,2,-8,56,64,-58,-96,2,-64,-66,-14,58,-76,-26,78,-96,48}); 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,1,1,1,1,1,1}); param1.add(new int[]{27,66,77,34,98,75,43,27,79,32,54,40,29,47,63,15,23,33,59,76,27,31,92,43,12,20,97,67,11,12,83,79,52,46,51,36,87,96,90,6,62}); List<Integer> param2 = new ArrayList<>(); param2.add(20); param2.add(30); param2.add(2); param2.add(20); param2.add(4); param2.add(22); param2.add(22); param2.add(17); param2.add(39); param2.add(34); 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()); } }
if __name__ == '__main__': param = [ ([4, 8, 10, 10, 16, 23, 33, 36, 43, 47, 50, 55, 56, 72, 84, 85, 86, 86, 88, 90, 92, 99],[8, 26, 30, 35, 45, 47, 55, 56, 59, 61, 64, 66, 67, 69, 73, 77, 78, 81, 82, 85, 86, 99],20,), ([48, -22, 84, 76, 50, -14, -82, 28, 86, -50, -40, 10, 48, 20, -48, -84, -64, -48, -32, -84, -32, 10, 42, -10, -68, -16, -94, -76, 42, -96, 16, -64, 60, 8, -88, -62, 82, -24, -28, 40, 18, 8],[82, 94, 34, 12, 18, -68, 14, -16, -30, -16, 6, 74, -68, 76, -76, 52, -32, -38, 78, 64, -60, -46, 82, -60, 98, -70, -52, -96, -6, -44, 66, -66, 22, -42, -66, 4, -2, -48, -94, 72, 56, 88],30,), ([0, 0, 0, 1],[0, 0, 1, 1],2,), ([74, 64, 93, 72, 75, 90, 46, 72, 91, 98, 57, 58, 76, 29, 88, 3, 86, 1, 78, 74, 56, 54, 57, 3, 94, 2, 14, 32, 67, 62, 1, 30, 78, 95, 40],[9, 50, 22, 60, 36, 46, 76, 48, 90, 64, 16, 24, 41, 12, 36, 36, 93, 52, 26, 38, 68, 5, 55, 19, 35, 5, 7, 96, 67, 64, 24, 85, 6, 33, 7],20,), ([-94, -88, -68, -24, 60, 94],[-80, -72, -60, -42, -24, -6],4,), ([0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0],[1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0],22,), ([3, 7, 12, 15, 17, 23, 31, 31, 32, 37, 41, 54, 57, 60, 62, 62, 64, 70, 71, 74, 75, 83, 97, 98],[3, 10, 10, 12, 12, 14, 15, 19, 19, 20, 25, 27, 27, 28, 40, 41, 50, 51, 53, 57, 60, 65, 75, 99],22,), ([-2, 26, -74, 96, -70, 56, 92, -74, -38, -18, 36, 44, -10, -26, 26, -22, -58, 78, 86, 22, 76, 50, 88, -86, -80, -36, -48, 90, -34, 62, 46, -56, -32],[76, 42, 0, 4, -96, -24, -50, -54, 26, -8, -38, -46, 42, -50, 16, -2, -6, 2, -8, 56, 64, -58, -96, 2, -64, -66, -14, 58, -76, -26, 78, -96, 48],17,), ([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],[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],39,), ([86, 30, 87, 99, 8, 1, 24, 46, 12, 21, 43, 73, 28, 3, 35, 49, 14, 37, 63, 98, 65, 43, 86, 69, 27, 60, 45, 88, 25, 86, 11, 9, 86, 73, 40, 70, 49, 50, 95, 69, 94],[27, 66, 77, 34, 98, 75, 43, 27, 79, 32, 54, 40, 29, 47, 63, 15, 23, 33, 59, 76, 27, 31, 92, 43, 12, 20, 97, 67, 11, 12, 83, 79, 52, 46, 51, 36, 87, 96, 90, 6, 62],34,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{4,8,10,10,16,23,33,36,43,47,50,55,56,72,84,85,86,86,88,90,92,99},{48,-22,84,76,50,-14,-82,28,86,-50,-40,10,48,20,-48,-84,-64,-48,-32,-84,-32,10,42,-10,-68,-16,-94,-76,42,-96,16,-64,60,8,-88,-62,82,-24,-28,40,18,8},{0,0,0,1},{74,64,93,72,75,90,46,72,91,98,57,58,76,29,88,3,86,1,78,74,56,54,57,3,94,2,14,32,67,62,1,30,78,95,40},{-94,-88,-68,-24,60,94},{0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,0,0,0,0,0,1,0,1,0,1,1,1,0,0},{3,7,12,15,17,23,31,31,32,37,41,54,57,60,62,62,64,70,71,74,75,83,97,98},{-2,26,-74,96,-70,56,92,-74,-38,-18,36,44,-10,-26,26,-22,-58,78,86,22,76,50,88,-86,-80,-36,-48,90,-34,62,46,-56,-32},{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},{86,30,87,99,8,1,24,46,12,21,43,73,28,3,35,49,14,37,63,98,65,43,86,69,27,60,45,88,25,86,11,9,86,73,40,70,49,50,95,69,94}}; vector<vector<int>> param1 {{8,26,30,35,45,47,55,56,59,61,64,66,67,69,73,77,78,81,82,85,86,99},{82,94,34,12,18,-68,14,-16,-30,-16,6,74,-68,76,-76,52,-32,-38,78,64,-60,-46,82,-60,98,-70,-52,-96,-6,-44,66,-66,22,-42,-66,4,-2,-48,-94,72,56,88},{0,0,1,1},{9,50,22,60,36,46,76,48,90,64,16,24,41,12,36,36,93,52,26,38,68,5,55,19,35,5,7,96,67,64,24,85,6,33,7},{-80,-72,-60,-42,-24,-6},{1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,0,1,1,0,1,1,1,1,1,0},{3,10,10,12,12,14,15,19,19,20,25,27,27,28,40,41,50,51,53,57,60,65,75,99},{76,42,0,4,-96,-24,-50,-54,26,-8,-38,-46,42,-50,16,-2,-6,2,-8,56,64,-58,-96,2,-64,-66,-14,58,-76,-26,78,-96,48},{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},{27,66,77,34,98,75,43,27,79,32,54,40,29,47,63,15,23,33,59,76,27,31,92,43,12,20,97,67,11,12,83,79,52,46,51,36,87,96,90,6,62}}; vector<int> param2 {20,30,2,20,4,22,22,17,39,34}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),&param1[i].front(),param2[i]) == f_gold(&param0[i].front(),&param1[i].front(),param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MAXIMUM_WEIGHT_PATH_ENDING_ELEMENT_LAST_ROW_MATRIX
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_WEIGHT_PATH_ENDING_ELEMENT_LAST_ROW_MATRIX{ public static int f_gold ( int mat [ ] [ ] , int N ) { int dp [ ] [ ] = new int [ N ] [ N ] ; dp [ 0 ] [ 0 ] = mat [ 0 ] [ 0 ] ; for ( int i = 1 ; i < N ; i ++ ) dp [ i ] [ 0 ] = mat [ i ] [ 0 ] + dp [ i - 1 ] [ 0 ] ; for ( int i = 1 ; i < N ; i ++ ) for ( int j = 1 ; j < i + 1 && j < N ; j ++ ) dp [ i ] [ j ] = mat [ i ] [ j ] + Math . max ( dp [ i - 1 ] [ j - 1 ] , dp [ i - 1 ] [ j ] ) ; int result = 0 ; for ( int i = 0 ; i < N ; i ++ ) if ( result < dp [ N - 1 ] [ i ] ) result = dp [ N - 1 ] [ i ] ; return result ; }
def f_gold ( mat , N ) : dp = [ [ 0 for i in range ( N ) ] for j in range ( N ) ] dp [ 0 ] [ 0 ] = mat [ 0 ] [ 0 ] for i in range ( 1 , N ) : dp [ i ] [ 0 ] = mat [ i ] [ 0 ] + dp [ i - 1 ] [ 0 ] for i in range ( 1 , N ) : for j in range ( 1 , min ( i + 1 , N ) ) : dp [ i ] [ j ] = mat [ i ] [ j ] + \ max ( dp [ i - 1 ] [ j - 1 ] , dp [ i - 1 ] [ j ] ) result = 0 for i in range ( N ) : if ( result < dp [ N - 1 ] [ i ] ) : result = dp [ N - 1 ] [ i ] return result
null
public static void main(String args[]) { int n_success = 0; List<int [ ] [ ]> param0 = new ArrayList<>(); param0.add(new int[][]{new int[]{1,3,17,22,24,29,36,38,41,42,44,44,47,48,49,51,52,54,64,69,70,77,79,82,86,86,87,88,97,99},new int[]{5,6,17,21,27,27,37,39,47,48,48,52,53,54,57,59,61,63,68,72,75,77,78,81,88,89,91,95,95,97},new int[]{2,8,10,16,17,18,18,18,20,27,33,35,36,42,48,51,56,66,72,72,75,76,76,76,84,85,91,94,96,98},new int[]{1,2,4,11,12,12,14,21,24,26,30,33,37,42,43,47,54,56,62,64,67,68,69,71,72,73,86,86,90,93},new int[]{1,1,3,7,9,10,11,12,14,14,15,17,21,25,26,40,45,46,46,48,49,54,56,60,64,68,68,73,93,93},new int[]{8,11,12,13,13,15,19,20,24,27,29,31,32,33,34,37,39,42,45,50,51,61,65,68,75,81,84,85,87,94},new int[]{12,16,17,24,34,34,35,40,43,48,50,51,53,55,60,60,62,66,68,70,71,73,77,83,84,86,88,95,96,97},new int[]{1,5,7,18,18,22,32,36,38,38,40,43,46,49,50,54,58,61,71,74,78,78,79,82,86,87,87,88,90,95},new int[]{4,11,22,26,28,35,35,37,39,42,45,46,51,57,60,61,62,63,65,65,79,79,79,82,83,87,89,90,91,98},new int[]{6,7,7,8,9,11,13,16,18,23,29,37,38,41,44,46,50,50,51,56,58,67,71,74,77,79,80,90,91,97},new int[]{3,7,10,15,19,20,22,28,28,32,33,36,36,38,41,49,51,54,63,66,66,70,72,79,87,88,89,92,93,98},new int[]{3,8,10,14,21,25,33,35,37,37,43,44,45,50,59,62,63,75,79,79,79,84,85,86,87,87,88,90,91,96},new int[]{2,4,7,12,13,18,23,23,28,29,32,34,37,37,37,38,41,44,45,47,48,49,59,64,72,75,87,92,93,98},new int[]{2,4,5,5,11,14,18,23,24,27,32,35,35,37,39,40,45,48,49,52,60,66,68,71,72,74,78,81,91,92},new int[]{4,4,4,6,11,18,20,23,24,29,32,33,37,40,42,47,51,52,58,59,62,67,68,75,77,78,80,85,89,95},new int[]{5,5,19,21,22,23,29,30,32,39,42,42,44,44,45,46,52,55,59,63,65,76,78,80,81,82,84,93,94,97},new int[]{3,4,6,8,10,15,15,17,27,28,34,36,39,42,53,54,59,63,65,66,70,71,72,80,80,91,92,94,95,99},new int[]{1,7,12,13,16,25,32,32,36,46,46,49,52,55,61,61,67,68,69,72,74,76,77,78,79,81,85,90,90,92},new int[]{2,12,12,13,18,20,25,28,31,31,34,36,38,39,42,43,44,47,54,60,75,76,77,80,82,83,86,90,91,91},new int[]{3,8,9,11,12,14,14,14,19,25,27,29,43,45,48,50,50,56,58,61,63,65,68,71,73,81,83,83,86,93},new int[]{11,15,15,15,15,18,28,29,33,33,36,43,44,48,50,50,53,55,59,59,60,61,62,63,75,78,81,82,87,94},new int[]{4,7,8,10,11,12,19,24,31,36,36,37,40,41,46,48,49,51,57,62,73,75,78,81,82,86,86,91,97,97},new int[]{5,5,7,8,10,14,15,17,19,21,22,23,31,34,36,43,46,58,60,72,72,75,77,81,83,84,86,91,96,98},new int[]{6,10,13,15,22,27,28,29,30,31,32,35,35,36,37,39,39,43,44,47,55,68,68,69,77,83,94,94,98,99},new int[]{4,4,5,6,6,10,18,27,28,29,31,33,34,41,43,44,54,56,63,74,76,77,80,80,83,89,89,90,98,99},new int[]{2,7,15,19,23,23,36,41,44,46,47,49,53,58,58,60,60,66,70,73,76,77,78,80,80,88,88,91,93,94},new int[]{3,3,9,9,10,13,15,19,20,23,25,33,36,37,47,54,58,60,60,65,71,73,81,88,89,90,92,94,94,96},new int[]{6,7,11,19,22,27,27,31,31,33,34,44,46,47,47,48,49,53,53,56,60,60,70,72,79,80,86,93,94,96},new int[]{2,7,7,7,8,10,13,15,17,18,27,27,30,33,33,34,37,41,43,47,55,55,59,71,71,75,78,78,84,85},new int[]{5,6,7,7,14,21,24,26,29,31,32,34,40,42,43,45,46,53,57,58,67,73,74,77,81,85,88,91,91,92}}); param0.add(new int[][]{new int[]{62,44,46,46,-20,-40,24,42,-66,-90,62,-98,60},new int[]{62,88,-38,-30,44,-40,70,-70,96,12,20,-46,-96},new int[]{48,28,-90,82,36,-74,62,70,-54,94,0,58,56},new int[]{46,-26,-40,86,-54,-32,28,10,42,-82,-92,32,82},new int[]{-34,-36,-12,-26,82,84,34,20,18,-28,-2,2,-84},new int[]{0,-18,-24,72,56,58,10,36,-64,30,28,-76,-18},new int[]{-16,20,0,62,66,-28,-4,42,46,-84,-50,-86,-84},new int[]{76,62,52,-38,-76,14,32,-76,-46,-8,-86,22,16},new int[]{16,-74,6,30,-2,-30,88,90,-66,44,34,-80,-32},new int[]{72,-92,92,-42,-8,50,-8,54,18,22,36,32,-32},new int[]{72,-90,-82,-60,-58,-66,-76,84,64,34,-90,20,6},new int[]{4,56,-4,80,-62,-66,8,36,-30,76,-18,-74,-34},new int[]{-70,26,-70,-38,-44,-80,14,42,-34,-86,-90,80,60}}); param0.add(new int[][]{new int[]{0,1,1,1,1,1,1,1},new int[]{0,0,0,0,1,1,1,1},new int[]{0,0,0,0,1,1,1,1},new int[]{0,0,0,0,0,0,0,1},new int[]{0,0,1,1,1,1,1,1},new int[]{0,0,0,0,0,1,1,1},new int[]{0,0,0,0,0,0,0,1},new int[]{0,0,0,0,0,1,1,1}}); param0.add(new int[][]{new int[]{89,8,34,49,96},new int[]{58,75,47,25,3},new int[]{45,52,96,99,96},new int[]{34,69,92,92,8},new int[]{27,80,63,82,25}}); param0.add(new int[][]{new int[]{-98,-94,-92,-86,-86,-86,-84,-78,-76,-70,-68,-66,-64,-58,-56,-52,-42,-40,-38,-38,-36,-32,-30,-24,-20,-12,-8,4,4,6,8,12,18,22,26,30,32,56,58,72,76,78,80,82,88,94,96,98},new int[]{-94,-94,-92,-84,-84,-82,-80,-80,-80,-78,-78,-76,-74,-68,-64,-64,-58,-54,-48,-46,-40,-38,-36,-30,-22,-22,-12,-12,-6,-2,2,4,6,22,22,22,24,24,24,24,26,42,44,50,52,54,66,80},new int[]{-98,-92,-92,-84,-80,-76,-76,-70,-64,-60,-60,-52,-48,-48,-46,-46,-36,-32,-30,-24,-22,-16,-14,-8,-8,-4,-2,0,2,2,2,8,10,12,22,32,38,38,40,48,64,68,76,78,78,86,96,96},new int[]{-98,-96,-88,-86,-78,-78,-70,-68,-62,-60,-58,-42,-38,-38,-38,-36,-36,-32,-28,-26,-24,-12,-10,-4,2,12,12,18,26,32,34,36,38,44,44,50,52,54,54,56,56,58,70,74,76,82,86,90},new int[]{-98,-96,-96,-94,-90,-90,-90,-86,-82,-78,-76,-74,-72,-68,-66,-60,-52,-46,-44,-44,-38,-38,-34,-32,-22,-20,-18,-14,8,8,12,12,12,16,20,38,40,44,52,76,78,80,82,86,90,90,96,98},new int[]{-88,-84,-84,-80,-78,-70,-68,-66,-62,-62,-54,-52,-48,-42,-42,-40,-32,-30,-26,-26,-24,-24,-14,-6,-4,-2,-2,4,4,8,22,24,40,42,52,52,56,56,58,64,72,72,74,74,86,92,96,98},new int[]{-98,-98,-92,-82,-76,-72,-68,-66,-64,-62,-56,-50,-48,-46,-46,-40,-40,-40,-38,-28,-28,-24,-22,-20,-20,-10,-6,4,6,10,12,26,32,38,38,40,42,56,60,64,64,72,72,76,84,90,94,98},new int[]{-98,-86,-72,-72,-66,-66,-64,-58,-56,-54,-54,-50,-44,-44,-36,-32,-30,-28,-26,-18,-14,-6,-4,6,6,10,10,14,22,28,38,40,46,46,50,52,54,56,60,68,68,72,76,90,90,92,92,98},new int[]{-90,-86,-86,-84,-76,-74,-70,-66,-58,-58,-54,-50,-48,-44,-38,-38,-36,-34,-30,-22,-22,-8,-6,4,6,6,6,8,10,24,24,28,32,32,32,36,44,48,48,50,52,64,70,74,76,92,94,96},new int[]{-96,-94,-84,-76,-76,-70,-68,-66,-56,-50,-50,-48,-46,-42,-42,-40,-40,-38,-38,-36,-36,-34,-30,-24,-22,-6,-4,-2,2,4,10,12,16,24,28,32,38,46,50,56,56,62,64,66,74,74,98,98},new int[]{-98,-96,-92,-88,-88,-84,-82,-78,-68,-66,-54,-52,-52,-50,-44,-40,-40,-38,-34,-34,-30,-26,-26,-24,-18,-14,-10,4,6,6,16,20,24,26,26,32,36,38,56,66,70,78,78,84,86,88,88,90},new int[]{-94,-90,-86,-86,-86,-86,-84,-82,-78,-78,-76,-72,-68,-64,-64,-62,-46,-42,-42,-28,-26,-18,-16,-10,-8,-2,0,10,10,12,18,18,26,26,32,34,34,40,50,54,56,58,62,66,66,82,84,94},new int[]{-98,-94,-88,-86,-84,-80,-80,-78,-78,-74,-72,-72,-70,-70,-68,-66,-66,-64,-50,-44,-28,-24,-16,-6,-4,0,2,8,12,22,26,32,38,38,50,54,58,58,64,64,66,70,78,86,88,90,96,98},new int[]{-96,-94,-90,-82,-78,-76,-76,-72,-64,-62,-54,-52,-50,-46,-44,-36,-30,-28,-28,-28,-22,-14,-12,0,0,2,6,6,10,18,22,22,24,28,28,30,34,36,36,42,46,48,54,66,72,76,86,96},new int[]{-98,-96,-92,-92,-90,-88,-86,-82,-78,-70,-68,-66,-60,-58,-48,-48,-46,-30,-26,-22,-20,-16,-12,-8,-4,-4,4,16,22,32,34,34,36,36,40,52,60,62,64,66,66,74,74,78,82,82,86,94},new int[]{-92,-90,-88,-84,-82,-80,-78,-76,-74,-60,-56,-48,-48,-48,-48,-42,-38,-38,-30,-28,-28,-26,-12,-12,-10,-10,-2,14,16,22,26,34,42,44,52,54,56,58,58,60,62,66,70,82,84,90,94,96},new int[]{-96,-92,-92,-84,-80,-76,-74,-74,-72,-70,-66,-66,-62,-60,-58,-56,-56,-50,-36,-34,-26,-10,2,2,10,10,10,10,12,18,22,22,34,34,40,60,62,62,68,72,76,78,82,82,82,82,94,96},new int[]{-96,-96,-88,-84,-78,-72,-68,-62,-56,-56,-52,-38,-32,-24,-20,-18,-18,-16,-10,-6,8,8,12,18,24,24,26,28,30,30,32,32,56,62,64,66,66,72,74,74,78,84,84,86,88,92,92,98},new int[]{-92,-86,-78,-68,-68,-68,-64,-58,-56,-48,-44,-38,-36,-34,-26,-22,-20,-18,-8,-6,0,2,4,12,12,18,20,22,30,32,36,38,42,44,46,50,50,52,56,58,62,64,68,70,70,82,90,98},new int[]{-94,-92,-92,-90,-88,-84,-80,-76,-74,-72,-72,-68,-62,-62,-56,-54,-50,-44,-42,-42,-30,-20,-16,-6,-6,12,14,16,18,30,30,40,42,44,54,58,58,68,74,74,80,84,84,86,88,94,96,96},new int[]{-90,-86,-84,-84,-78,-78,-70,-70,-64,-56,-52,-50,-48,-48,-48,-46,-42,-40,-40,-30,-30,-28,-24,-22,-18,-16,-14,-6,-2,4,10,12,14,14,20,26,32,44,58,64,68,68,74,76,76,82,86,88},new int[]{-98,-84,-80,-80,-78,-78,-78,-76,-68,-62,-56,-50,-34,-30,-30,-12,-8,-4,2,8,10,12,14,22,24,26,36,38,38,44,46,48,56,58,62,64,64,66,66,70,70,74,78,82,88,90,94,96},new int[]{-96,-96,-96,-96,-94,-94,-90,-86,-84,-80,-78,-74,-64,-60,-56,-54,-42,-38,-38,-38,-36,-34,-18,-16,-14,-14,-10,-10,-10,-6,-4,8,14,20,32,42,44,48,54,54,56,70,70,72,74,80,84,94},new int[]{-96,-94,-86,-84,-78,-76,-70,-66,-62,-60,-56,-56,-54,-54,-52,-52,-50,-46,-46,-34,-32,-32,-28,-16,-12,-6,0,16,18,18,20,20,28,34,38,40,42,42,52,56,62,66,66,70,82,84,88,98},new int[]{-86,-84,-80,-78,-62,-60,-58,-56,-54,-52,-48,-44,-40,-38,-38,-26,-26,-24,-24,-18,-10,-6,2,8,12,16,22,26,32,36,42,44,46,48,52,52,52,62,66,70,78,78,78,80,84,90,92,92},new int[]{-98,-96,-88,-86,-82,-78,-78,-72,-72,-70,-64,-64,-60,-58,-54,-52,-46,-42,-30,-18,-14,-2,2,2,6,12,20,24,24,28,32,38,38,48,54,58,60,66,68,70,70,74,78,80,82,84,86,90},new int[]{-98,-88,-82,-82,-76,-76,-74,-70,-70,-68,-66,-64,-62,-58,-56,-52,-40,-38,-38,-38,-38,-36,-30,-26,-26,-12,-2,4,6,16,20,24,26,26,28,34,44,50,60,68,72,74,78,84,84,88,90,90},new int[]{-98,-98,-96,-94,-88,-88,-86,-82,-66,-64,-62,-62,-40,-38,-34,-20,-14,-12,-10,-8,0,6,10,10,12,18,22,26,26,28,32,36,40,44,44,46,64,68,70,72,74,78,80,82,82,82,92,96},new int[]{-94,-94,-92,-88,-88,-84,-82,-78,-78,-76,-72,-64,-60,-56,-54,-54,-50,-48,-46,-42,-32,-28,-28,-24,-22,-22,-16,-14,-12,-12,4,10,16,16,16,28,30,40,48,56,62,64,68,76,88,90,92,98},new int[]{-94,-90,-88,-80,-76,-76,-76,-76,-72,-72,-68,-68,-68,-68,-66,-64,-62,-62,-54,-52,-46,-44,-36,-34,-20,-20,-16,-16,-10,-8,0,4,22,24,28,36,38,44,50,52,60,64,68,72,76,84,86,88},new int[]{-98,-98,-96,-94,-92,-80,-74,-72,-68,-68,-66,-64,-64,-62,-54,-52,-52,-28,-28,-28,-20,-10,2,6,6,14,16,16,24,28,28,32,32,36,38,44,44,46,50,58,64,68,78,86,90,90,96,98},new int[]{-96,-92,-80,-78,-68,-56,-54,-54,-44,-44,-36,-34,-34,-32,-30,-26,-22,-12,-8,-2,-2,-2,6,8,8,20,20,24,28,32,36,36,38,40,42,44,44,46,48,52,54,56,60,68,70,76,80,86},new int[]{-96,-86,-82,-82,-78,-76,-74,-68,-62,-54,-50,-48,-40,-38,-36,-34,-32,-26,-14,-12,-12,-6,-4,0,8,10,14,20,20,26,28,40,44,46,48,56,58,60,62,66,68,76,78,86,88,88,90,94},new int[]{-98,-96,-86,-86,-84,-76,-76,-72,-72,-70,-64,-62,-58,-58,-54,-48,-46,-42,-32,-28,-28,-26,-24,-20,-14,0,0,0,0,2,10,14,18,48,50,50,52,56,58,60,62,68,76,82,86,88,94,94},new int[]{-96,-92,-86,-82,-82,-80,-80,-78,-76,-74,-72,-62,-62,-56,-56,-50,-40,-30,-28,-18,-18,-12,-10,0,4,10,12,12,16,18,18,18,22,30,34,42,68,74,82,86,86,90,90,90,92,92,94,94},new int[]{-92,-90,-88,-82,-82,-80,-74,-70,-66,-60,-58,-54,-48,-44,-40,-38,-32,-30,-26,-4,2,2,10,16,18,26,30,32,32,54,56,56,58,60,62,64,64,66,72,76,78,78,78,80,80,82,86,92},new int[]{-82,-82,-76,-74,-70,-66,-62,-62,-56,-54,-46,-46,-42,-36,-32,-30,-30,-26,-24,-22,-20,-10,-8,4,8,14,20,22,26,36,38,46,46,46,50,50,52,54,54,58,68,76,80,84,86,86,90,98},new int[]{-98,-92,-92,-82,-78,-76,-62,-56,-54,-50,-50,-48,-48,-46,-44,-44,-34,-26,-24,-20,-16,-2,16,16,22,28,28,30,36,36,38,38,40,42,42,44,50,56,56,60,62,74,78,90,92,94,96,98},new int[]{-96,-92,-92,-86,-84,-74,-56,-54,-50,-42,-38,-36,-30,-28,-24,-22,-14,-10,-10,-10,-8,-8,0,4,8,8,10,18,24,24,30,30,34,38,38,42,44,44,50,54,54,66,72,74,78,84,92,98},new int[]{-90,-88,-80,-70,-56,-56,-54,-54,-50,-44,-44,-42,-40,-38,-26,-22,-22,-16,-14,-8,0,2,18,20,34,36,36,40,42,44,46,46,48,54,54,54,56,68,68,72,72,72,76,84,86,90,92,96},new int[]{-98,-96,-94,-86,-82,-76,-76,-70,-70,-68,-64,-48,-38,-38,-36,-28,-28,-26,-20,-18,-6,-2,-2,2,4,6,8,8,12,12,14,16,26,30,30,34,44,44,48,48,56,72,80,80,84,84,92,94},new int[]{-90,-88,-84,-74,-74,-72,-70,-70,-68,-68,-64,-56,-52,-50,-40,-38,-32,-28,-22,-14,-14,-12,-8,-4,-2,8,10,14,14,18,22,24,30,32,36,40,58,62,64,64,64,68,72,74,82,94,98,98},new int[]{-98,-92,-88,-80,-76,-70,-70,-66,-58,-56,-56,-40,-32,-26,-18,-6,-4,-2,0,0,0,2,2,6,18,20,26,32,46,46,48,48,48,52,66,68,68,68,70,70,82,82,84,86,92,96,96,98},new int[]{-98,-96,-92,-92,-92,-82,-72,-68,-66,-62,-46,-44,-44,-42,-38,-34,-32,-26,-26,-16,-12,-12,-10,-6,-6,-2,0,0,4,10,12,12,14,30,36,42,46,54,58,58,66,68,68,70,90,92,96,98},new int[]{-92,-86,-76,-76,-76,-72,-72,-68,-68,-58,-48,-40,-40,-36,-36,-26,-18,-14,-12,-10,-8,-8,2,8,12,16,20,24,26,30,30,34,42,42,46,56,60,62,66,72,78,78,82,82,88,90,92,92},new int[]{-92,-90,-90,-88,-84,-78,-70,-64,-60,-54,-42,-36,-34,-32,-30,-20,-14,-10,-8,-2,0,8,10,10,20,24,28,32,42,42,42,50,54,56,60,60,60,68,68,72,78,78,86,86,92,92,98,98},new int[]{-98,-98,-96,-96,-94,-90,-88,-86,-80,-78,-76,-72,-58,-52,-48,-34,-34,-28,-28,-24,-24,-18,-16,-12,-8,-8,-6,8,10,12,12,12,12,26,30,30,38,52,52,64,68,72,74,80,80,82,88,90},new int[]{-92,-90,-82,-80,-72,-66,-52,-44,-44,-42,-42,-36,-34,-32,-26,-24,-22,-20,-18,-18,-16,-16,-16,-2,2,4,8,10,16,22,24,36,38,40,46,50,56,58,64,66,74,74,84,84,88,92,96,98}}); param0.add(new int[][]{new int[]{0,1,0,0,0,1,0,1,0,0,1,0,1,1,0,1,1,1,1,0,1,1,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0},new int[]{0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,1,1,0,0,0,1,0,0,1,1,1,0,0,0,1,0,0,1,1,0,1},new int[]{0,0,0,1,0,1,1,1,1,0,1,0,0,0,0,1,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0,1,1,0,0,0,1},new int[]{1,0,1,0,0,1,1,1,1,0,0,1,1,1,0,0,1,0,0,0,0,1,1,1,1,0,1,1,1,1,1,0,1,0,0,0,0},new int[]{0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,0,1},new int[]{0,0,1,1,1,1,1,0,0,1,1,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,0,1,0,1,1,1,0,0,0,1,0},new int[]{0,1,1,0,0,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,0,0,1,1,0,1,1,0,0,0,0,1,0,0,0,0,1},new int[]{1,0,0,0,0,1,1,1,1,0,1,1,0,1,1,1,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0},new int[]{1,0,1,0,0,1,0,1,1,1,0,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,0,0,1},new int[]{1,1,0,1,1,0,1,1,1,1,1,1,1,1,0,1,1,1,0,1,0,1,0,0,0,1,1,0,1,0,1,1,0,0,1,0,0},new int[]{1,0,1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0},new int[]{1,0,1,1,0,1,1,1,1,0,1,0,1,1,1,0,0,0,0,1,0,1,0,1,1,0,1,1,1,1,1,0,0,1,1,0,0},new int[]{0,1,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,1,1,1,0,0,1,1,1,0,1,0,1,0,0,1,0,0,0,0,1},new int[]{0,0,0,1,1,0,1,1,1,1,1,1,1,0,0,0,1,0,1,1,0,0,0,0,1,0,0,1,1,1,1,1,0,0,1,0,1},new int[]{0,0,0,0,0,1,0,0,0,0,1,1,1,0,1,1,1,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,1,0,1,1},new int[]{0,1,0,0,0,0,1,1,0,1,1,1,0,0,0,1,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,1,1,0,0,0,1},new int[]{1,1,1,1,0,1,1,0,0,0,1,0,1,0,1,1,0,1,0,1,1,1,0,1,0,1,1,0,0,1,1,1,1,1,1,0,1},new int[]{0,1,1,0,1,1,0,1,0,1,1,0,0,1,0,0,0,1,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,1,0,0},new int[]{1,1,0,0,1,1,0,0,1,0,1,1,1,0,0,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,0,0,1,1,0,1,0},new int[]{1,0,0,1,1,0,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,0,0,0,0,1,0,1,0,0,1},new int[]{0,0,1,0,0,0,1,1,1,1,1,0,1,0,1,0,1,1,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,1,1,0,0},new int[]{0,0,0,0,1,1,0,1,0,0,1,0,1,0,1,0,1,1,0,0,1,0,0,0,0,0,0,1,1,0,1,0,1,0,0,0,1},new int[]{0,0,1,1,0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,1,1,0,1,1,0,0,1,0,0,0,0,1},new int[]{0,1,0,0,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,0,1,1,0,1,0},new int[]{1,0,1,0,1,0,1,0,1,0,0,1,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,1,0},new int[]{0,1,1,1,1,1,0,1,0,1,0,1,1,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0},new int[]{1,1,1,0,1,0,0,1,1,1,1,1,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,1},new int[]{1,1,1,0,0,1,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,1,0},new int[]{1,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,1,1,1,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,1},new int[]{0,1,1,0,1,0,1,1,0,0,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,0,1,0,1,1,0,0,0,0,1,0},new int[]{0,1,1,1,0,0,1,1,1,0,1,0,0,1,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,1,0,0,0},new int[]{1,1,1,1,0,0,1,1,0,1,1,1,1,0,1,0,1,1,0,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,1},new int[]{1,1,1,0,1,1,0,1,0,1,0,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0},new int[]{1,0,0,1,0,1,1,1,0,0,1,0,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,1},new int[]{0,1,0,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,0,0,1,0,1,0,0,1,1,0,0,0,1,1,1,1},new int[]{1,1,0,1,1,0,0,1,1,1,1,0,0,0,1,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,1,0,0,0},new int[]{1,1,0,0,0,1,1,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,1,0,0,0}}); param0.add(new int[][]{new int[]{1,3,3,4,4,5,8,11,13,15,16,18,20,21,24,25,25,35,36,37,39,40,40,41,41,42,42,44,44,44,45,47,49,54,61,62,64,64,70,72,82,85,87,92,93,93,94,95},new int[]{1,2,2,3,4,5,5,6,8,8,9,11,15,16,19,20,20,22,22,25,33,36,37,39,40,41,41,44,54,60,62,65,67,68,68,70,72,77,77,78,78,79,85,86,87,88,93,99},new int[]{1,1,1,1,3,5,6,7,7,10,12,13,13,15,17,20,21,21,22,25,31,33,37,40,41,41,46,50,53,54,55,57,61,63,64,65,68,69,76,76,81,81,82,82,84,87,89,90},new int[]{1,1,1,1,4,6,19,19,19,20,21,21,22,22,23,23,25,25,26,26,29,30,34,34,35,37,48,48,50,52,59,60,62,63,64,66,68,68,75,85,88,89,91,92,94,95,97,99},new int[]{2,3,7,12,15,16,18,20,20,23,24,27,29,31,33,36,36,37,38,44,47,52,52,54,55,61,62,62,64,66,66,73,74,75,76,80,81,81,83,83,84,87,87,89,92,92,96,99},new int[]{1,4,4,5,6,8,12,12,14,16,21,24,24,27,29,34,35,39,41,44,44,46,48,50,52,52,53,56,60,62,64,67,72,77,78,80,81,83,84,84,85,88,91,93,93,94,94,95},new int[]{3,3,4,11,11,12,15,15,17,17,18,20,24,24,27,27,29,32,35,37,39,39,41,43,43,44,48,49,53,60,69,70,73,74,75,76,76,84,85,85,85,87,87,89,90,91,93,93},new int[]{1,11,11,12,15,15,16,16,17,17,18,19,20,23,27,27,31,32,32,35,37,39,39,41,43,45,47,49,49,49,56,60,61,64,67,71,73,78,79,79,81,82,83,85,87,89,92,98},new int[]{5,6,9,13,14,16,17,20,20,22,22,23,28,29,29,30,32,33,36,37,45,47,49,49,50,50,52,56,60,62,65,66,69,70,71,77,78,78,80,82,83,86,86,88,88,90,90,99},new int[]{3,11,12,13,14,14,15,19,19,20,26,27,28,31,32,32,32,35,35,39,39,42,43,49,54,55,57,58,59,60,61,62,62,65,65,67,73,74,81,82,83,86,88,88,93,95,95,97},new int[]{1,3,3,5,7,11,17,20,20,21,21,23,24,25,26,26,30,32,35,37,38,39,42,44,47,47,48,49,51,57,57,59,60,61,62,63,66,69,70,73,78,80,84,84,89,92,96,97},new int[]{1,1,2,11,12,13,15,17,19,21,22,24,27,28,28,29,30,34,39,40,40,44,45,48,57,58,58,59,61,63,63,64,66,66,68,69,70,71,74,78,79,82,84,86,89,90,94,97},new int[]{2,3,7,10,10,12,13,13,17,17,19,21,36,47,48,48,51,51,52,55,57,61,61,61,65,70,71,73,74,74,75,75,76,78,79,80,80,85,86,87,87,89,91,94,95,97,97,97},new int[]{1,2,2,8,9,9,9,14,16,17,23,24,27,29,30,30,34,35,36,43,44,44,47,49,50,54,56,57,58,63,67,68,69,70,72,76,77,80,81,84,84,86,88,90,93,96,96,96},new int[]{2,3,3,5,5,7,7,11,18,19,19,20,23,24,27,27,28,30,30,36,38,39,40,48,50,51,53,57,57,66,67,68,73,77,78,79,82,84,85,87,88,89,95,96,97,98,99,99},new int[]{3,8,10,10,12,13,13,15,16,16,17,21,21,22,23,24,26,26,27,29,32,34,35,37,42,42,52,54,61,61,65,65,66,70,73,74,76,79,83,83,85,89,91,93,94,96,97,97},new int[]{3,5,6,7,9,10,13,16,16,19,23,24,24,26,28,29,30,32,33,36,37,37,41,41,41,42,42,44,45,49,50,52,55,57,58,60,61,63,75,77,77,79,80,81,86,89,94,99},new int[]{1,10,13,14,15,17,18,20,21,22,23,25,26,28,32,37,39,44,46,47,47,47,47,50,51,52,55,55,58,61,69,72,73,77,77,78,80,81,82,84,88,91,93,94,95,96,97,98},new int[]{1,5,5,13,13,17,26,28,30,32,34,41,43,44,45,45,46,46,49,52,53,56,57,61,61,62,63,63,63,64,65,67,69,70,73,76,77,80,80,81,82,87,87,88,89,89,93,96},new int[]{5,11,12,12,18,19,19,22,24,26,26,26,30,32,33,35,35,36,38,39,42,44,46,48,52,56,57,58,59,65,65,66,67,67,68,70,73,73,75,76,77,78,80,83,84,88,92,99},new int[]{5,6,9,13,17,20,20,21,22,24,25,26,30,32,33,36,37,38,38,40,44,45,48,53,55,58,58,58,59,61,63,63,63,65,67,72,75,75,75,77,77,77,79,82,88,93,97,97},new int[]{9,13,14,16,17,18,21,22,22,23,24,25,33,37,40,41,42,46,49,49,51,54,57,58,58,60,67,71,73,74,74,75,77,78,80,82,85,85,86,86,86,87,91,92,93,95,97,98},new int[]{1,3,10,11,14,18,18,19,23,24,26,28,33,36,37,42,42,47,47,48,48,52,53,56,57,59,61,63,63,64,65,67,69,71,75,77,78,79,83,83,83,85,86,86,92,96,97,97},new int[]{3,5,6,7,7,9,13,13,18,25,27,28,29,30,32,34,37,43,44,51,52,53,54,59,63,63,64,66,68,70,70,72,72,73,77,78,80,82,83,83,84,85,85,93,95,97,99,99},new int[]{4,6,7,9,9,20,20,22,31,33,34,35,35,38,40,41,42,42,44,46,47,50,52,54,57,58,60,61,62,63,63,64,65,70,72,74,80,81,87,87,88,88,92,92,95,99,99,99},new int[]{3,5,9,10,10,15,18,20,21,21,23,25,28,29,37,38,40,40,40,46,51,53,55,57,59,59,60,67,68,71,72,73,75,76,79,79,81,83,86,87,88,90,90,90,92,95,96,98},new int[]{5,7,8,9,9,12,14,16,18,18,18,24,25,26,28,28,29,30,32,37,38,44,44,45,46,48,51,55,55,56,58,58,62,63,64,67,71,74,76,81,86,87,88,90,90,91,95,97},new int[]{4,5,13,13,16,19,19,20,22,26,27,28,30,30,31,32,33,39,39,41,41,43,45,49,50,51,64,66,67,71,73,75,78,78,79,82,84,86,87,87,88,90,91,91,92,93,96,97},new int[]{2,3,5,11,16,20,21,21,25,29,31,34,36,36,37,37,38,38,44,45,46,54,60,60,61,61,67,67,67,70,71,72,76,77,79,80,83,84,84,87,87,88,90,92,93,98,99,99},new int[]{1,2,5,5,12,13,13,15,18,19,24,25,25,26,28,29,30,33,34,35,35,36,36,37,38,42,44,49,50,53,58,58,58,60,65,67,72,75,77,78,81,84,88,88,90,91,94,97},new int[]{5,5,6,7,8,11,11,13,19,23,25,35,37,40,40,46,47,48,48,49,51,58,60,61,63,65,67,68,71,72,76,77,79,80,84,87,88,88,89,90,92,94,94,96,96,97,97,99},new int[]{1,2,3,3,5,5,13,18,19,23,31,32,34,35,36,38,39,40,42,49,51,53,54,56,62,64,64,64,66,67,67,67,69,72,74,74,80,81,83,83,84,85,91,91,94,95,96,98},new int[]{1,2,5,9,10,11,14,15,16,16,24,27,30,32,35,37,39,39,40,43,48,49,50,54,57,57,58,59,60,63,63,64,64,64,68,70,76,77,80,82,85,87,88,90,91,94,94,97},new int[]{10,14,15,17,17,18,22,22,28,29,29,32,32,34,36,36,38,39,40,42,43,45,45,45,54,54,55,55,59,63,67,68,74,75,75,77,77,79,80,86,86,87,87,87,87,88,93,96},new int[]{2,2,5,5,9,14,17,17,20,22,22,23,25,32,32,32,35,37,37,38,39,40,47,52,55,56,60,62,63,63,63,63,64,69,73,73,74,75,77,79,82,85,88,88,90,92,92,93},new int[]{3,4,4,6,8,10,12,15,16,16,17,20,21,21,24,26,27,28,28,29,30,32,38,44,49,49,50,54,59,59,61,62,64,64,65,70,70,71,72,72,73,74,75,80,83,90,92,92},new int[]{4,5,9,9,13,15,16,16,17,23,25,27,28,29,29,37,37,40,43,45,49,50,51,51,53,55,56,60,61,61,64,67,68,73,74,75,76,77,79,80,85,89,89,89,91,97,97,97},new int[]{2,5,9,10,11,11,11,15,15,16,18,20,21,22,23,24,40,41,47,47,48,48,49,51,53,53,54,55,61,63,65,68,70,73,74,74,77,78,79,80,82,83,85,85,86,87,98,99},new int[]{1,12,13,14,16,17,18,19,20,21,23,23,27,27,30,34,36,36,38,42,43,43,44,44,48,49,53,54,55,61,62,66,67,72,72,73,73,77,78,78,86,88,89,92,93,98,98,99},new int[]{1,2,4,6,9,13,13,13,17,18,20,28,28,30,32,33,37,38,42,42,44,47,50,52,53,54,56,57,59,60,66,68,70,71,72,74,76,77,79,83,83,84,85,90,94,94,97,99},new int[]{1,1,9,9,10,10,11,12,12,15,21,22,24,24,25,26,26,27,30,31,34,35,40,41,43,47,47,53,53,53,57,60,61,61,64,66,68,71,71,79,82,82,84,88,88,90,96,99},new int[]{4,4,6,6,6,6,8,9,11,11,14,16,21,25,29,37,38,40,44,45,50,51,51,53,53,56,57,58,59,59,63,69,71,72,74,76,79,80,82,83,87,93,94,96,98,98,99,99},new int[]{2,2,5,9,10,12,13,13,13,13,19,22,27,32,33,34,34,38,41,45,46,47,48,50,51,51,52,54,54,57,57,60,61,74,76,76,77,79,81,83,85,92,93,95,96,97,99,99},new int[]{4,4,4,6,7,9,14,15,16,18,19,23,27,37,38,39,40,41,41,44,45,51,52,53,54,54,56,57,58,59,60,63,65,65,69,79,85,85,88,89,90,90,93,94,95,95,95,99},new int[]{6,6,7,9,10,10,11,15,15,16,16,17,19,20,24,28,30,31,31,33,35,37,38,40,40,43,44,44,45,46,48,58,59,62,72,73,74,80,82,82,83,85,88,90,91,91,91,96},new int[]{2,2,2,2,3,4,5,12,12,15,23,23,24,24,29,35,36,38,40,41,47,47,48,49,51,54,56,57,60,62,63,64,70,75,75,76,77,80,82,83,87,90,91,91,92,93,94,94},new int[]{3,4,4,7,8,9,11,12,15,19,21,22,23,24,28,28,31,37,37,37,39,48,52,52,55,55,55,57,61,66,72,75,76,77,79,83,84,84,84,88,90,92,93,94,98,98,98,99},new int[]{2,5,7,11,13,15,27,29,29,31,35,38,41,42,44,44,46,47,49,52,52,53,53,53,54,54,55,56,58,60,61,61,63,69,72,72,77,77,79,80,84,84,86,87,90,92,92,93}}); param0.add(new int[][]{new int[]{28,84,-76,-76,-28,-42,-78,6,40,70,48,92,-6,-34,62,34,-14,-64},new int[]{48,6,-22,44,-32,-26,-18,94,-2,-80,-20,-64,-50,-18,-28,-96,66,48},new int[]{-2,34,6,-62,-48,8,2,-50,-66,48,22,-8,10,0,50,-78,-76,-20},new int[]{-4,12,-84,76,-72,74,12,8,-66,-10,-90,-94,-82,68,-60,66,-58,60},new int[]{-34,-90,-52,26,58,-48,78,84,-34,-64,-64,-24,-34,-46,-2,0,-70,54},new int[]{4,96,36,98,-62,90,-50,52,52,-50,-34,20,-26,84,-14,-82,-72,-94},new int[]{38,12,-48,6,-18,64,-58,-22,60,-54,86,48,16,38,50,-42,24,6},new int[]{-10,-46,-32,-72,-18,48,20,-16,2,50,-78,-30,-62,76,30,52,22,-6},new int[]{-72,34,4,-36,60,-80,-66,-20,36,26,-70,94,-22,14,-80,42,94,-66},new int[]{52,-66,-68,56,-94,2,88,-8,10,98,-48,52,-38,62,44,-62,80,36},new int[]{-70,16,56,-40,-4,12,-16,-52,4,-14,-32,20,66,-94,36,-78,-74,0},new int[]{64,-62,-12,-34,-24,-94,98,30,-30,-28,-24,-22,-50,28,-74,36,40,50},new int[]{-98,44,8,96,-82,-28,-26,18,-58,-60,-98,98,18,-44,42,12,-82,30},new int[]{-28,96,-32,62,-36,32,-50,2,26,80,-10,-48,-58,64,86,2,-52,84},new int[]{-76,-78,-46,-54,-34,60,84,84,-24,10,40,-16,-42,-32,14,-94,-88,-4},new int[]{28,-74,-28,58,40,-34,52,14,10,-74,94,2,84,6,-28,-90,-50,62},new int[]{-26,-62,-30,-32,8,-8,-88,66,-98,42,-32,12,66,94,-48,-16,82,-24},new int[]{-48,98,18,68,-52,-58,20,80,-60,-88,34,-80,-76,94,-56,24,22,60}}); param0.add(new int[][]{new int[]{0,0,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,1,1,1,1,1},new int[]{0,0,0,0,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,1,1,1,1},new int[]{0,0,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,1},new int[]{0,0,0,0,0,0,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,1,1},new int[]{0,0,0,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,1,1,1,1,1}}); param0.add(new int[][]{new int[]{93,9,33,88,35,75,39,77,87,25},new int[]{80,56,48,85,10,41,83,99,59,28},new int[]{41,66,51,62,30,40,40,69,62,15},new int[]{3,24,41,63,48,61,48,47,56,76},new int[]{8,78,18,84,23,69,65,46,66,80},new int[]{69,22,65,12,19,22,55,62,51,48},new int[]{17,13,28,67,5,60,15,81,44,46},new int[]{29,68,96,49,43,68,77,20,18,64},new int[]{49,42,12,89,94,79,36,8,28,86},new int[]{60,49,38,80,58,5,46,98,75,2}}); List<Integer> param1 = new ArrayList<>(); param1.add(29); param1.add(9); param1.add(4); param1.add(3); param1.add(28); param1.add(26); param1.add(44); param1.add(9); param1.add(5); 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()); } }
if __name__ == '__main__': param = [ ([[1, 3, 17, 22, 24, 29, 36, 38, 41, 42, 44, 44, 47, 48, 49, 51, 52, 54, 64, 69, 70, 77, 79, 82, 86, 86, 87, 88, 97, 99], [5, 6, 17, 21, 27, 27, 37, 39, 47, 48, 48, 52, 53, 54, 57, 59, 61, 63, 68, 72, 75, 77, 78, 81, 88, 89, 91, 95, 95, 97], [2, 8, 10, 16, 17, 18, 18, 18, 20, 27, 33, 35, 36, 42, 48, 51, 56, 66, 72, 72, 75, 76, 76, 76, 84, 85, 91, 94, 96, 98], [1, 2, 4, 11, 12, 12, 14, 21, 24, 26, 30, 33, 37, 42, 43, 47, 54, 56, 62, 64, 67, 68, 69, 71, 72, 73, 86, 86, 90, 93], [1, 1, 3, 7, 9, 10, 11, 12, 14, 14, 15, 17, 21, 25, 26, 40, 45, 46, 46, 48, 49, 54, 56, 60, 64, 68, 68, 73, 93, 93], [8, 11, 12, 13, 13, 15, 19, 20, 24, 27, 29, 31, 32, 33, 34, 37, 39, 42, 45, 50, 51, 61, 65, 68, 75, 81, 84, 85, 87, 94], [12, 16, 17, 24, 34, 34, 35, 40, 43, 48, 50, 51, 53, 55, 60, 60, 62, 66, 68, 70, 71, 73, 77, 83, 84, 86, 88, 95, 96, 97], [1, 5, 7, 18, 18, 22, 32, 36, 38, 38, 40, 43, 46, 49, 50, 54, 58, 61, 71, 74, 78, 78, 79, 82, 86, 87, 87, 88, 90, 95], [4, 11, 22, 26, 28, 35, 35, 37, 39, 42, 45, 46, 51, 57, 60, 61, 62, 63, 65, 65, 79, 79, 79, 82, 83, 87, 89, 90, 91, 98], [6, 7, 7, 8, 9, 11, 13, 16, 18, 23, 29, 37, 38, 41, 44, 46, 50, 50, 51, 56, 58, 67, 71, 74, 77, 79, 80, 90, 91, 97], [3, 7, 10, 15, 19, 20, 22, 28, 28, 32, 33, 36, 36, 38, 41, 49, 51, 54, 63, 66, 66, 70, 72, 79, 87, 88, 89, 92, 93, 98], [3, 8, 10, 14, 21, 25, 33, 35, 37, 37, 43, 44, 45, 50, 59, 62, 63, 75, 79, 79, 79, 84, 85, 86, 87, 87, 88, 90, 91, 96], [2, 4, 7, 12, 13, 18, 23, 23, 28, 29, 32, 34, 37, 37, 37, 38, 41, 44, 45, 47, 48, 49, 59, 64, 72, 75, 87, 92, 93, 98], [2, 4, 5, 5, 11, 14, 18, 23, 24, 27, 32, 35, 35, 37, 39, 40, 45, 48, 49, 52, 60, 66, 68, 71, 72, 74, 78, 81, 91, 92], [4, 4, 4, 6, 11, 18, 20, 23, 24, 29, 32, 33, 37, 40, 42, 47, 51, 52, 58, 59, 62, 67, 68, 75, 77, 78, 80, 85, 89, 95], [5, 5, 19, 21, 22, 23, 29, 30, 32, 39, 42, 42, 44, 44, 45, 46, 52, 55, 59, 63, 65, 76, 78, 80, 81, 82, 84, 93, 94, 97], [3, 4, 6, 8, 10, 15, 15, 17, 27, 28, 34, 36, 39, 42, 53, 54, 59, 63, 65, 66, 70, 71, 72, 80, 80, 91, 92, 94, 95, 99], [1, 7, 12, 13, 16, 25, 32, 32, 36, 46, 46, 49, 52, 55, 61, 61, 67, 68, 69, 72, 74, 76, 77, 78, 79, 81, 85, 90, 90, 92], [2, 12, 12, 13, 18, 20, 25, 28, 31, 31, 34, 36, 38, 39, 42, 43, 44, 47, 54, 60, 75, 76, 77, 80, 82, 83, 86, 90, 91, 91], [3, 8, 9, 11, 12, 14, 14, 14, 19, 25, 27, 29, 43, 45, 48, 50, 50, 56, 58, 61, 63, 65, 68, 71, 73, 81, 83, 83, 86, 93], [11, 15, 15, 15, 15, 18, 28, 29, 33, 33, 36, 43, 44, 48, 50, 50, 53, 55, 59, 59, 60, 61, 62, 63, 75, 78, 81, 82, 87, 94], [4, 7, 8, 10, 11, 12, 19, 24, 31, 36, 36, 37, 40, 41, 46, 48, 49, 51, 57, 62, 73, 75, 78, 81, 82, 86, 86, 91, 97, 97], [5, 5, 7, 8, 10, 14, 15, 17, 19, 21, 22, 23, 31, 34, 36, 43, 46, 58, 60, 72, 72, 75, 77, 81, 83, 84, 86, 91, 96, 98], [6, 10, 13, 15, 22, 27, 28, 29, 30, 31, 32, 35, 35, 36, 37, 39, 39, 43, 44, 47, 55, 68, 68, 69, 77, 83, 94, 94, 98, 99], [4, 4, 5, 6, 6, 10, 18, 27, 28, 29, 31, 33, 34, 41, 43, 44, 54, 56, 63, 74, 76, 77, 80, 80, 83, 89, 89, 90, 98, 99], [2, 7, 15, 19, 23, 23, 36, 41, 44, 46, 47, 49, 53, 58, 58, 60, 60, 66, 70, 73, 76, 77, 78, 80, 80, 88, 88, 91, 93, 94], [3, 3, 9, 9, 10, 13, 15, 19, 20, 23, 25, 33, 36, 37, 47, 54, 58, 60, 60, 65, 71, 73, 81, 88, 89, 90, 92, 94, 94, 96], [6, 7, 11, 19, 22, 27, 27, 31, 31, 33, 34, 44, 46, 47, 47, 48, 49, 53, 53, 56, 60, 60, 70, 72, 79, 80, 86, 93, 94, 96], [2, 7, 7, 7, 8, 10, 13, 15, 17, 18, 27, 27, 30, 33, 33, 34, 37, 41, 43, 47, 55, 55, 59, 71, 71, 75, 78, 78, 84, 85], [5, 6, 7, 7, 14, 21, 24, 26, 29, 31, 32, 34, 40, 42, 43, 45, 46, 53, 57, 58, 67, 73, 74, 77, 81, 85, 88, 91, 91, 92]],29,), ([[62, 44, 46, 46, -20, -40, 24, 42, -66, -90, 62, -98, 60], [62, 88, -38, -30, 44, -40, 70, -70, 96, 12, 20, -46, -96], [48, 28, -90, 82, 36, -74, 62, 70, -54, 94, 0, 58, 56], [46, -26, -40, 86, -54, -32, 28, 10, 42, -82, -92, 32, 82], [-34, -36, -12, -26, 82, 84, 34, 20, 18, -28, -2, 2, -84], [0, -18, -24, 72, 56, 58, 10, 36, -64, 30, 28, -76, -18], [-16, 20, 0, 62, 66, -28, -4, 42, 46, -84, -50, -86, -84], [76, 62, 52, -38, -76, 14, 32, -76, -46, -8, -86, 22, 16], [16, -74, 6, 30, -2, -30, 88, 90, -66, 44, 34, -80, -32], [72, -92, 92, -42, -8, 50, -8, 54, 18, 22, 36, 32, -32], [72, -90, -82, -60, -58, -66, -76, 84, 64, 34, -90, 20, 6], [4, 56, -4, 80, -62, -66, 8, 36, -30, 76, -18, -74, -34], [-70, 26, -70, -38, -44, -80, 14, 42, -34, -86, -90, 80, 60]],9,), ([[0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1, 1, 1]],4,), ([[89, 8, 34, 49, 96], [58, 75, 47, 25, 3], [45, 52, 96, 99, 96], [34, 69, 92, 92, 8], [27, 80, 63, 82, 25]],3,), ([[-98, -94, -92, -86, -86, -86, -84, -78, -76, -70, -68, -66, -64, -58, -56, -52, -42, -40, -38, -38, -36, -32, -30, -24, -20, -12, -8, 4, 4, 6, 8, 12, 18, 22, 26, 30, 32, 56, 58, 72, 76, 78, 80, 82, 88, 94, 96, 98], [-94, -94, -92, -84, -84, -82, -80, -80, -80, -78, -78, -76, -74, -68, -64, -64, -58, -54, -48, -46, -40, -38, -36, -30, -22, -22, -12, -12, -6, -2, 2, 4, 6, 22, 22, 22, 24, 24, 24, 24, 26, 42, 44, 50, 52, 54, 66, 80], [-98, -92, -92, -84, -80, -76, -76, -70, -64, -60, -60, -52, -48, -48, -46, -46, -36, -32, -30, -24, -22, -16, -14, -8, -8, -4, -2, 0, 2, 2, 2, 8, 10, 12, 22, 32, 38, 38, 40, 48, 64, 68, 76, 78, 78, 86, 96, 96], [-98, -96, -88, -86, -78, -78, -70, -68, -62, -60, -58, -42, -38, -38, -38, -36, -36, -32, -28, -26, -24, -12, -10, -4, 2, 12, 12, 18, 26, 32, 34, 36, 38, 44, 44, 50, 52, 54, 54, 56, 56, 58, 70, 74, 76, 82, 86, 90], [-98, -96, -96, -94, -90, -90, -90, -86, -82, -78, -76, -74, -72, -68, -66, -60, -52, -46, -44, -44, -38, -38, -34, -32, -22, -20, -18, -14, 8, 8, 12, 12, 12, 16, 20, 38, 40, 44, 52, 76, 78, 80, 82, 86, 90, 90, 96, 98], [-88, -84, -84, -80, -78, -70, -68, -66, -62, -62, -54, -52, -48, -42, -42, -40, -32, -30, -26, -26, -24, -24, -14, -6, -4, -2, -2, 4, 4, 8, 22, 24, 40, 42, 52, 52, 56, 56, 58, 64, 72, 72, 74, 74, 86, 92, 96, 98], [-98, -98, -92, -82, -76, -72, -68, -66, -64, -62, -56, -50, -48, -46, -46, -40, -40, -40, -38, -28, -28, -24, -22, -20, -20, -10, -6, 4, 6, 10, 12, 26, 32, 38, 38, 40, 42, 56, 60, 64, 64, 72, 72, 76, 84, 90, 94, 98], [-98, -86, -72, -72, -66, -66, -64, -58, -56, -54, -54, -50, -44, -44, -36, -32, -30, -28, -26, -18, -14, -6, -4, 6, 6, 10, 10, 14, 22, 28, 38, 40, 46, 46, 50, 52, 54, 56, 60, 68, 68, 72, 76, 90, 90, 92, 92, 98], [-90, -86, -86, -84, -76, -74, -70, -66, -58, -58, -54, -50, -48, -44, -38, -38, -36, -34, -30, -22, -22, -8, -6, 4, 6, 6, 6, 8, 10, 24, 24, 28, 32, 32, 32, 36, 44, 48, 48, 50, 52, 64, 70, 74, 76, 92, 94, 96], [-96, -94, -84, -76, -76, -70, -68, -66, -56, -50, -50, -48, -46, -42, -42, -40, -40, -38, -38, -36, -36, -34, -30, -24, -22, -6, -4, -2, 2, 4, 10, 12, 16, 24, 28, 32, 38, 46, 50, 56, 56, 62, 64, 66, 74, 74, 98, 98], [-98, -96, -92, -88, -88, -84, -82, -78, -68, -66, -54, -52, -52, -50, -44, -40, -40, -38, -34, -34, -30, -26, -26, -24, -18, -14, -10, 4, 6, 6, 16, 20, 24, 26, 26, 32, 36, 38, 56, 66, 70, 78, 78, 84, 86, 88, 88, 90], [-94, -90, -86, -86, -86, -86, -84, -82, -78, -78, -76, -72, -68, -64, -64, -62, -46, -42, -42, -28, -26, -18, -16, -10, -8, -2, 0, 10, 10, 12, 18, 18, 26, 26, 32, 34, 34, 40, 50, 54, 56, 58, 62, 66, 66, 82, 84, 94], [-98, -94, -88, -86, -84, -80, -80, -78, -78, -74, -72, -72, -70, -70, -68, -66, -66, -64, -50, -44, -28, -24, -16, -6, -4, 0, 2, 8, 12, 22, 26, 32, 38, 38, 50, 54, 58, 58, 64, 64, 66, 70, 78, 86, 88, 90, 96, 98], [-96, -94, -90, -82, -78, -76, -76, -72, -64, -62, -54, -52, -50, -46, -44, -36, -30, -28, -28, -28, -22, -14, -12, 0, 0, 2, 6, 6, 10, 18, 22, 22, 24, 28, 28, 30, 34, 36, 36, 42, 46, 48, 54, 66, 72, 76, 86, 96], [-98, -96, -92, -92, -90, -88, -86, -82, -78, -70, -68, -66, -60, -58, -48, -48, -46, -30, -26, -22, -20, -16, -12, -8, -4, -4, 4, 16, 22, 32, 34, 34, 36, 36, 40, 52, 60, 62, 64, 66, 66, 74, 74, 78, 82, 82, 86, 94], [-92, -90, -88, -84, -82, -80, -78, -76, -74, -60, -56, -48, -48, -48, -48, -42, -38, -38, -30, -28, -28, -26, -12, -12, -10, -10, -2, 14, 16, 22, 26, 34, 42, 44, 52, 54, 56, 58, 58, 60, 62, 66, 70, 82, 84, 90, 94, 96], [-96, -92, -92, -84, -80, -76, -74, -74, -72, -70, -66, -66, -62, -60, -58, -56, -56, -50, -36, -34, -26, -10, 2, 2, 10, 10, 10, 10, 12, 18, 22, 22, 34, 34, 40, 60, 62, 62, 68, 72, 76, 78, 82, 82, 82, 82, 94, 96], [-96, -96, -88, -84, -78, -72, -68, -62, -56, -56, -52, -38, -32, -24, -20, -18, -18, -16, -10, -6, 8, 8, 12, 18, 24, 24, 26, 28, 30, 30, 32, 32, 56, 62, 64, 66, 66, 72, 74, 74, 78, 84, 84, 86, 88, 92, 92, 98], [-92, -86, -78, -68, -68, -68, -64, -58, -56, -48, -44, -38, -36, -34, -26, -22, -20, -18, -8, -6, 0, 2, 4, 12, 12, 18, 20, 22, 30, 32, 36, 38, 42, 44, 46, 50, 50, 52, 56, 58, 62, 64, 68, 70, 70, 82, 90, 98], [-94, -92, -92, -90, -88, -84, -80, -76, -74, -72, -72, -68, -62, -62, -56, -54, -50, -44, -42, -42, -30, -20, -16, -6, -6, 12, 14, 16, 18, 30, 30, 40, 42, 44, 54, 58, 58, 68, 74, 74, 80, 84, 84, 86, 88, 94, 96, 96], [-90, -86, -84, -84, -78, -78, -70, -70, -64, -56, -52, -50, -48, -48, -48, -46, -42, -40, -40, -30, -30, -28, -24, -22, -18, -16, -14, -6, -2, 4, 10, 12, 14, 14, 20, 26, 32, 44, 58, 64, 68, 68, 74, 76, 76, 82, 86, 88], [-98, -84, -80, -80, -78, -78, -78, -76, -68, -62, -56, -50, -34, -30, -30, -12, -8, -4, 2, 8, 10, 12, 14, 22, 24, 26, 36, 38, 38, 44, 46, 48, 56, 58, 62, 64, 64, 66, 66, 70, 70, 74, 78, 82, 88, 90, 94, 96], [-96, -96, -96, -96, -94, -94, -90, -86, -84, -80, -78, -74, -64, -60, -56, -54, -42, -38, -38, -38, -36, -34, -18, -16, -14, -14, -10, -10, -10, -6, -4, 8, 14, 20, 32, 42, 44, 48, 54, 54, 56, 70, 70, 72, 74, 80, 84, 94], [-96, -94, -86, -84, -78, -76, -70, -66, -62, -60, -56, -56, -54, -54, -52, -52, -50, -46, -46, -34, -32, -32, -28, -16, -12, -6, 0, 16, 18, 18, 20, 20, 28, 34, 38, 40, 42, 42, 52, 56, 62, 66, 66, 70, 82, 84, 88, 98], [-86, -84, -80, -78, -62, -60, -58, -56, -54, -52, -48, -44, -40, -38, -38, -26, -26, -24, -24, -18, -10, -6, 2, 8, 12, 16, 22, 26, 32, 36, 42, 44, 46, 48, 52, 52, 52, 62, 66, 70, 78, 78, 78, 80, 84, 90, 92, 92], [-98, -96, -88, -86, -82, -78, -78, -72, -72, -70, -64, -64, -60, -58, -54, -52, -46, -42, -30, -18, -14, -2, 2, 2, 6, 12, 20, 24, 24, 28, 32, 38, 38, 48, 54, 58, 60, 66, 68, 70, 70, 74, 78, 80, 82, 84, 86, 90], [-98, -88, -82, -82, -76, -76, -74, -70, -70, -68, -66, -64, -62, -58, -56, -52, -40, -38, -38, -38, -38, -36, -30, -26, -26, -12, -2, 4, 6, 16, 20, 24, 26, 26, 28, 34, 44, 50, 60, 68, 72, 74, 78, 84, 84, 88, 90, 90], [-98, -98, -96, -94, -88, -88, -86, -82, -66, -64, -62, -62, -40, -38, -34, -20, -14, -12, -10, -8, 0, 6, 10, 10, 12, 18, 22, 26, 26, 28, 32, 36, 40, 44, 44, 46, 64, 68, 70, 72, 74, 78, 80, 82, 82, 82, 92, 96], [-94, -94, -92, -88, -88, -84, -82, -78, -78, -76, -72, -64, -60, -56, -54, -54, -50, -48, -46, -42, -32, -28, -28, -24, -22, -22, -16, -14, -12, -12, 4, 10, 16, 16, 16, 28, 30, 40, 48, 56, 62, 64, 68, 76, 88, 90, 92, 98], [-94, -90, -88, -80, -76, -76, -76, -76, -72, -72, -68, -68, -68, -68, -66, -64, -62, -62, -54, -52, -46, -44, -36, -34, -20, -20, -16, -16, -10, -8, 0, 4, 22, 24, 28, 36, 38, 44, 50, 52, 60, 64, 68, 72, 76, 84, 86, 88], [-98, -98, -96, -94, -92, -80, -74, -72, -68, -68, -66, -64, -64, -62, -54, -52, -52, -28, -28, -28, -20, -10, 2, 6, 6, 14, 16, 16, 24, 28, 28, 32, 32, 36, 38, 44, 44, 46, 50, 58, 64, 68, 78, 86, 90, 90, 96, 98], [-96, -92, -80, -78, -68, -56, -54, -54, -44, -44, -36, -34, -34, -32, -30, -26, -22, -12, -8, -2, -2, -2, 6, 8, 8, 20, 20, 24, 28, 32, 36, 36, 38, 40, 42, 44, 44, 46, 48, 52, 54, 56, 60, 68, 70, 76, 80, 86], [-96, -86, -82, -82, -78, -76, -74, -68, -62, -54, -50, -48, -40, -38, -36, -34, -32, -26, -14, -12, -12, -6, -4, 0, 8, 10, 14, 20, 20, 26, 28, 40, 44, 46, 48, 56, 58, 60, 62, 66, 68, 76, 78, 86, 88, 88, 90, 94], [-98, -96, -86, -86, -84, -76, -76, -72, -72, -70, -64, -62, -58, -58, -54, -48, -46, -42, -32, -28, -28, -26, -24, -20, -14, 0, 0, 0, 0, 2, 10, 14, 18, 48, 50, 50, 52, 56, 58, 60, 62, 68, 76, 82, 86, 88, 94, 94], [-96, -92, -86, -82, -82, -80, -80, -78, -76, -74, -72, -62, -62, -56, -56, -50, -40, -30, -28, -18, -18, -12, -10, 0, 4, 10, 12, 12, 16, 18, 18, 18, 22, 30, 34, 42, 68, 74, 82, 86, 86, 90, 90, 90, 92, 92, 94, 94], [-92, -90, -88, -82, -82, -80, -74, -70, -66, -60, -58, -54, -48, -44, -40, -38, -32, -30, -26, -4, 2, 2, 10, 16, 18, 26, 30, 32, 32, 54, 56, 56, 58, 60, 62, 64, 64, 66, 72, 76, 78, 78, 78, 80, 80, 82, 86, 92], [-82, -82, -76, -74, -70, -66, -62, -62, -56, -54, -46, -46, -42, -36, -32, -30, -30, -26, -24, -22, -20, -10, -8, 4, 8, 14, 20, 22, 26, 36, 38, 46, 46, 46, 50, 50, 52, 54, 54, 58, 68, 76, 80, 84, 86, 86, 90, 98], [-98, -92, -92, -82, -78, -76, -62, -56, -54, -50, -50, -48, -48, -46, -44, -44, -34, -26, -24, -20, -16, -2, 16, 16, 22, 28, 28, 30, 36, 36, 38, 38, 40, 42, 42, 44, 50, 56, 56, 60, 62, 74, 78, 90, 92, 94, 96, 98], [-96, -92, -92, -86, -84, -74, -56, -54, -50, -42, -38, -36, -30, -28, -24, -22, -14, -10, -10, -10, -8, -8, 0, 4, 8, 8, 10, 18, 24, 24, 30, 30, 34, 38, 38, 42, 44, 44, 50, 54, 54, 66, 72, 74, 78, 84, 92, 98], [-90, -88, -80, -70, -56, -56, -54, -54, -50, -44, -44, -42, -40, -38, -26, -22, -22, -16, -14, -8, 0, 2, 18, 20, 34, 36, 36, 40, 42, 44, 46, 46, 48, 54, 54, 54, 56, 68, 68, 72, 72, 72, 76, 84, 86, 90, 92, 96], [-98, -96, -94, -86, -82, -76, -76, -70, -70, -68, -64, -48, -38, -38, -36, -28, -28, -26, -20, -18, -6, -2, -2, 2, 4, 6, 8, 8, 12, 12, 14, 16, 26, 30, 30, 34, 44, 44, 48, 48, 56, 72, 80, 80, 84, 84, 92, 94], [-90, -88, -84, -74, -74, -72, -70, -70, -68, -68, -64, -56, -52, -50, -40, -38, -32, -28, -22, -14, -14, -12, -8, -4, -2, 8, 10, 14, 14, 18, 22, 24, 30, 32, 36, 40, 58, 62, 64, 64, 64, 68, 72, 74, 82, 94, 98, 98], [-98, -92, -88, -80, -76, -70, -70, -66, -58, -56, -56, -40, -32, -26, -18, -6, -4, -2, 0, 0, 0, 2, 2, 6, 18, 20, 26, 32, 46, 46, 48, 48, 48, 52, 66, 68, 68, 68, 70, 70, 82, 82, 84, 86, 92, 96, 96, 98], [-98, -96, -92, -92, -92, -82, -72, -68, -66, -62, -46, -44, -44, -42, -38, -34, -32, -26, -26, -16, -12, -12, -10, -6, -6, -2, 0, 0, 4, 10, 12, 12, 14, 30, 36, 42, 46, 54, 58, 58, 66, 68, 68, 70, 90, 92, 96, 98], [-92, -86, -76, -76, -76, -72, -72, -68, -68, -58, -48, -40, -40, -36, -36, -26, -18, -14, -12, -10, -8, -8, 2, 8, 12, 16, 20, 24, 26, 30, 30, 34, 42, 42, 46, 56, 60, 62, 66, 72, 78, 78, 82, 82, 88, 90, 92, 92], [-92, -90, -90, -88, -84, -78, -70, -64, -60, -54, -42, -36, -34, -32, -30, -20, -14, -10, -8, -2, 0, 8, 10, 10, 20, 24, 28, 32, 42, 42, 42, 50, 54, 56, 60, 60, 60, 68, 68, 72, 78, 78, 86, 86, 92, 92, 98, 98], [-98, -98, -96, -96, -94, -90, -88, -86, -80, -78, -76, -72, -58, -52, -48, -34, -34, -28, -28, -24, -24, -18, -16, -12, -8, -8, -6, 8, 10, 12, 12, 12, 12, 26, 30, 30, 38, 52, 52, 64, 68, 72, 74, 80, 80, 82, 88, 90], [-92, -90, -82, -80, -72, -66, -52, -44, -44, -42, -42, -36, -34, -32, -26, -24, -22, -20, -18, -18, -16, -16, -16, -2, 2, 4, 8, 10, 16, 22, 24, 36, 38, 40, 46, 50, 56, 58, 64, 66, 74, 74, 84, 84, 88, 92, 96, 98]],28,), ([[0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1], [1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0], [0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1], [1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0], [1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0], [0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1], [0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1], [1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1], [0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0], [1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0], [1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1], [0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0], [0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1], [0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1], [0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0], [0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0], [1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0], [1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1], [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1], [0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1], [1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0]],26,), ([[1, 3, 3, 4, 4, 5, 8, 11, 13, 15, 16, 18, 20, 21, 24, 25, 25, 35, 36, 37, 39, 40, 40, 41, 41, 42, 42, 44, 44, 44, 45, 47, 49, 54, 61, 62, 64, 64, 70, 72, 82, 85, 87, 92, 93, 93, 94, 95], [1, 2, 2, 3, 4, 5, 5, 6, 8, 8, 9, 11, 15, 16, 19, 20, 20, 22, 22, 25, 33, 36, 37, 39, 40, 41, 41, 44, 54, 60, 62, 65, 67, 68, 68, 70, 72, 77, 77, 78, 78, 79, 85, 86, 87, 88, 93, 99], [1, 1, 1, 1, 3, 5, 6, 7, 7, 10, 12, 13, 13, 15, 17, 20, 21, 21, 22, 25, 31, 33, 37, 40, 41, 41, 46, 50, 53, 54, 55, 57, 61, 63, 64, 65, 68, 69, 76, 76, 81, 81, 82, 82, 84, 87, 89, 90], [1, 1, 1, 1, 4, 6, 19, 19, 19, 20, 21, 21, 22, 22, 23, 23, 25, 25, 26, 26, 29, 30, 34, 34, 35, 37, 48, 48, 50, 52, 59, 60, 62, 63, 64, 66, 68, 68, 75, 85, 88, 89, 91, 92, 94, 95, 97, 99], [2, 3, 7, 12, 15, 16, 18, 20, 20, 23, 24, 27, 29, 31, 33, 36, 36, 37, 38, 44, 47, 52, 52, 54, 55, 61, 62, 62, 64, 66, 66, 73, 74, 75, 76, 80, 81, 81, 83, 83, 84, 87, 87, 89, 92, 92, 96, 99], [1, 4, 4, 5, 6, 8, 12, 12, 14, 16, 21, 24, 24, 27, 29, 34, 35, 39, 41, 44, 44, 46, 48, 50, 52, 52, 53, 56, 60, 62, 64, 67, 72, 77, 78, 80, 81, 83, 84, 84, 85, 88, 91, 93, 93, 94, 94, 95], [3, 3, 4, 11, 11, 12, 15, 15, 17, 17, 18, 20, 24, 24, 27, 27, 29, 32, 35, 37, 39, 39, 41, 43, 43, 44, 48, 49, 53, 60, 69, 70, 73, 74, 75, 76, 76, 84, 85, 85, 85, 87, 87, 89, 90, 91, 93, 93], [1, 11, 11, 12, 15, 15, 16, 16, 17, 17, 18, 19, 20, 23, 27, 27, 31, 32, 32, 35, 37, 39, 39, 41, 43, 45, 47, 49, 49, 49, 56, 60, 61, 64, 67, 71, 73, 78, 79, 79, 81, 82, 83, 85, 87, 89, 92, 98], [5, 6, 9, 13, 14, 16, 17, 20, 20, 22, 22, 23, 28, 29, 29, 30, 32, 33, 36, 37, 45, 47, 49, 49, 50, 50, 52, 56, 60, 62, 65, 66, 69, 70, 71, 77, 78, 78, 80, 82, 83, 86, 86, 88, 88, 90, 90, 99], [3, 11, 12, 13, 14, 14, 15, 19, 19, 20, 26, 27, 28, 31, 32, 32, 32, 35, 35, 39, 39, 42, 43, 49, 54, 55, 57, 58, 59, 60, 61, 62, 62, 65, 65, 67, 73, 74, 81, 82, 83, 86, 88, 88, 93, 95, 95, 97], [1, 3, 3, 5, 7, 11, 17, 20, 20, 21, 21, 23, 24, 25, 26, 26, 30, 32, 35, 37, 38, 39, 42, 44, 47, 47, 48, 49, 51, 57, 57, 59, 60, 61, 62, 63, 66, 69, 70, 73, 78, 80, 84, 84, 89, 92, 96, 97], [1, 1, 2, 11, 12, 13, 15, 17, 19, 21, 22, 24, 27, 28, 28, 29, 30, 34, 39, 40, 40, 44, 45, 48, 57, 58, 58, 59, 61, 63, 63, 64, 66, 66, 68, 69, 70, 71, 74, 78, 79, 82, 84, 86, 89, 90, 94, 97], [2, 3, 7, 10, 10, 12, 13, 13, 17, 17, 19, 21, 36, 47, 48, 48, 51, 51, 52, 55, 57, 61, 61, 61, 65, 70, 71, 73, 74, 74, 75, 75, 76, 78, 79, 80, 80, 85, 86, 87, 87, 89, 91, 94, 95, 97, 97, 97], [1, 2, 2, 8, 9, 9, 9, 14, 16, 17, 23, 24, 27, 29, 30, 30, 34, 35, 36, 43, 44, 44, 47, 49, 50, 54, 56, 57, 58, 63, 67, 68, 69, 70, 72, 76, 77, 80, 81, 84, 84, 86, 88, 90, 93, 96, 96, 96], [2, 3, 3, 5, 5, 7, 7, 11, 18, 19, 19, 20, 23, 24, 27, 27, 28, 30, 30, 36, 38, 39, 40, 48, 50, 51, 53, 57, 57, 66, 67, 68, 73, 77, 78, 79, 82, 84, 85, 87, 88, 89, 95, 96, 97, 98, 99, 99], [3, 8, 10, 10, 12, 13, 13, 15, 16, 16, 17, 21, 21, 22, 23, 24, 26, 26, 27, 29, 32, 34, 35, 37, 42, 42, 52, 54, 61, 61, 65, 65, 66, 70, 73, 74, 76, 79, 83, 83, 85, 89, 91, 93, 94, 96, 97, 97], [3, 5, 6, 7, 9, 10, 13, 16, 16, 19, 23, 24, 24, 26, 28, 29, 30, 32, 33, 36, 37, 37, 41, 41, 41, 42, 42, 44, 45, 49, 50, 52, 55, 57, 58, 60, 61, 63, 75, 77, 77, 79, 80, 81, 86, 89, 94, 99], [1, 10, 13, 14, 15, 17, 18, 20, 21, 22, 23, 25, 26, 28, 32, 37, 39, 44, 46, 47, 47, 47, 47, 50, 51, 52, 55, 55, 58, 61, 69, 72, 73, 77, 77, 78, 80, 81, 82, 84, 88, 91, 93, 94, 95, 96, 97, 98], [1, 5, 5, 13, 13, 17, 26, 28, 30, 32, 34, 41, 43, 44, 45, 45, 46, 46, 49, 52, 53, 56, 57, 61, 61, 62, 63, 63, 63, 64, 65, 67, 69, 70, 73, 76, 77, 80, 80, 81, 82, 87, 87, 88, 89, 89, 93, 96], [5, 11, 12, 12, 18, 19, 19, 22, 24, 26, 26, 26, 30, 32, 33, 35, 35, 36, 38, 39, 42, 44, 46, 48, 52, 56, 57, 58, 59, 65, 65, 66, 67, 67, 68, 70, 73, 73, 75, 76, 77, 78, 80, 83, 84, 88, 92, 99], [5, 6, 9, 13, 17, 20, 20, 21, 22, 24, 25, 26, 30, 32, 33, 36, 37, 38, 38, 40, 44, 45, 48, 53, 55, 58, 58, 58, 59, 61, 63, 63, 63, 65, 67, 72, 75, 75, 75, 77, 77, 77, 79, 82, 88, 93, 97, 97], [9, 13, 14, 16, 17, 18, 21, 22, 22, 23, 24, 25, 33, 37, 40, 41, 42, 46, 49, 49, 51, 54, 57, 58, 58, 60, 67, 71, 73, 74, 74, 75, 77, 78, 80, 82, 85, 85, 86, 86, 86, 87, 91, 92, 93, 95, 97, 98], [1, 3, 10, 11, 14, 18, 18, 19, 23, 24, 26, 28, 33, 36, 37, 42, 42, 47, 47, 48, 48, 52, 53, 56, 57, 59, 61, 63, 63, 64, 65, 67, 69, 71, 75, 77, 78, 79, 83, 83, 83, 85, 86, 86, 92, 96, 97, 97], [3, 5, 6, 7, 7, 9, 13, 13, 18, 25, 27, 28, 29, 30, 32, 34, 37, 43, 44, 51, 52, 53, 54, 59, 63, 63, 64, 66, 68, 70, 70, 72, 72, 73, 77, 78, 80, 82, 83, 83, 84, 85, 85, 93, 95, 97, 99, 99], [4, 6, 7, 9, 9, 20, 20, 22, 31, 33, 34, 35, 35, 38, 40, 41, 42, 42, 44, 46, 47, 50, 52, 54, 57, 58, 60, 61, 62, 63, 63, 64, 65, 70, 72, 74, 80, 81, 87, 87, 88, 88, 92, 92, 95, 99, 99, 99], [3, 5, 9, 10, 10, 15, 18, 20, 21, 21, 23, 25, 28, 29, 37, 38, 40, 40, 40, 46, 51, 53, 55, 57, 59, 59, 60, 67, 68, 71, 72, 73, 75, 76, 79, 79, 81, 83, 86, 87, 88, 90, 90, 90, 92, 95, 96, 98], [5, 7, 8, 9, 9, 12, 14, 16, 18, 18, 18, 24, 25, 26, 28, 28, 29, 30, 32, 37, 38, 44, 44, 45, 46, 48, 51, 55, 55, 56, 58, 58, 62, 63, 64, 67, 71, 74, 76, 81, 86, 87, 88, 90, 90, 91, 95, 97], [4, 5, 13, 13, 16, 19, 19, 20, 22, 26, 27, 28, 30, 30, 31, 32, 33, 39, 39, 41, 41, 43, 45, 49, 50, 51, 64, 66, 67, 71, 73, 75, 78, 78, 79, 82, 84, 86, 87, 87, 88, 90, 91, 91, 92, 93, 96, 97], [2, 3, 5, 11, 16, 20, 21, 21, 25, 29, 31, 34, 36, 36, 37, 37, 38, 38, 44, 45, 46, 54, 60, 60, 61, 61, 67, 67, 67, 70, 71, 72, 76, 77, 79, 80, 83, 84, 84, 87, 87, 88, 90, 92, 93, 98, 99, 99], [1, 2, 5, 5, 12, 13, 13, 15, 18, 19, 24, 25, 25, 26, 28, 29, 30, 33, 34, 35, 35, 36, 36, 37, 38, 42, 44, 49, 50, 53, 58, 58, 58, 60, 65, 67, 72, 75, 77, 78, 81, 84, 88, 88, 90, 91, 94, 97], [5, 5, 6, 7, 8, 11, 11, 13, 19, 23, 25, 35, 37, 40, 40, 46, 47, 48, 48, 49, 51, 58, 60, 61, 63, 65, 67, 68, 71, 72, 76, 77, 79, 80, 84, 87, 88, 88, 89, 90, 92, 94, 94, 96, 96, 97, 97, 99], [1, 2, 3, 3, 5, 5, 13, 18, 19, 23, 31, 32, 34, 35, 36, 38, 39, 40, 42, 49, 51, 53, 54, 56, 62, 64, 64, 64, 66, 67, 67, 67, 69, 72, 74, 74, 80, 81, 83, 83, 84, 85, 91, 91, 94, 95, 96, 98], [1, 2, 5, 9, 10, 11, 14, 15, 16, 16, 24, 27, 30, 32, 35, 37, 39, 39, 40, 43, 48, 49, 50, 54, 57, 57, 58, 59, 60, 63, 63, 64, 64, 64, 68, 70, 76, 77, 80, 82, 85, 87, 88, 90, 91, 94, 94, 97], [10, 14, 15, 17, 17, 18, 22, 22, 28, 29, 29, 32, 32, 34, 36, 36, 38, 39, 40, 42, 43, 45, 45, 45, 54, 54, 55, 55, 59, 63, 67, 68, 74, 75, 75, 77, 77, 79, 80, 86, 86, 87, 87, 87, 87, 88, 93, 96], [2, 2, 5, 5, 9, 14, 17, 17, 20, 22, 22, 23, 25, 32, 32, 32, 35, 37, 37, 38, 39, 40, 47, 52, 55, 56, 60, 62, 63, 63, 63, 63, 64, 69, 73, 73, 74, 75, 77, 79, 82, 85, 88, 88, 90, 92, 92, 93], [3, 4, 4, 6, 8, 10, 12, 15, 16, 16, 17, 20, 21, 21, 24, 26, 27, 28, 28, 29, 30, 32, 38, 44, 49, 49, 50, 54, 59, 59, 61, 62, 64, 64, 65, 70, 70, 71, 72, 72, 73, 74, 75, 80, 83, 90, 92, 92], [4, 5, 9, 9, 13, 15, 16, 16, 17, 23, 25, 27, 28, 29, 29, 37, 37, 40, 43, 45, 49, 50, 51, 51, 53, 55, 56, 60, 61, 61, 64, 67, 68, 73, 74, 75, 76, 77, 79, 80, 85, 89, 89, 89, 91, 97, 97, 97], [2, 5, 9, 10, 11, 11, 11, 15, 15, 16, 18, 20, 21, 22, 23, 24, 40, 41, 47, 47, 48, 48, 49, 51, 53, 53, 54, 55, 61, 63, 65, 68, 70, 73, 74, 74, 77, 78, 79, 80, 82, 83, 85, 85, 86, 87, 98, 99], [1, 12, 13, 14, 16, 17, 18, 19, 20, 21, 23, 23, 27, 27, 30, 34, 36, 36, 38, 42, 43, 43, 44, 44, 48, 49, 53, 54, 55, 61, 62, 66, 67, 72, 72, 73, 73, 77, 78, 78, 86, 88, 89, 92, 93, 98, 98, 99], [1, 2, 4, 6, 9, 13, 13, 13, 17, 18, 20, 28, 28, 30, 32, 33, 37, 38, 42, 42, 44, 47, 50, 52, 53, 54, 56, 57, 59, 60, 66, 68, 70, 71, 72, 74, 76, 77, 79, 83, 83, 84, 85, 90, 94, 94, 97, 99], [1, 1, 9, 9, 10, 10, 11, 12, 12, 15, 21, 22, 24, 24, 25, 26, 26, 27, 30, 31, 34, 35, 40, 41, 43, 47, 47, 53, 53, 53, 57, 60, 61, 61, 64, 66, 68, 71, 71, 79, 82, 82, 84, 88, 88, 90, 96, 99], [4, 4, 6, 6, 6, 6, 8, 9, 11, 11, 14, 16, 21, 25, 29, 37, 38, 40, 44, 45, 50, 51, 51, 53, 53, 56, 57, 58, 59, 59, 63, 69, 71, 72, 74, 76, 79, 80, 82, 83, 87, 93, 94, 96, 98, 98, 99, 99], [2, 2, 5, 9, 10, 12, 13, 13, 13, 13, 19, 22, 27, 32, 33, 34, 34, 38, 41, 45, 46, 47, 48, 50, 51, 51, 52, 54, 54, 57, 57, 60, 61, 74, 76, 76, 77, 79, 81, 83, 85, 92, 93, 95, 96, 97, 99, 99], [4, 4, 4, 6, 7, 9, 14, 15, 16, 18, 19, 23, 27, 37, 38, 39, 40, 41, 41, 44, 45, 51, 52, 53, 54, 54, 56, 57, 58, 59, 60, 63, 65, 65, 69, 79, 85, 85, 88, 89, 90, 90, 93, 94, 95, 95, 95, 99], [6, 6, 7, 9, 10, 10, 11, 15, 15, 16, 16, 17, 19, 20, 24, 28, 30, 31, 31, 33, 35, 37, 38, 40, 40, 43, 44, 44, 45, 46, 48, 58, 59, 62, 72, 73, 74, 80, 82, 82, 83, 85, 88, 90, 91, 91, 91, 96], [2, 2, 2, 2, 3, 4, 5, 12, 12, 15, 23, 23, 24, 24, 29, 35, 36, 38, 40, 41, 47, 47, 48, 49, 51, 54, 56, 57, 60, 62, 63, 64, 70, 75, 75, 76, 77, 80, 82, 83, 87, 90, 91, 91, 92, 93, 94, 94], [3, 4, 4, 7, 8, 9, 11, 12, 15, 19, 21, 22, 23, 24, 28, 28, 31, 37, 37, 37, 39, 48, 52, 52, 55, 55, 55, 57, 61, 66, 72, 75, 76, 77, 79, 83, 84, 84, 84, 88, 90, 92, 93, 94, 98, 98, 98, 99], [2, 5, 7, 11, 13, 15, 27, 29, 29, 31, 35, 38, 41, 42, 44, 44, 46, 47, 49, 52, 52, 53, 53, 53, 54, 54, 55, 56, 58, 60, 61, 61, 63, 69, 72, 72, 77, 77, 79, 80, 84, 84, 86, 87, 90, 92, 92, 93]],44,), ([[28, 84, -76, -76, -28, -42, -78, 6, 40, 70, 48, 92, -6, -34, 62, 34, -14, -64], [48, 6, -22, 44, -32, -26, -18, 94, -2, -80, -20, -64, -50, -18, -28, -96, 66, 48], [-2, 34, 6, -62, -48, 8, 2, -50, -66, 48, 22, -8, 10, 0, 50, -78, -76, -20], [-4, 12, -84, 76, -72, 74, 12, 8, -66, -10, -90, -94, -82, 68, -60, 66, -58, 60], [-34, -90, -52, 26, 58, -48, 78, 84, -34, -64, -64, -24, -34, -46, -2, 0, -70, 54], [4, 96, 36, 98, -62, 90, -50, 52, 52, -50, -34, 20, -26, 84, -14, -82, -72, -94], [38, 12, -48, 6, -18, 64, -58, -22, 60, -54, 86, 48, 16, 38, 50, -42, 24, 6], [-10, -46, -32, -72, -18, 48, 20, -16, 2, 50, -78, -30, -62, 76, 30, 52, 22, -6], [-72, 34, 4, -36, 60, -80, -66, -20, 36, 26, -70, 94, -22, 14, -80, 42, 94, -66], [52, -66, -68, 56, -94, 2, 88, -8, 10, 98, -48, 52, -38, 62, 44, -62, 80, 36], [-70, 16, 56, -40, -4, 12, -16, -52, 4, -14, -32, 20, 66, -94, 36, -78, -74, 0], [64, -62, -12, -34, -24, -94, 98, 30, -30, -28, -24, -22, -50, 28, -74, 36, 40, 50], [-98, 44, 8, 96, -82, -28, -26, 18, -58, -60, -98, 98, 18, -44, 42, 12, -82, 30], [-28, 96, -32, 62, -36, 32, -50, 2, 26, 80, -10, -48, -58, 64, 86, 2, -52, 84], [-76, -78, -46, -54, -34, 60, 84, 84, -24, 10, 40, -16, -42, -32, 14, -94, -88, -4], [28, -74, -28, 58, 40, -34, 52, 14, 10, -74, 94, 2, 84, 6, -28, -90, -50, 62], [-26, -62, -30, -32, 8, -8, -88, 66, -98, 42, -32, 12, 66, 94, -48, -16, 82, -24], [-48, 98, 18, 68, -52, -58, 20, 80, -60, -88, 34, -80, -76, 94, -56, 24, 22, 60]],9,), ([[0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]],5,), ([[93, 9, 33, 88, 35, 75, 39, 77, 87, 25], [80, 56, 48, 85, 10, 41, 83, 99, 59, 28], [41, 66, 51, 62, 30, 40, 40, 69, 62, 15], [3, 24, 41, 63, 48, 61, 48, 47, 56, 76], [8, 78, 18, 84, 23, 69, 65, 46, 66, 80], [69, 22, 65, 12, 19, 22, 55, 62, 51, 48], [17, 13, 28, 67, 5, 60, 15, 81, 44, 46], [29, 68, 96, 49, 43, 68, 77, 20, 18, 64], [49, 42, 12, 89, 94, 79, 36, 8, 28, 86], [60, 49, 38, 80, 58, 5, 46, 98, 75, 2]],5,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
null
HOW_TO_CHECK_IF_A_GIVEN_ARRAY_REPRESENTS_A_BINARY_HEAP
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class HOW_TO_CHECK_IF_A_GIVEN_ARRAY_REPRESENTS_A_BINARY_HEAP{ static boolean f_gold ( int arr [ ] , int i , int n ) { if ( i > ( n - 2 ) / 2 ) { return true ; } if ( arr [ i ] >= arr [ 2 * i + 1 ] && arr [ i ] >= arr [ 2 * i + 2 ] && f_gold ( arr , 2 * i + 1 , n ) && f_gold ( arr , 2 * i + 2 , n ) ) { return true ; } return false ; }
def f_gold ( arr , i , n ) : if i > int ( ( n - 2 ) / 2 ) : return True if ( arr [ i ] >= arr [ 2 * i + 1 ] and arr [ i ] >= arr [ 2 * i + 2 ] and f_gold ( arr , 2 * i + 1 , n ) and f_gold ( arr , 2 * i + 2 , n ) ) : return True return False
using namespace std; bool f_gold ( int arr [ ], int i, int n ) { if ( i > ( n - 2 ) / 2 ) return true; if ( arr [ i ] >= arr [ 2 * i + 1 ] && arr [ i ] >= arr [ 2 * i + 2 ] && f_gold ( arr, 2 * i + 1, n ) && f_gold ( arr, 2 * i + 2, n ) ) return true; return false; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,2,3,5,24,24,25,25,36,37,37,39,42,44,46,50,51,54,56,60,62,70,71,73,75,80,80,85,86,89,91,95,99}); param0.add(new int[]{-44,-58,88,-42,42,-14,-44,42,64,94,-46,-70,34,-10,-46,-52,-6,-78,64,56,74,98,-34,-4,-92,6,-52,-20,78,-72,-40}); 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[]{10,2,1,34,21,37,49,31,70,97,87,50,76,55}); param0.add(new int[]{-94,-84,-82,-66,-64,-62,-56,-38,-24,-24,-4,2,4,4,8,14,16,20,30,34,34,48,58,58,70,76,78,86,88,96,98}); param0.add(new int[]{1,0,1,0,1,1,1,1,1,0,0,0,1,0,1,1,0,0}); param0.add(new int[]{5,20,30,5,10,21,5}); param0.add(new int[]{50,20,30,5,10,21,5}); param0.add(new int[]{50,20,30,5,10,21,5}); param0.add(new int[]{50,20,30,5,10,21,5}); List<Integer> param1 = new ArrayList<>(); param1.add(0); param1.add(0); param1.add(0); param1.add(0); param1.add(29); param1.add(12); param1.add(0); param1.add(0); param1.add(2); param1.add(7); List<Integer> param2 = new ArrayList<>(); param2.add(18); param2.add(27); param2.add(20); param2.add(8); param2.add(26); param2.add(11); param2.add(7); param2.add(7); param2.add(7); param2.add(7); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([1, 2, 3, 5, 24, 24, 25, 25, 36, 37, 37, 39, 42, 44, 46, 50, 51, 54, 56, 60, 62, 70, 71, 73, 75, 80, 80, 85, 86, 89, 91, 95, 99],0,18,), ([-44, -58, 88, -42, 42, -14, -44, 42, 64, 94, -46, -70, 34, -10, -46, -52, -6, -78, 64, 56, 74, 98, -34, -4, -92, 6, -52, -20, 78, -72, -40],0,27,), ([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],0,20,), ([10, 2, 1, 34, 21, 37, 49, 31, 70, 97, 87, 50, 76, 55],0,8,), ([-94, -84, -82, -66, -64, -62, -56, -38, -24, -24, -4, 2, 4, 4, 8, 14, 16, 20, 30, 34, 34, 48, 58, 58, 70, 76, 78, 86, 88, 96, 98],0,26,), ([1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0],12,11,), ([5,20,30,5,10,21,5],0,7), ([50,20,30,5,10,21,5],0,7), ([50,20,30,5,10,21,5],2,7), ([50,20,30,5,10,21,5],4,7), ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{1,2,3,5,24,24,25,25,36,37,37,39,42,44,46,50,51,54,56,60,62,70,71,73,75,80,80,85,86,89,91,95,99},{-44,-58,88,-42,42,-14,-44,42,64,94,-46,-70,34,-10,-46,-52,-6,-78,64,56,74,98,-34,-4,-92,6,-52,-20,78,-72,-40},{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},{10,2,1,34,21,37,49,31,70,97,87,50,76,55},{-94,-84,-82,-66,-64,-62,-56,-38,-24,-24,-4,2,4,4,8,14,16,20,30,34,34,48,58,58,70,76,78,86,88,96,98},{1,0,1,0,1,1,1,1,1,0,0,0,1,0,1,1,0,0},{5,20,30,5,10,21,5},{50,20,30,5,10,21,5},{50,20,30,5,10,21,5},{50,20,30,5,10,21,5}}; vector<int> param1 {0,0,0,0,29,12,0,0,2,7}; vector<int> param2 {18,27,20,8,26,11,7,7,7,7}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i],param2[i]) == f_gold(&param0[i].front(),param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
COMPUTE_NCR_P_SET_1_INTRODUCTION_AND_DYNAMIC_PROGRAMMING_SOLUTION
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COMPUTE_NCR_P_SET_1_INTRODUCTION_AND_DYNAMIC_PROGRAMMING_SOLUTION{ static int f_gold ( int n , int r , int p ) { int C [ ] = new int [ r + 1 ] ; Arrays . fill ( C , 0 ) ; C [ 0 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = Math . min ( i , r ) ; j > 0 ; j -- ) C [ j ] = ( C [ j ] + C [ j - 1 ] ) % p ; } return C [ r ] ; }
def f_gold ( n , r , p ) : C = [ 0 for i in range ( r + 1 ) ] C [ 0 ] = 1 for i in range ( 1 , n + 1 ) : for j in range ( min ( i , r ) , 0 , - 1 ) : C [ j ] = ( C [ j ] + C [ j - 1 ] ) % p return C [ r ]
using namespace std; int f_gold ( int n, int r, int p ) { int C [ r + 1 ]; memset ( C, 0, sizeof ( C ) ); C [ 0 ] = 1; for ( int i = 1; i <= n; i ++ ) { for ( int j = min ( i, r ); j > 0; j -- ) C [ j ] = ( C [ j ] + C [ j - 1 ] ) % p; } return C [ r ]; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(82); param0.add(45); param0.add(44); param0.add(88); param0.add(90); param0.add(98); param0.add(80); param0.add(60); param0.add(52); param0.add(71); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(24); param1.add(68); param1.add(24); param1.add(75); param1.add(55); param1.add(54); param1.add(75); param1.add(73); param1.add(26); List<Integer> param2 = new ArrayList<>(); param2.add(94); param2.add(95); param2.add(61); param2.add(43); param2.add(57); param2.add(43); param2.add(88); param2.add(65); param2.add(86); param2.add(45); 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()); } }
if __name__ == '__main__': param = [ (82,5,94,), (45,24,95,), (44,68,61,), (88,24,43,), (90,75,57,), (98,55,43,), (80,54,88,), (60,75,65,), (52,73,86,), (71,26,45,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {82,45,44,88,90,98,80,60,52,71}; vector<int> param1 {5,24,68,24,75,55,54,75,73,26}; vector<int> param2 {94,95,61,43,57,43,88,65,86,45}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i],param2[i]) == f_gold(param0[i],param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SQUARE_ROOT_OF_AN_INTEGER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SQUARE_ROOT_OF_AN_INTEGER{ static int f_gold ( int x ) { if ( x == 0 || x == 1 ) return x ; int i = 1 , result = 1 ; while ( result <= x ) { i ++ ; result = i * i ; } return i - 1 ; }
def f_gold ( x ) : if ( x == 0 or x == 1 ) : return x i = 1 ; result = 1 while ( result <= x ) : i += 1 result = i * i return i - 1
using namespace std; int f_gold ( int x ) { if ( x == 0 || x == 1 ) return x; int i = 1, result = 1; while ( result <= x ) { i ++; result = i * i; } return i - 1; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(89); param0.add(11); param0.add(14); param0.add(92); param0.add(76); param0.add(63); param0.add(51); param0.add(16); param0.add(83); param0.add(66); 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()); } }
if __name__ == '__main__': param = [ (89,), (11,), (14,), (92,), (76,), (63,), (51,), (16,), (83,), (66,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {89,11,14,92,76,63,51,16,83,66}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
LONGEST_SUBSEQUENCE_DIFFERENCE_ADJACENTS_ONE_SET_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LONGEST_SUBSEQUENCE_DIFFERENCE_ADJACENTS_ONE_SET_2{ static int f_gold ( int [ ] arr , int n ) { HashMap < Integer , Integer > um = new HashMap < Integer , Integer > ( ) ; int longLen = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int len = 0 ; if ( um . containsKey ( arr [ i ] - 1 ) && len < um . get ( arr [ i ] - 1 ) ) len = um . get ( arr [ i ] - 1 ) ; if ( um . containsKey ( arr [ i ] + 1 ) && len < um . get ( arr [ i ] + 1 ) ) len = um . get ( arr [ i ] + 1 ) ; um . put ( arr [ i ] , len + 1 ) ; if ( longLen < um . get ( arr [ i ] ) ) longLen = um . get ( arr [ i ] ) ; } return longLen ; }
null
using namespace std; int f_gold ( int arr [ ], int n ) { unordered_map < int, int > um; int longLen = 0; for ( int i = 0; i < n; i ++ ) { int len = 0; if ( um . find ( arr [ i ] - 1 ) != um . end ( ) && len < um [ arr [ i ] - 1 ] ) len = um [ arr [ i ] - 1 ]; if ( um . find ( arr [ i ] + 1 ) != um . end ( ) && len < um [ arr [ i ] + 1 ] ) len = um [ arr [ i ] + 1 ]; um [ arr [ i ] ] = len + 1; if ( longLen < um [ arr [ i ] ] ) longLen = um [ arr [ i ] ]; } return longLen; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{20,48,58}); param0.add(new int[]{-36,94,-20,-90,-80,88,46,-8,-36,22,70,-16,-48,-54,-82,38,10,-84,12,10,-14,50,12,-28,-64,-38,-84,-62,-56,32,-78,34,-34,48}); param0.add(new int[]{0,0,0}); param0.add(new int[]{50,28,14,52,92,30,30,27,66,77,39,42,28,84,63,55,18,34,57,45,81,38,23,31,9,35,25,39,30,5,28,7,42,42}); param0.add(new int[]{-96,-70,-64,-60,-56,-44,-40,-32,-30,-22,-10,14,26,28,28,38,58,78,80}); param0.add(new int[]{1,0,0,0,1,0,0,1,0,1}); param0.add(new int[]{8,19,30,37,44,46,49,50,51,57,65,67,70,70,76,83,91,92}); param0.add(new int[]{40,62,-6,88,58,66,-40,46,-32,80,22,-30,32,-74,20,-82,-58,-18,30,68,-2,38,-76,-58,22,-22,74}); 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}); param0.add(new int[]{46,6,71,56,21,97,80,67,26,25,79,86,64,84,53,50,29,19,95,58,14,15,63,1,76,64,11,47,9,97,54,27}); List<Integer> param1 = new ArrayList<>(); param1.add(2); param1.add(29); param1.add(1); param1.add(22); param1.add(11); param1.add(8); param1.add(13); param1.add(20); param1.add(12); param1.add(17); 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()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{20,48,58},{-36,94,-20,-90,-80,88,46,-8,-36,22,70,-16,-48,-54,-82,38,10,-84,12,10,-14,50,12,-28,-64,-38,-84,-62,-56,32,-78,34,-34,48},{0,0,0},{50,28,14,52,92,30,30,27,66,77,39,42,28,84,63,55,18,34,57,45,81,38,23,31,9,35,25,39,30,5,28,7,42,42},{-96,-70,-64,-60,-56,-44,-40,-32,-30,-22,-10,14,26,28,28,38,58,78,80},{1,0,0,0,1,0,0,1,0,1},{8,19,30,37,44,46,49,50,51,57,65,67,70,70,76,83,91,92},{40,62,-6,88,58,66,-40,46,-32,80,22,-30,32,-74,20,-82,-58,-18,30,68,-2,38,-76,-58,22,-22,74},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1},{46,6,71,56,21,97,80,67,26,25,79,86,64,84,53,50,29,19,95,58,14,15,63,1,76,64,11,47,9,97,54,27}}; vector<int> param1 {2,29,1,22,11,8,13,20,12,17}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
MAXIMIZE_VOLUME_CUBOID_GIVEN_SUM_SIDES
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMIZE_VOLUME_CUBOID_GIVEN_SUM_SIDES{ static int f_gold ( int s ) { int maxvalue = 0 ; for ( int i = 1 ; i <= s - 2 ; i ++ ) { for ( int j = 1 ; j <= s - 1 ; j ++ ) { int k = s - i - j ; maxvalue = Math . max ( maxvalue , i * j * k ) ; } } return maxvalue ; }
def f_gold(s): maxvalue = 0 i = 1 for i in range(s - 1): j = 1 for j in range(s): k = s - i - j maxvalue = max(maxvalue, i * j * k) return maxvalue
using namespace std; int f_gold ( int s ) { int maxvalue = 0; for ( int i = 1; i <= s - 2; i ++ ) { for ( int j = 1; j <= s - 1; j ++ ) { int k = s - i - j; maxvalue = max ( maxvalue, i * j * k ); } } return maxvalue; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(67); param0.add(48); param0.add(59); param0.add(22); param0.add(14); param0.add(66); param0.add(1); param0.add(75); param0.add(58); param0.add(78); 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()); } }
if __name__ == '__main__': param = [ (67,), (48,), (59,), (22,), (14,), (66,), (1,), (75,), (58,), (78,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success += 1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {67,48,59,22,14,66,1,75,58,78}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
PROGRAM_PRINT_SUM_GIVEN_NTH_TERM_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_PRINT_SUM_GIVEN_NTH_TERM_1{ static int f_gold ( long n ) { return ( int ) Math . pow ( n , 2 ) ; }
import math def f_gold ( n ) : return math.pow ( n , 2 )
using namespace std; int f_gold ( long n ) { return pow ( n, 2 ); }
public static void main(String args[]) { int n_success = 0; List<Long> param0 = new ArrayList<>(); param0.add(42L); param0.add(40L); param0.add(67L); param0.add(73L); param0.add(18L); param0.add(16L); param0.add(74L); param0.add(33L); param0.add(92L); param0.add(22L); 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()); } }
if __name__ == '__main__': param = [ (42,), (40,), (67,), (73,), (18,), (16,), (74,), (33,), (92,), (22,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<long> param0 {42,40,67,73,18,16,74,33,92,22}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
REARRANGE_POSITIVE_AND_NEGATIVE_NUMBERS_PUBLISH
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; class REARRANGE_POSITIVE_AND_NEGATIVE_NUMBERS_PUBLISH{ static void f_gold ( int arr [ ] , int n ) { int i = - 1 , temp = 0 ; for ( int j = 0 ; j < n ; j ++ ) { if ( arr [ j ] < 0 ) { i ++ ; temp = arr [ i ] ; arr [ i ] = arr [ j ] ; arr [ j ] = temp ; } } int pos = i + 1 , neg = 0 ; while ( pos < n && neg < pos && arr [ neg ] < 0 ) { temp = arr [ neg ] ; arr [ neg ] = arr [ pos ] ; arr [ pos ] = temp ; pos ++ ; neg += 2 ; } }
def f_gold ( arr , n ) : i = - 1 for j in range ( n ) : if ( arr [ j ] < 0 ) : i += 1 arr [ i ] , arr [ j ] = arr [ j ] , arr [ i ] pos , neg = i + 1 , 0 while ( pos < n and neg < pos and arr [ neg ] < 0 ) : arr [ neg ] , arr [ pos ] = arr [ pos ] , arr [ neg ] pos += 1 neg += 2
null
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{5,5,6,7,8,10,13,15,15,27,27,29,29,29,29,31,33,33,36,38,38,39,42,47,47,51,51,51,52,53,55,56,57,64,66,66,67,68,70,72,74,78,86,88,94,97,97}); param0.add(new int[]{73,30,55,-5,15,64,-64,-74,-57,-73,-31,48}); param0.add(new int[]{0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{62,82,89,97,60,43,76,68,5,37,72,92,31}); param0.add(new int[]{-99,-89,-71,-60,-59,-54,-49,1,51}); param0.add(new int[]{1,1,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,1,0,0,1,0,0,0,1}); param0.add(new int[]{2,7,17,22,24,25,26,28,29,33,34,38,43,49,51,52,54,59,63,70,71,75,82,88,91,91}); param0.add(new int[]{-51,99,-19,-16,5,77,48,18,-14,-37,89,4,-51,-29,-99,41,79,23,84,-38,-68}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{88,87,59}); List<Integer> param1 = new ArrayList<>(); param1.add(26); param1.add(8); param1.add(6); param1.add(7); param1.add(8); param1.add(21); param1.add(14); param1.add(10); param1.add(44); param1.add(1); List<int [ ]> filled_function_param0 = new ArrayList<>(); filled_function_param0.add(new int[]{5,5,6,7,8,10,13,15,15,27,27,29,29,29,29,31,33,33,36,38,38,39,42,47,47,51,51,51,52,53,55,56,57,64,66,66,67,68,70,72,74,78,86,88,94,97,97}); filled_function_param0.add(new int[]{73,30,55,-5,15,64,-64,-74,-57,-73,-31,48}); filled_function_param0.add(new int[]{0,0,0,1,1,1,1,1,1,1}); filled_function_param0.add(new int[]{62,82,89,97,60,43,76,68,5,37,72,92,31}); filled_function_param0.add(new int[]{-99,-89,-71,-60,-59,-54,-49,1,51}); filled_function_param0.add(new int[]{1,1,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,1,0,0,1,0,0,0,1}); filled_function_param0.add(new int[]{2,7,17,22,24,25,26,28,29,33,34,38,43,49,51,52,54,59,63,70,71,75,82,88,91,91}); filled_function_param0.add(new int[]{-51,99,-19,-16,5,77,48,18,-14,-37,89,4,-51,-29,-99,41,79,23,84,-38,-68}); filled_function_param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); filled_function_param0.add(new int[]{88,87,59}); List<Integer> filled_function_param1 = new ArrayList<>(); filled_function_param1.add(26); filled_function_param1.add(8); filled_function_param1.add(6); filled_function_param1.add(7); filled_function_param1.add(8); filled_function_param1.add(21); filled_function_param1.add(14); filled_function_param1.add(10); filled_function_param1.add(44); filled_function_param1.add(1); 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()); } }
if __name__ == '__main__': param = [ ([5, 5, 6, 7, 8, 10, 13, 15, 15, 27, 27, 29, 29, 29, 29, 31, 33, 33, 36, 38, 38, 39, 42, 47, 47, 51, 51, 51, 52, 53, 55, 56, 57, 64, 66, 66, 67, 68, 70, 72, 74, 78, 86, 88, 94, 97, 97],26,), ([73, 30, 55, -5, 15, 64, -64, -74, -57, -73, -31, 48],8,), ([0, 0, 0, 1, 1, 1, 1, 1, 1, 1],6,), ([62, 82, 89, 97, 60, 43, 76, 68, 5, 37, 72, 92, 31],7,), ([-99, -89, -71, -60, -59, -54, -49, 1, 51],8,), ([1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1],21,), ([2, 7, 17, 22, 24, 25, 26, 28, 29, 33, 34, 38, 43, 49, 51, 52, 54, 59, 63, 70, 71, 75, 82, 88, 91, 91],14,), ([-51, 99, -19, -16, 5, 77, 48, 18, -14, -37, 89, 4, -51, -29, -99, 41, 79, 23, 84, -38, -68],10,), ([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],44,), ([88, 87, 59],1,) ] filled_function_param = [ ([5, 5, 6, 7, 8, 10, 13, 15, 15, 27, 27, 29, 29, 29, 29, 31, 33, 33, 36, 38, 38, 39, 42, 47, 47, 51, 51, 51, 52, 53, 55, 56, 57, 64, 66, 66, 67, 68, 70, 72, 74, 78, 86, 88, 94, 97, 97],26,), ([73, 30, 55, -5, 15, 64, -64, -74, -57, -73, -31, 48],8,), ([0, 0, 0, 1, 1, 1, 1, 1, 1, 1],6,), ([62, 82, 89, 97, 60, 43, 76, 68, 5, 37, 72, 92, 31],7,), ([-99, -89, -71, -60, -59, -54, -49, 1, 51],8,), ([1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1],21,), ([2, 7, 17, 22, 24, 25, 26, 28, 29, 33, 34, 38, 43, 49, 51, 52, 54, 59, 63, 70, 71, 75, 82, 88, 91, 91],14,), ([-51, 99, -19, -16, 5, 77, 48, 18, -14, -37, 89, 4, -51, -29, -99, 41, 79, 23, 84, -38, -68],10,), ([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],44,), ([88, 87, 59],1,) ] n_success = 0 for i, parameters_set in enumerate(param): f_filled(*(filled_function_param[i])) f_gold(*parameters_set) if parameters_set == filled_function_param[i]: n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
null
PARTITION_INTO_TWO_SUBARRAYS_OF_LENGTHS_K_AND_N_K_SUCH_THAT_THE_DIFFERENCE_OF_SUMS_IS_MAXIMUM
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PARTITION_INTO_TWO_SUBARRAYS_OF_LENGTHS_K_AND_N_K_SUCH_THAT_THE_DIFFERENCE_OF_SUMS_IS_MAXIMUM{ static int f_gold ( int arr [ ] , int N , int k ) { int M , S = 0 , S1 = 0 , max_difference = 0 ; for ( int i = 0 ; i < N ; i ++ ) S += arr [ i ] ; int temp ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = i + 1 ; j < N ; j ++ ) { if ( arr [ i ] < arr [ j ] ) { temp = arr [ i ] ; arr [ i ] = arr [ j ] ; arr [ j ] = temp ; } } } M = Math . max ( k , N - k ) ; for ( int i = 0 ; i < M ; i ++ ) S1 += arr [ i ] ; max_difference = S1 - ( S - S1 ) ; return max_difference ; }
null
using namespace std; int f_gold ( int arr [ ], int N, int k ) { int M, S = 0, S1 = 0, max_difference = 0; for ( int i = 0; i < N; i ++ ) S += arr [ i ]; sort ( arr, arr + N, greater < int > ( ) ); M = max ( k, N - k ); for ( int i = 0; i < M; i ++ ) S1 += arr [ i ]; max_difference = S1 - ( S - S1 ); return max_difference; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,5,5,9,9,19,22,24,27,33,39,39,40,41,42,43,44,45,48,52,52,53,53,55,55,56,57,57,60,60,61,62,65,66,67,70,71,72,73,77,78,79,84,87,89,91,95,98}); param0.add(new int[]{-22,-28}); 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}); param0.add(new int[]{63,72,2,94,89,11,95,79,90,9,70,28,25,74,16,36,50,91,38,47,47,13,27,29,31,35}); param0.add(new int[]{-86,-78,-76,-76,-66,-62,-62,-38,-34,-32,-30,-26,-22,-4,-4,2,8,8,10,22,52,52,58,64,66,66,66,70,82,82}); param0.add(new int[]{0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,1,0,1,1,0,0,0,1,0,0,1,0,0}); param0.add(new int[]{1,2,2,9,9,12,13,26,26,33,34,35,51,57,70,79,83}); param0.add(new int[]{98,-72,2,40,-20,-14,42,8,14,-58,-18,-70,-8,-66,-68,72,82,-38,-78,2,-66,-88,-34,52,12,84,72,-28,-34,60,-60,12,-28,-42,22,-66,88,-96}); 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}); param0.add(new int[]{21,85,64,20,4,5,2}); List<Integer> param1 = new ArrayList<>(); param1.add(41); param1.add(1); param1.add(20); param1.add(23); param1.add(29); param1.add(42); param1.add(9); param1.add(28); param1.add(37); param1.add(5); List<Integer> param2 = new ArrayList<>(); param2.add(44); param2.add(1); param2.add(29); param2.add(16); param2.add(24); param2.add(32); param2.add(16); param2.add(28); param2.add(27); param2.add(6); 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()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{1,5,5,9,9,19,22,24,27,33,39,39,40,41,42,43,44,45,48,52,52,53,53,55,55,56,57,57,60,60,61,62,65,66,67,70,71,72,73,77,78,79,84,87,89,91,95,98},{-22,-28},{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},{63,72,2,94,89,11,95,79,90,9,70,28,25,74,16,36,50,91,38,47,47,13,27,29,31,35},{-86,-78,-76,-76,-66,-62,-62,-38,-34,-32,-30,-26,-22,-4,-4,2,8,8,10,22,52,52,58,64,66,66,66,70,82,82},{0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,1,0,1,1,0,0,0,1,0,0,1,0,0},{1,2,2,9,9,12,13,26,26,33,34,35,51,57,70,79,83},{98,-72,2,40,-20,-14,42,8,14,-58,-18,-70,-8,-66,-68,72,82,-38,-78,2,-66,-88,-34,52,12,84,72,-28,-34,60,-60,12,-28,-42,22,-66,88,-96},{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},{21,85,64,20,4,5,2}}; vector<int> param1 {41,1,20,23,29,42,9,28,37,5}; vector<int> param2 {44,1,29,16,24,32,16,28,27,6}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i],param2[i]) == f_gold(&param0[i].front(),param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
GIVEN_A_SORTED_AND_ROTATED_ARRAY_FIND_IF_THERE_IS_A_PAIR_WITH_A_GIVEN_SUM_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class GIVEN_A_SORTED_AND_ROTATED_ARRAY_FIND_IF_THERE_IS_A_PAIR_WITH_A_GIVEN_SUM_1{ static int f_gold ( int arr [ ] , int n , int x ) { int i ; for ( i = 0 ; i < n - 1 ; i ++ ) if ( arr [ i ] > arr [ i + 1 ] ) break ; int l = ( i + 1 ) % n ; int r = i ; int cnt = 0 ; while ( l != r ) { if ( arr [ l ] + arr [ r ] == x ) { cnt ++ ; if ( l == ( r - 1 + n ) % n ) { return cnt ; } l = ( l + 1 ) % n ; r = ( r - 1 + n ) % n ; } else if ( arr [ l ] + arr [ r ] < x ) l = ( l + 1 ) % n ; else r = ( n + r - 1 ) % n ; } return cnt ; }
def f_gold ( arr , n , x ) : for i in range ( n ) : if arr [ i ] > arr [ i + 1 ] : break l = ( i + 1 ) % n r = i cnt = 0 while ( l != r ) : if arr [ l ] + arr [ r ] == x : cnt += 1 if l == ( r - 1 + n ) % n : return cnt l = ( l + 1 ) % n r = ( r - 1 + n ) % n elif arr [ l ] + arr [ r ] < x : l = ( l + 1 ) % n else : r = ( n + r - 1 ) % n return cnt
using namespace std; int f_gold ( int arr [ ], int n, int x ) { int i; for ( i = 0; i < n - 1; i ++ ) if ( arr [ i ] > arr [ i + 1 ] ) break; int l = ( i + 1 ) % n; int r = i; int cnt = 0; while ( l != r ) { if ( arr [ l ] + arr [ r ] == x ) { cnt ++; if ( l == ( r - 1 + n ) % n ) { return cnt; } l = ( l + 1 ) % n; r = ( r - 1 + n ) % n; } else if ( arr [ l ] + arr [ r ] < x ) l = ( l + 1 ) % n; else r = ( n + r - 1 ) % n; } return cnt; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{24,54}); param0.add(new int[]{68,-30,-18,-6,70,-40,86,98,-24,-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}); param0.add(new int[]{84,44,40,45,2,41,52,17,50,41,5,52,48,90,13,55,34,55,94,44,41,2}); param0.add(new int[]{-92,-76,-74,-72,-68,-64,-58,-44,-44,-38,-26,-24,-20,-12,-8,-8,-4,10,10,10,20,20,26,26,28,50,52,54,60,66,72,74,78,78,78,80,86,88}); param0.add(new int[]{1,1,1,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,1,1}); param0.add(new int[]{5,5,15,19,22,24,26,27,28,32,37,39,40,43,49,52,55,56,58,58,59,62,67,68,77,79,79,80,81,87,95,95,96,98,98}); param0.add(new int[]{-98,28,54,44,-98,-70,48,-98,56,4,-18,26,-8,-58,30,82,4,-38,42,64,-28}); 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}); param0.add(new int[]{26,72,74,86,98,86,22,6,95,36,11,82,34,3,50,36,81,94,55,30,62,53,50,95,32,83,9,16}); List<Integer> param1 = new ArrayList<>(); param1.add(1); param1.add(8); param1.add(33); param1.add(18); param1.add(29); param1.add(19); param1.add(28); param1.add(17); param1.add(24); param1.add(19); List<Integer> param2 = new ArrayList<>(); param2.add(1); param2.add(8); param2.add(28); param2.add(16); param2.add(30); param2.add(10); param2.add(34); param2.add(14); param2.add(24); 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()); } }
if __name__ == '__main__': param = [ ([24, 54],1,1,), ([68, -30, -18, -6, 70, -40, 86, 98, -24, -48],8,8,), ([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],33,28,), ([84, 44, 40, 45, 2, 41, 52, 17, 50, 41, 5, 52, 48, 90, 13, 55, 34, 55, 94, 44, 41, 2],18,16,), ([-92, -76, -74, -72, -68, -64, -58, -44, -44, -38, -26, -24, -20, -12, -8, -8, -4, 10, 10, 10, 20, 20, 26, 26, 28, 50, 52, 54, 60, 66, 72, 74, 78, 78, 78, 80, 86, 88],29,30,), ([1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1],19,10,), ([5, 5, 15, 19, 22, 24, 26, 27, 28, 32, 37, 39, 40, 43, 49, 52, 55, 56, 58, 58, 59, 62, 67, 68, 77, 79, 79, 80, 81, 87, 95, 95, 96, 98, 98],28,34,), ([-98, 28, 54, 44, -98, -70, 48, -98, 56, 4, -18, 26, -8, -58, 30, 82, 4, -38, 42, 64, -28],17,14,), ([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],24,24,), ([26, 72, 74, 86, 98, 86, 22, 6, 95, 36, 11, 82, 34, 3, 50, 36, 81, 94, 55, 30, 62, 53, 50, 95, 32, 83, 9, 16],19,16,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{24,54},{68,-30,-18,-6,70,-40,86,98,-24,-48},{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},{84,44,40,45,2,41,52,17,50,41,5,52,48,90,13,55,34,55,94,44,41,2},{-92,-76,-74,-72,-68,-64,-58,-44,-44,-38,-26,-24,-20,-12,-8,-8,-4,10,10,10,20,20,26,26,28,50,52,54,60,66,72,74,78,78,78,80,86,88},{1,1,1,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,1,1},{5,5,15,19,22,24,26,27,28,32,37,39,40,43,49,52,55,56,58,58,59,62,67,68,77,79,79,80,81,87,95,95,96,98,98},{-98,28,54,44,-98,-70,48,-98,56,4,-18,26,-8,-58,30,82,4,-38,42,64,-28},{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},{26,72,74,86,98,86,22,6,95,36,11,82,34,3,50,36,81,94,55,30,62,53,50,95,32,83,9,16}}; vector<int> param1 {1,8,33,18,29,19,28,17,24,19}; vector<int> param2 {1,8,28,16,30,10,34,14,24,16}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i],param2[i]) == f_gold(&param0[i].front(),param1[i],param2[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
PROGRAM_DISTANCE_TWO_POINTS_EARTH
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_DISTANCE_TWO_POINTS_EARTH{ public static double f_gold ( double lat1 , double lat2 , double lon1 , double lon2 ) { lon1 = Math . toRadians ( lon1 ) ; lon2 = Math . toRadians ( lon2 ) ; lat1 = Math . toRadians ( lat1 ) ; lat2 = Math . toRadians ( lat2 ) ; double dlon = lon2 - lon1 ; double dlat = lat2 - lat1 ; double a = Math . pow ( Math . sin ( dlat / 2 ) , 2 ) + Math . cos ( lat1 ) * Math . cos ( lat2 ) * Math . pow ( Math . sin ( dlon / 2 ) , 2 ) ; double c = 2 * Math . asin ( Math . sqrt ( a ) ) ; double r = 6371 ; return ( c * r ) ; }
null
null
public static void main(String args[]) { int n_success = 0; List<Double> param0 = new ArrayList<>(); param0.add(6578.099266893886); param0.add(-9410.77783405426); param0.add(6641.858718352012); param0.add(-4142.202863100186); param0.add(4181.4508741498075); param0.add(-7745.655002884576); param0.add(7725.024650172891); param0.add(-5881.135770052704); param0.add(8322.143446980337); param0.add(-1772.9564288056765); List<Double> param1 = new ArrayList<>(); param1.add(482.6430542568438); param1.add(-1203.2861272633245); param1.add(3498.0959749989424); param1.add(-6286.669946106916); param1.add(3845.247033476332); param1.add(-8197.864556657836); param1.add(9295.96418476119); param1.add(-4802.015139707946); param1.add(1841.108539911126); param1.add(-8246.345733364455); List<Double> param2 = new ArrayList<>(); param2.add(1342.7044674704348); param2.add(-1947.91060583419); param2.add(228.4572635598181); param2.add(-2742.3608603803173); param2.add(4909.334120366857); param2.add(-3667.1524343381157); param2.add(588.3703338670609); param2.add(-35.713164290259726); param2.add(9049.321929418034); param2.add(-9716.057194373958); List<Double> param3 = new ArrayList<>(); param3.add(3416.2819128903197); param3.add(-781.7419983063755); param3.add(5599.787943215038); param3.add(-6584.987721971118); param3.add(5159.242793722949); param3.add(-8067.806767671396); param3.add(1220.0418662747136); param3.add(-4696.734461092275); param3.add(4470.7365519306095); param3.add(-8367.588380851601); 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.001) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
null
COUNT_TOTAL_SET_BITS_IN_ALL_NUMBERS_FROM_1_TO_N
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_TOTAL_SET_BITS_IN_ALL_NUMBERS_FROM_1_TO_N{ static int f_gold ( int n ) { int i = 0 ; int ans = 0 ; while ( ( 1 << i ) <= n ) { boolean k = false ; int change = 1 << i ; for ( int j = 0 ; j <= n ; j ++ ) { if ( k == true ) ans += 1 ; else ans += 0 ; if ( change == 1 ) { k = ! k ; change = 1 << i ; } else { change -- ; } } i ++ ; } return ans ; }
def f_gold ( n ) : i = 0 ans = 0 while ( ( 1 << i ) <= n ) : k = 0 change = 1 << i for j in range ( 0 , n + 1 ) : ans += k if change == 1 : k = not k change = 1 << i else : change -= 1 i += 1 return ans
using namespace std; int f_gold ( int n ) { int i = 0; int ans = 0; while ( ( 1 << i ) <= n ) { bool k = 0; int change = 1 << i; for ( int j = 0; j <= n; j ++ ) { ans += k; if ( change == 1 ) { k = ! k; change = 1 << i; } else { change --; } } i ++; } return ans; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(90); param0.add(56); param0.add(43); param0.add(31); param0.add(77); param0.add(35); param0.add(43); param0.add(66); param0.add(15); param0.add(95); 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()); } }
if __name__ == '__main__': param = [ (90,), (56,), (43,), (31,), (77,), (35,), (43,), (66,), (15,), (95,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {90,56,43,31,77,35,43,66,15,95}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CHECK_GIVEN_SENTENCE_GIVEN_SET_SIMPLE_GRAMMER_RULES
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_GIVEN_SENTENCE_GIVEN_SET_SIMPLE_GRAMMER_RULES{ static boolean f_gold ( char [ ] str ) { int len = str . length ; if ( str [ 0 ] < 'A' || str [ 0 ] > 'Z' ) return false ; if ( str [ len - 1 ] != '.' ) return false ; int prev_state = 0 , curr_state = 0 ; int index = 1 ; while ( index <= str . length ) { if ( str [ index ] >= 'A' && str [ index ] <= 'Z' ) curr_state = 0 ; else if ( str [ index ] == ' ' ) curr_state = 1 ; else if ( str [ index ] >= 'a' && str [ index ] <= 'z' ) curr_state = 2 ; else if ( str [ index ] == '.' ) curr_state = 3 ; if ( prev_state == curr_state && curr_state != 2 ) return false ; if ( prev_state == 2 && curr_state == 0 ) return false ; if ( curr_state == 3 && prev_state != 1 ) return ( index + 1 == str . length ) ; index ++ ; prev_state = curr_state ; } return false ; }
def f_gold ( string ) : length = len ( string ) if string [ 0 ] < 'A' or string [ 0 ] > 'Z' : return False if string [ length - 1 ] != '.' : return False prev_state = 0 curr_state = 0 index = 1 while ( string [ index ] ) : if string [ index ] >= 'A' and string [ index ] <= 'Z' : curr_state = 0 elif string [ index ] == ' ' : curr_state = 1 elif string [ index ] >= 'a' and string [ index ] <= 'z' : curr_state = 2 elif string [ index ] == '.' : curr_state = 3 if prev_state == curr_state and curr_state != 2 : return False if prev_state == 2 and curr_state == 0 : return False if curr_state == 3 and prev_state != 1 : return True index += 1 prev_state = curr_state return False
using namespace std; bool f_gold ( char str [ ] ) { int len = strlen ( str ); if ( str [ 0 ] < 'A' || str [ 0 ] > 'Z' ) return false; if ( str [ len - 1 ] != '.' ) return false; int prev_state = 0, curr_state = 0; int index = 1; while ( str [ index ] ) { if ( str [ index ] >= 'A' && str [ index ] <= 'Z' ) curr_state = 0; else if ( str [ index ] == ' ' ) curr_state = 1; else if ( str [ index ] >= 'a' && str [ index ] <= 'z' ) curr_state = 2; else if ( str [ index ] == '.' ) curr_state = 3; if ( prev_state == curr_state && curr_state != 2 ) return false; if ( prev_state == 2 && curr_state == 0 ) return false; if ( curr_state == 3 && prev_state != 1 ) return ( str [ index + 1 ] == '\0' ); index ++; prev_state = curr_state; } return false; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = Arrays.asList("I love cinema.", "The vertex is S.", "I am single.", "My name is KG.", "I lovE cinema.", "GeeksQuiz. is a quiz site.", "I love Geeksquiz and Geeksforgeeks.", " You are my friend.", "I love cinema", "Hello world !"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i).toCharArray()) == f_gold(param0.get(i).toCharArray())) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = ["I love cinema.", "The vertex is S.", "I am single.", "My name is KG.", "I lovE cinema.", "GeeksQuiz. is a quiz site.", "I love Geeksquiz and Geeksforgeeks.", " You are my friend.", "I love cinema", "Hello world !"] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(parameters_set) == f_gold(parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 { "I love cinema.", "The vertex is S.", "I am single.", "My name is KG.", "I lovE cinema.", "GeeksQuiz. is a quiz site.", "I love Geeksquiz and Geeksforgeeks.", " You are my friend.", "I love cinema", "Hello world !" }; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front()) == f_gold(&param0[i].front())) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CHECK_EXIST_TWO_ELEMENTS_ARRAY_WHOSE_SUM_EQUAL_SUM_REST_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_EXIST_TWO_ELEMENTS_ARRAY_WHOSE_SUM_EQUAL_SUM_REST_ARRAY{ static boolean f_gold ( int arr [ ] , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum += arr [ i ] ; } if ( sum % 2 != 0 ) { return false ; } sum = sum / 2 ; HashSet < Integer > s = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int val = sum - arr [ i ] ; if ( s . contains ( val ) && val == ( int ) s . toArray ( ) [ s . size ( ) - 1 ] ) { System . out . printf ( "Pair elements are %d and %d\n" , arr [ i ] , val ) ; return true ; } s . add ( arr [ i ] ) ; } return false ; }
def f_gold ( arr , n ) : s = set ( ) sum = 0 for i in range ( n ) : sum += arr [ i ] if sum % 2 != 0 : return False sum = sum / 2 for i in range ( n ) : val = sum - arr [ i ] if arr [ i ] not in s : s.add ( arr [ i ] ) if val in s : print ( "Pair elements are" , arr [ i ] , "and" , int ( val ) )
using namespace std; bool f_gold ( int arr [ ], int n ) { int sum = 0; for ( int i = 0; i < n; i ++ ) sum += arr [ i ]; if ( sum % 2 != 0 ) return false; sum = sum / 2; unordered_set < int > s; for ( int i = 0; i < n; i ++ ) { int val = sum - arr [ i ]; if ( s . find ( val ) != s . end ( ) ) { printf ( "Pair elements are %d and %d\n", arr [ i ], val ); return true; } s . insert ( arr [ i ] ); } return false; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2, 11, 5, 1, 4, 7}); param0.add(new int[]{2, 4, 2, 1, 11, 15}); 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}); param0.add(new int[]{69,6,24,30,75,37,61,76,19,18,90,9,49,24,58,97,18,85,24,93,71,98,92,59,75,75,75,70,35,58,50,1,64,66,33}); param0.add(new int[]{-94,-94,-92,-74,-60,-58,-56,-44,-42,-40,-28,-14,2,4,14,20,24,28,40,42,42,66,78,78,80,82,96}); param0.add(new int[]{1,0,1,1,0,0,1,1,0,0,1,1,0,1}); param0.add(new int[]{21,26,26,27,61,62,96}); param0.add(new int[]{-54,86,20,26}); param0.add(new int[]{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[]{44,35,26,15,56,6,36,53,15,66,20,53,99,96,51,12,61,19,79,40,99,42,86,8,11,54,93,46,23,47,41,26,66,5,86,52,64,51,4,21,63,14,7,53,31,8,9,63}); List<Integer> param1 = new ArrayList<>(); param1.add(6); param1.add(6); param1.add(13); param1.add(18); param1.add(26); param1.add(10); param1.add(6); param1.add(3); param1.add(4); 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()); } }
if __name__ == '__main__': param = [ ([2, 11, 5, 1, 4, 7],6,), ([2, 4, 2, 1, 11, 15],6,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],13,), ([69, 6, 24, 30, 75, 37, 61, 76, 19, 18, 90, 9, 49, 24, 58, 97, 18, 85, 24, 93, 71, 98, 92, 59, 75, 75, 75, 70, 35, 58, 50, 1, 64, 66, 33],18,), ([-94, -94, -92, -74, -60, -58, -56, -44, -42, -40, -28, -14, 2, 4, 14, 20, 24, 28, 40, 42, 42, 66, 78, 78, 80, 82, 96],26,), ([1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1],10,), ([21, 26, 26, 27, 61, 62, 96],6,), ([-54, 86, 20, 26],3,), ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],4,), ([44, 35, 26, 15, 56, 6, 36, 53, 15, 66, 20, 53, 99, 96, 51, 12, 61, 19, 79, 40, 99, 42, 86, 8, 11, 54, 93, 46, 23, 47, 41, 26, 66, 5, 86, 52, 64, 51, 4, 21, 63, 14, 7, 53, 31, 8, 9, 63],31,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 { {2, 11, 5, 1, 4, 7}, {2, 4, 2, 1, 11, 15}, {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1},{69,6,24,30,75,37,61,76,19,18,90,9,49,24,58,97,18,85,24,93,71,98,92,59,75,75,75,70,35,58,50,1,64,66,33},{-94,-94,-92,-74,-60,-58,-56,-44,-42,-40,-28,-14,2,4,14,20,24,28,40,42,42,66,78,78,80,82,96},{1,0,1,1,0,0,1,1,0,0,1,1,0,1},{21,26,26,27,61,62,96},{-54,86,20,26},{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{44,35,26,15,56,6,36,53,15,66,20,53,99,96,51,12,61,19,79,40,99,42,86,8,11,54,93,46,23,47,41,26,66,5,86,52,64,51,4,21,63,14,7,53,31,8,9,63}}; vector<int> param1 {6,6,13,18,26,10,6,3,4,31}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CHECK_POSSIBLE_TRANSFORM_ONE_STRING_ANOTHER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_POSSIBLE_TRANSFORM_ONE_STRING_ANOTHER{ static boolean f_gold ( String s1 , String s2 ) { int n = s1 . length ( ) ; int m = s2 . length ( ) ; boolean dp [ ] [ ] = new boolean [ n + 1 ] [ m + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) { for ( int j = 0 ; j <= m ; j ++ ) { dp [ i ] [ j ] = false ; } } dp [ 0 ] [ 0 ] = true ; for ( int i = 0 ; i < s1 . length ( ) ; i ++ ) { for ( int j = 0 ; j <= s2 . length ( ) ; j ++ ) { if ( dp [ i ] [ j ] ) { if ( j < s2 . length ( ) && ( Character . toUpperCase ( s1 . charAt ( i ) ) == s2 . charAt ( j ) ) ) dp [ i + 1 ] [ j + 1 ] = true ; if ( ! Character . isUpperCase ( s1 . charAt ( i ) ) ) dp [ i + 1 ] [ j ] = true ; } } } return ( dp [ n ] [ m ] ) ; }
def f_gold ( s1 , s2 ) : n = len ( s1 ) m = len ( s2 ) dp = ( [ [ False for i in range ( m + 1 ) ] for i in range ( n + 1 ) ] ) dp [ 0 ] [ 0 ] = True for i in range ( len ( s1 ) ) : for j in range ( len ( s2 ) + 1 ) : if ( dp [ i ] [ j ] ) : if ( ( j < len ( s2 ) and ( s1 [ i ].upper ( ) == s2 [ j ] ) ) ) : dp [ i + 1 ] [ j + 1 ] = True if ( s1 [ i ].isupper ( ) == False ) : dp [ i + 1 ] [ j ] = True return ( dp [ n ] [ m ] )
using namespace std; bool f_gold ( string s1, string s2 ) { int n = s1 . length ( ); int m = s2 . length ( ); bool dp [ n + 1 ] [ m + 1 ]; for ( int i = 0; i <= n; i ++ ) { for ( int j = 0; j <= m; j ++ ) { dp [ i ] [ j ] = false; } } dp [ 0 ] [ 0 ] = true; for ( int i = 0; i < s1 . length ( ); i ++ ) { for ( int j = 0; j <= s2 . length ( ); j ++ ) { if ( dp [ i ] [ j ] ) { if ( j < s2 . length ( ) && ( toupper ( s1 [ i ] ) == s2 [ j ] ) ) dp [ i + 1 ] [ j + 1 ] = true; if ( ! isupper ( s1 [ i ] ) ) dp [ i + 1 ] [ j ] = true; } } } return ( dp [ n ] [ m ] ); }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("daBcd"); param0.add("417514"); param0.add("010000"); param0.add("ZcKYguiMrdyn"); param0.add("argaju"); param0.add("1110101101"); param0.add("ySOCoSaygi"); param0.add("204"); param0.add("10011100000010"); param0.add("nMAioozPmY"); List<String> param1 = new ArrayList<>(); param1.add("ABC"); param1.add("9"); param1.add("1111011010"); param1.add("iz"); param1.add("RAJ"); param1.add("110101001"); param1.add("aRhxkYqh"); param1.add("6986871066"); param1.add("0"); param1.add("WZFdDKw"); 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()); } }
if __name__ == '__main__': param = [ ('daBcd','ABC',), ('417514','9',), ('010000','1111011010',), ('ZcKYguiMrdyn','iz',), ('argaju','RAJ',), ('1110101101','110101001',), ('ySOCoSaygi','aRhxkYqh',), ('204','6986871066',), ('10011100000010','0',), ('nMAioozPmY','WZFdDKw',) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 {"daBcd","417514","010000","ZcKYguiMrdyn","argaju","1110101101","ySOCoSaygi","204","10011100000010","nMAioozPmY"}; vector<string> param1 {"ABC","9","1111011010","iz","RAJ","110101001","aRhxkYqh","6986871066","0","WZFdDKw"}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
FIND_SUM_EVEN_FACTORS_NUMBER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_SUM_EVEN_FACTORS_NUMBER{ public static int f_gold ( int n ) { if ( n % 2 != 0 ) return 0 ; int res = 1 ; for ( int i = 2 ; i <= Math . sqrt ( n ) ; i ++ ) { int count = 0 , curr_sum = 1 ; int curr_term = 1 ; while ( n % i == 0 ) { count ++ ; n = n / i ; if ( i == 2 && count == 1 ) curr_sum = 0 ; curr_term *= i ; curr_sum += curr_term ; } res *= curr_sum ; } if ( n >= 2 ) res *= ( 1 + n ) ; return res ; }
import math def f_gold ( n ) : if ( n % 2 != 0 ) : return 0 res = 1 for i in range ( 2 , ( int ) ( math.sqrt ( n ) ) + 1 ) : count = 0 curr_sum = 1 curr_term = 1 while ( n % i == 0 ) : count = count + 1 n = n // i if ( i == 2 and count == 1 ) : curr_sum = 0 curr_term = curr_term * i curr_sum = curr_sum + curr_term res = res * curr_sum if ( n >= 2 ) : res = res * ( 1 + n ) return res
using namespace std; int f_gold ( int n ) { if ( n % 2 != 0 ) return 0; int res = 1; for ( int i = 2; i <= sqrt ( n ); i ++ ) { int count = 0, curr_sum = 1, curr_term = 1; while ( n % i == 0 ) { count ++; n = n / i; if ( i == 2 && count == 1 ) curr_sum = 0; curr_term *= i; curr_sum += curr_term; } res *= curr_sum; } if ( n >= 2 ) res *= ( 1 + n ); return res; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(71); param0.add(78); param0.add(39); param0.add(36); param0.add(49); param0.add(17); param0.add(53); param0.add(66); param0.add(92); param0.add(71); 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()); } }
if __name__ == '__main__': param = [ (71,), (78,), (39,), (36,), (49,), (17,), (53,), (66,), (92,), (71,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {71,78,39,36,49,17,53,66,92,71}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
CALCULATE_AREA_TETRAHEDRON
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CALCULATE_AREA_TETRAHEDRON{ static double f_gold ( int side ) { double volume = ( Math . pow ( side , 3 ) / ( 6 * Math . sqrt ( 2 ) ) ) ; return volume ; }
import math def f_gold ( side ) : volume = ( side ** 3 / ( 6 * math.sqrt ( 2 ) ) ) return round ( volume , 2 )
using namespace std; double f_gold ( int side ) { double volume = ( pow ( side, 3 ) / ( 6 * sqrt ( 2 ) ) ); return volume; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(58); param0.add(56); param0.add(35); param0.add(99); param0.add(13); param0.add(45); param0.add(40); param0.add(92); param0.add(7); param0.add(13); 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()); } }
if __name__ == '__main__': param = [ (58,), (56,), (35,), (99,), (13,), (45,), (40,), (92,), (7,), (13,) ] n_success = 0 for i, parameters_set in enumerate(param): if abs(1 - (0.0000001 + abs(f_gold(*parameters_set))) / (abs(f_filled(*parameters_set)) + 0.0000001)) < 0.001: n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {58,56,35,99,13,45,40,92,7,13}; for(int i = 0; i < param0.size(); ++i) { if(abs(1 - (0.0000001 + abs(f_gold(param0[i])) )/ (abs(f_filled(param0[i])) + 0.0000001)) < 0.001) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
DYNAMIC_PROGRAMMING_SET_13_CUTTING_A_ROD
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DYNAMIC_PROGRAMMING_SET_13_CUTTING_A_ROD{ static int f_gold ( int price [ ] , int n ) { int val [ ] = new int [ n + 1 ] ; val [ 0 ] = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int max_val = Integer . MIN_VALUE ; for ( int j = 0 ; j < i ; j ++ ) max_val = Math . max ( max_val , price [ j ] + val [ i - j - 1 ] ) ; val [ i ] = max_val ; } return val [ n ] ; }
null
using namespace std; int f_gold ( int price [ ], int n ) { int val [ n + 1 ]; val [ 0 ] = 0; int i, j; for ( i = 1; i <= n; i ++ ) { int max_val = INT_MIN; for ( j = 0; j < i; j ++ ) max_val = max ( max_val, price [ j ] + val [ i - j - 1 ] ); val [ i ] = max_val; } return val [ n ]; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{5,7,15,16,18,22,22,30,34,35,37,41,42,42,43,47,49,52,53,55,58,60,62,62,62,65,65,67,69,73,73,73,75,78,83,84,86,90,91,91,93,94,96}); param0.add(new int[]{50,-30,-84,-2,-96,-54,-14,56,-48,70,38,-86,16,-48,66,34,36,40,40,36,-16,-92,30}); 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}); param0.add(new int[]{79,33,54,12,53,9,29,45,85,20,6,52,8,26,43,42,17,54,8,70,5,71,1,81,42,59,42,63,8,86,29,16,72}); param0.add(new int[]{-78,-64,-38,-22,2,8,28,32,58,72,72,90}); param0.add(new int[]{1,0,1,1,1,0,0,1,0,0,1,1,0,1,1,0,1,0,0,1,0,0,1,1,0,1,1,0,0,0}); param0.add(new int[]{1,3,6,7,10,17,18,22,23,24,28,31,37,43,48,54,56,65,70,71,73,74,79,84,87,95,96}); param0.add(new int[]{-30,20,-72,-86,-8}); 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[]{96,99,20,87,17,13,45,65,33,13,59,77,35,79,20,51,69,71,55,37,23,35,82,70}); List<Integer> param1 = new ArrayList<>(); param1.add(37); param1.add(19); param1.add(29); param1.add(22); param1.add(11); param1.add(20); param1.add(21); param1.add(3); param1.add(21); param1.add(19); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{5,7,15,16,18,22,22,30,34,35,37,41,42,42,43,47,49,52,53,55,58,60,62,62,62,65,65,67,69,73,73,73,75,78,83,84,86,90,91,91,93,94,96},{50,-30,-84,-2,-96,-54,-14,56,-48,70,38,-86,16,-48,66,34,36,40,40,36,-16,-92,30},{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},{79,33,54,12,53,9,29,45,85,20,6,52,8,26,43,42,17,54,8,70,5,71,1,81,42,59,42,63,8,86,29,16,72},{-78,-64,-38,-22,2,8,28,32,58,72,72,90},{1,0,1,1,1,0,0,1,0,0,1,1,0,1,1,0,1,0,0,1,0,0,1,1,0,1,1,0,0,0},{1,3,6,7,10,17,18,22,23,24,28,31,37,43,48,54,56,65,70,71,73,74,79,84,87,95,96},{-30,20,-72,-86,-8},{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},{96,99,20,87,17,13,45,65,33,13,59,77,35,79,20,51,69,71,55,37,23,35,82,70}}; vector<int> param1 {37,19,29,22,11,20,21,3,21,19}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
SQUARED_TRIANGULAR_NUMBER_SUM_CUBES
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SQUARED_TRIANGULAR_NUMBER_SUM_CUBES{ static int f_gold ( int s ) { int sum = 0 ; for ( int n = 1 ; sum < s ; n ++ ) { sum += n * n * n ; if ( sum == s ) return n ; } return - 1 ; }
def f_gold ( s ) : _sum = 0 n = 1 while ( _sum < s ) : _sum += n * n * n n += 1 n -= 1 if _sum == s : return n return - 1
using namespace std; int f_gold ( int s ) { int sum = 0; for ( int n = 1; sum < s; n ++ ) { sum += n * n * n; if ( sum == s ) return n; } return - 1; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(15); param0.add(36); param0.add(39); param0.add(43); param0.add(75); param0.add(49); param0.add(56); param0.add(14); param0.add(62); param0.add(97); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (15,), (36,), (39,), (43,), (75,), (49,), (56,), (14,), (62,), (97,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {15,36,39,43,75,49,56,14,62,97}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
FREQUENT_ELEMENT_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FREQUENT_ELEMENT_ARRAY{ static int f_gold ( int arr [ ] , int n ) { Arrays . sort ( arr ) ; int max_count = 1 , res = arr [ 0 ] ; int curr_count = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] == arr [ i - 1 ] ) curr_count ++ ; else { if ( curr_count > max_count ) { max_count = curr_count ; res = arr [ i - 1 ] ; } curr_count = 1 ; } } if ( curr_count > max_count ) { max_count = curr_count ; res = arr [ n - 1 ] ; } return res ; }
def f_gold ( arr , n ) : arr.sort ( ) max_count = 1 ; res = arr [ 0 ] ; curr_count = 1 for i in range ( 1 , n ) : if ( arr [ i ] == arr [ i - 1 ] ) : curr_count += 1 else : if ( curr_count > max_count ) : max_count = curr_count res = arr [ i - 1 ] curr_count = 1 if ( curr_count > max_count ) : max_count = curr_count res = arr [ n - 1 ] return res
using namespace std; int f_gold ( int arr [ ], int n ) { sort ( arr, arr + n ); int max_count = 1, res = arr [ 0 ], curr_count = 1; for ( int i = 1; i < n; i ++ ) { if ( arr [ i ] == arr [ i - 1 ] ) curr_count ++; else { if ( curr_count > max_count ) { max_count = curr_count; res = arr [ i - 1 ]; } curr_count = 1; } } if ( curr_count > max_count ) { max_count = curr_count; res = arr [ n - 1 ]; } return res; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,1,3,11,11,11,18,20,26,26,27,30,33,39,39,42,42,48,51,51,51,51,60,66,66,68,68,69,71,72,73,76,76,77,77,77,78,90,96}); param0.add(new int[]{46,-8,64,-46,-38,92,-14,-22,-32,48,72,96,30,66,94,36,42,-18,14,-74,80,96,-4}); param0.add(new int[]{0,0,0,0,0,0,1}); param0.add(new int[]{93,32,3,31,67,96,52,80,70,49,45,23,58,87,31,56,21,71,55,97}); param0.add(new int[]{-98,-96,-84,-82,-72,-64,-62,-56,-52,-52,-48,-46,-42,-36,-32,-30,-30,-18,-16,-10,-2,0,6,18,22,22,40,42,50,54,64,68,68,72,80,82,84,96}); param0.add(new int[]{1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,0,0,1,0,1,0,0,0,1,1,1,0,0,1,0,1,1,0}); param0.add(new int[]{9,12,13,28,43,46,64,66,68,89,92}); param0.add(new int[]{22,-8,-56,68,-12,-26,-40,-46,-42,-80,4,-42,-72,-22,36,22,-94,48,96,80,-52,46,90,94,36,92,-12,-24,-60,-32,92,18,76,40,-32,6,-22,86,86,-88,38,50,32,78,-82,54,-40,18}); param0.add(new int[]{0,0,0,0,0,0,1,1,1}); param0.add(new int[]{81,74,32,41,85,65,81,74,40,64,97,4,61,43,54,96,62,2,97,86,80,25,9,31,16,29,4,63,76,41,5,95}); List<Integer> param1 = new ArrayList<>(); param1.add(25); param1.add(18); param1.add(6); param1.add(15); param1.add(20); param1.add(29); param1.add(6); param1.add(41); param1.add(4); param1.add(16); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([1, 1, 3, 11, 11, 11, 18, 20, 26, 26, 27, 30, 33, 39, 39, 42, 42, 48, 51, 51, 51, 51, 60, 66, 66, 68, 68, 69, 71, 72, 73, 76, 76, 77, 77, 77, 78, 90, 96],25,), ([46, -8, 64, -46, -38, 92, -14, -22, -32, 48, 72, 96, 30, 66, 94, 36, 42, -18, 14, -74, 80, 96, -4],18,), ([0, 0, 0, 0, 0, 0, 1],6,), ([93, 32, 3, 31, 67, 96, 52, 80, 70, 49, 45, 23, 58, 87, 31, 56, 21, 71, 55, 97],15,), ([-98, -96, -84, -82, -72, -64, -62, -56, -52, -52, -48, -46, -42, -36, -32, -30, -30, -18, -16, -10, -2, 0, 6, 18, 22, 22, 40, 42, 50, 54, 64, 68, 68, 72, 80, 82, 84, 96],20,), ([1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0],29,), ([9, 12, 13, 28, 43, 46, 64, 66, 68, 89, 92],6,), ([22, -8, -56, 68, -12, -26, -40, -46, -42, -80, 4, -42, -72, -22, 36, 22, -94, 48, 96, 80, -52, 46, 90, 94, 36, 92, -12, -24, -60, -32, 92, 18, 76, 40, -32, 6, -22, 86, 86, -88, 38, 50, 32, 78, -82, 54, -40, 18],41,), ([0, 0, 0, 0, 0, 0, 1, 1, 1],4,), ([81, 74, 32, 41, 85, 65, 81, 74, 40, 64, 97, 4, 61, 43, 54, 96, 62, 2, 97, 86, 80, 25, 9, 31, 16, 29, 4, 63, 76, 41, 5, 95],16,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<vector<int>> param0 {{1,1,3,11,11,11,18,20,26,26,27,30,33,39,39,42,42,48,51,51,51,51,60,66,66,68,68,69,71,72,73,76,76,77,77,77,78,90,96},{46,-8,64,-46,-38,92,-14,-22,-32,48,72,96,30,66,94,36,42,-18,14,-74,80,96,-4},{0,0,0,0,0,0,1},{93,32,3,31,67,96,52,80,70,49,45,23,58,87,31,56,21,71,55,97},{-98,-96,-84,-82,-72,-64,-62,-56,-52,-52,-48,-46,-42,-36,-32,-30,-30,-18,-16,-10,-2,0,6,18,22,22,40,42,50,54,64,68,68,72,80,82,84,96},{1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,1,0,0,1,0,1,0,0,0,1,1,1,0,0,1,0,1,1,0},{9,12,13,28,43,46,64,66,68,89,92},{22,-8,-56,68,-12,-26,-40,-46,-42,-80,4,-42,-72,-22,36,22,-94,48,96,80,-52,46,90,94,36,92,-12,-24,-60,-32,92,18,76,40,-32,6,-22,86,86,-88,38,50,32,78,-82,54,-40,18},{0,0,0,0,0,0,1,1,1},{81,74,32,41,85,65,81,74,40,64,97,4,61,43,54,96,62,2,97,86,80,25,9,31,16,29,4,63,76,41,5,95}}; vector<int> param1 {25,18,6,15,20,29,6,41,4,16}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),param1[i]) == f_gold(&param0[i].front(),param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
FIND_SUM_EVEN_INDEX_BINOMIAL_COEFFICIENTS_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_SUM_EVEN_INDEX_BINOMIAL_COEFFICIENTS_1{ static int f_gold ( int n ) { return ( 1 << ( n - 1 ) ) ; }
def f_gold ( n ) : return ( 1 << ( n - 1 ) )
using namespace std; int f_gold ( int n ) { return ( 1 << ( n - 1 ) ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(56); param0.add(28); param0.add(4); param0.add(24); param0.add(72); param0.add(30); param0.add(48); param0.add(32); param0.add(13); 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()); } }
if __name__ == '__main__': param = [ (56,), (28,), (4,), (24,), (72,), (30,), (48,), (32,), (13,), (19,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {56,28,4,24,72,30,48,32,13,19}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
PYTHON_PROGRAM_FIND_PERIMETER_CIRCUMFERENCE_SQUARE_RECTANGLE_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PYTHON_PROGRAM_FIND_PERIMETER_CIRCUMFERENCE_SQUARE_RECTANGLE_1{ static int f_gold ( int l , int w ) { return ( 2 * ( l + w ) ) ; }
def f_gold ( l , w ) : return ( 2 * ( l + w ) )
using namespace std; int f_gold ( int l, int w ) { return ( 2 * ( l + w ) ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(58); param0.add(37); param0.add(56); param0.add(22); param0.add(77); param0.add(34); param0.add(74); param0.add(37); param0.add(21); param0.add(75); List<Integer> param1 = new ArrayList<>(); param1.add(39); param1.add(49); param1.add(52); param1.add(43); param1.add(12); param1.add(31); param1.add(54); param1.add(52); param1.add(37); 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()); } }
if __name__ == '__main__': param = [ (58,39,), (37,49,), (56,52,), (22,43,), (77,12,), (34,31,), (74,54,), (37,52,), (21,37,), (75,30,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {58,37,56,22,77,34,74,37,21,75}; vector<int> param1 {39,49,52,43,12,31,54,52,37,30}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
LONGEST_REPEATING_AND_NON_OVERLAPPING_SUBSTRING
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LONGEST_REPEATING_AND_NON_OVERLAPPING_SUBSTRING{ static String f_gold ( String str ) { int n = str . length ( ) ; int LCSRe [ ] [ ] = new int [ n + 1 ] [ n + 1 ] ; String res = "" ; int res_length = 0 ; int i , index = 0 ; for ( i = 1 ; i <= n ; i ++ ) { for ( int j = i + 1 ; j <= n ; j ++ ) { if ( str . charAt ( i - 1 ) == str . charAt ( j - 1 ) && LCSRe [ i - 1 ] [ j - 1 ] < ( j - i ) ) { LCSRe [ i ] [ j ] = LCSRe [ i - 1 ] [ j - 1 ] + 1 ; if ( LCSRe [ i ] [ j ] > res_length ) { res_length = LCSRe [ i ] [ j ] ; index = Math . max ( i , index ) ; } } else { LCSRe [ i ] [ j ] = 0 ; } } } if ( res_length > 0 ) { for ( i = index - res_length + 1 ; i <= index ; i ++ ) { res += str . charAt ( i - 1 ) ; } } return res ; }
def f_gold ( str ) : n = len ( str ) LCSRe = [ [ 0 for x in range ( n + 1 ) ] for y in range ( n + 1 ) ] res = "" res_length = 0 index = 0 for i in range ( 1 , n + 1 ) : for j in range ( i + 1 , n + 1 ) : if ( str [ i - 1 ] == str [ j - 1 ] and LCSRe [ i - 1 ] [ j - 1 ] < ( j - i ) ) : LCSRe [ i ] [ j ] = LCSRe [ i - 1 ] [ j - 1 ] + 1 if ( LCSRe [ i ] [ j ] > res_length ) : res_length = LCSRe [ i ] [ j ] index = max ( i , index ) else : LCSRe [ i ] [ j ] = 0 if ( res_length > 0 ) : for i in range ( index - res_length + 1 , index + 1 ) : res = res + str [ i - 1 ] return res
using namespace std; string f_gold ( string str ) { int n = str . length ( ); int LCSRe [ n + 1 ] [ n + 1 ]; memset ( LCSRe, 0, sizeof ( LCSRe ) ); string res; int res_length = 0; int i, index = 0; for ( i = 1; i <= n; i ++ ) { for ( int j = i + 1; j <= n; j ++ ) { if ( str [ i - 1 ] == str [ j - 1 ] && LCSRe [ i - 1 ] [ j - 1 ] < ( j - i ) ) { LCSRe [ i ] [ j ] = LCSRe [ i - 1 ] [ j - 1 ] + 1; if ( LCSRe [ i ] [ j ] > res_length ) { res_length = LCSRe [ i ] [ j ]; index = max ( i, index ); } } else LCSRe [ i ] [ j ] = 0; } } if ( res_length > 0 ) for ( i = index - res_length + 1; i <= index; i ++ ) res . push_back ( str [ i - 1 ] ); return res; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("fbfHTjE"); param0.add("09285256323"); param0.add("0011000101110"); param0.add("ue JkVZTt"); param0.add("48387612426300"); param0.add("010"); param0.add("ddRrUz"); param0.add("1049162633793"); param0.add("100011"); param0.add("iJfadiVaQqv"); 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()); } }
if __name__ == '__main__': param = [ ('fbfHTjE',), ('09285256323',), ('0011000101110',), ('ue JkVZTt',), ('48387612426300',), ('010',), ('ddRrUz',), ('1049162633793',), ('100011',), ('iJfadiVaQqv',) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 {"fbfHTjE","09285256323","0011000101110","ue JkVZTt","48387612426300","010","ddRrUz","1049162633793","100011","iJfadiVaQqv"}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
NUMBER_N_DIGIT_STEPPING_NUMBERS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_N_DIGIT_STEPPING_NUMBERS{ static long f_gold ( int n ) { int dp [ ] [ ] = new int [ n + 1 ] [ 10 ] ; if ( n == 1 ) return 10 ; for ( int j = 0 ; j <= 9 ; j ++ ) dp [ 1 ] [ j ] = 1 ; for ( int i = 2 ; i <= n ; i ++ ) { for ( int j = 0 ; j <= 9 ; j ++ ) { if ( j == 0 ) dp [ i ] [ j ] = dp [ i - 1 ] [ j + 1 ] ; else if ( j == 9 ) dp [ i ] [ j ] = dp [ i - 1 ] [ j - 1 ] ; else dp [ i ] [ j ] = dp [ i - 1 ] [ j - 1 ] + dp [ i - 1 ] [ j + 1 ] ; } } long sum = 0 ; for ( int j = 1 ; j <= 9 ; j ++ ) sum += dp [ n ] [ j ] ; return sum ; }
def f_gold ( n ) : dp = [ [ 0 for x in range ( 10 ) ] for y in range ( n + 1 ) ] ; if ( n == 1 ) : return 10 ; for j in range ( 10 ) : dp [ 1 ] [ j ] = 1 ; for i in range ( 2 , n + 1 ) : for j in range ( 10 ) : if ( j == 0 ) : dp [ i ] [ j ] = dp [ i - 1 ] [ j + 1 ] ; elif ( j == 9 ) : dp [ i ] [ j ] = dp [ i - 1 ] [ j - 1 ] ; else : dp [ i ] [ j ] = ( dp [ i - 1 ] [ j - 1 ] + dp [ i - 1 ] [ j + 1 ] ) ; sum = 0 ; for j in range ( 1 , 10 ) : sum = sum + dp [ n ] [ j ] ; return sum ;
using namespace std; long long f_gold ( int n ) { int dp [ n + 1 ] [ 10 ]; if ( n == 1 ) return 10; for ( int j = 0; j <= 9; j ++ ) dp [ 1 ] [ j ] = 1; for ( int i = 2; i <= n; i ++ ) { for ( int j = 0; j <= 9; j ++ ) { if ( j == 0 ) dp [ i ] [ j ] = dp [ i - 1 ] [ j + 1 ]; else if ( j == 9 ) dp [ i ] [ j ] = dp [ i - 1 ] [ j - 1 ]; else dp [ i ] [ j ] = dp [ i - 1 ] [ j - 1 ] + dp [ i - 1 ] [ j + 1 ]; } } long long sum = 0; for ( int j = 1; j <= 9; j ++ ) sum += dp [ n ] [ j ]; return sum; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(18); param0.add(66); param0.add(73); param0.add(70); param0.add(26); param0.add(41); param0.add(20); param0.add(25); param0.add(52); param0.add(13); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (18,), (66,), (73,), (70,), (26,), (41,), (20,), (25,), (52,), (13,) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<int> param0 {18,66,73,70,26,41,20,25,52,13}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
PROGRAM_FIND_STRING_START_END_GEEKS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_FIND_STRING_START_END_GEEKS{ static boolean f_gold ( String str , String corner ) { int n = str . length ( ) ; int cl = corner . length ( ) ; if ( n < cl ) return false ; return ( str . substring ( 0 , cl ) . equals ( corner ) && str . substring ( n - cl , n ) . equals ( corner ) ) ; }
def f_gold ( str , corner ) : n = len ( str ) cl = len ( corner ) if ( n < cl ) : return False return ( ( str [ : cl ] == corner ) and ( str [ n - cl : ] == corner ) )
using namespace std; bool f_gold ( string str, string corner ) { int n = str . length ( ); int cl = corner . length ( ); if ( n < cl ) return false; return ( str . substr ( 0, cl ) . compare ( corner ) == 0 && str . substr ( n - cl, cl ) . compare ( corner ) == 0 ); }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("geeksmanishgeeks"); param0.add("shreyadhatwalia"); param0.add("10000100"); param0.add("abaa"); param0.add("30645530"); param0.add("0000011011001"); param0.add("dkqEd"); param0.add("48694119324654"); param0.add("1101010010"); param0.add("Ks"); List<String> param1 = new ArrayList<>(); param1.add("geeks"); param1.add("abc"); param1.add("100"); param1.add("a"); param1.add("30"); param1.add("001"); param1.add("d"); param1.add("654"); param1.add("11"); param1.add("KsFLmngGGOmHKs"); 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()); } }
if __name__ == '__main__': param = [ ('geeksmanishgeeks','geeks',), ('shreyadhatwalia','abc',), ('10000100','100',), ('abaa','a',), ('30645530','30',), ('0000011011001','001',), ('dkqEd','d',), ('48694119324654','654',), ('1101010010','11',), ('Ks','KsFLmngGGOmHKs',) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 {"geeksmanishgeeks","shreyadhatwalia","10000100","abaa","30645530","0000011011001","dkqEd","48694119324654","1101010010","Ks"}; vector<string> param1 {"geeks","abc","100","a","30","001","d","654","11","KsFLmngGGOmHKs"}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
FIND_NUMBER_ENDLESS_POINTS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_NUMBER_ENDLESS_POINTS{ static int f_gold ( boolean input [ ] [ ] , int n ) { boolean row [ ] [ ] = new boolean [ n ] [ n ] ; boolean col [ ] [ ] = new boolean [ n ] [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { boolean isEndless = true ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( input [ i ] [ j ] == false ) isEndless = false ; col [ i ] [ j ] = isEndless ; } } for ( int i = 0 ; i < n ; i ++ ) { boolean isEndless = true ; for ( int j = n - 1 ; j >= 0 ; j -- ) { if ( input [ i ] [ j ] == false ) isEndless = false ; row [ i ] [ j ] = isEndless ; } } int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 1 ; j < n ; j ++ ) if ( row [ i ] [ j ] && col [ i ] [ j ] ) ans ++ ; return ans ; }
null
null
public static void main(String args[]) { int n_success = 0; List<boolean [ ] [ ]> param0 = new ArrayList<>(); param0.add(new boolean[][]{new boolean[]{false,false,false,true},new boolean[]{false,true,true,true},new boolean[]{false,false,true,true},new boolean[]{true,true,true,true}}); param0.add(new boolean[][]{new boolean[]{true,false,true,true,true,true,false,false,false},new boolean[]{false,true,true,true,true,true,false,true,true},new boolean[]{false,true,false,true,false,true,true,true,false},new boolean[]{false,false,false,false,true,true,false,false,true},new boolean[]{true,true,true,true,false,true,true,false,false},new boolean[]{false,false,true,true,false,true,false,false,true},new boolean[]{true,true,false,false,false,true,true,false,true},new boolean[]{false,true,true,false,false,false,false,false,false},new boolean[]{true,false,false,false,true,true,false,false,true}}); param0.add(new boolean[][]{new boolean[]{false,false,false,true},new boolean[]{false,false,true,true},new boolean[]{false,false,false,true},new boolean[]{false,false,true,true}}); param0.add(new boolean[][]{new boolean[]{false,true,true,false,false,true,false,false,true,false,false,false,true,false,false,true,false,true,true,false,false,true,true,true,true,true,true,false,false,true,false,false,false,true,false,true,true,true,false},new boolean[]{false,true,true,true,false,false,true,false,true,true,true,true,true,false,true,false,false,true,false,true,true,true,true,false,false,true,false,true,true,false,true,false,true,false,false,false,true,true,false},new boolean[]{false,true,true,false,true,false,false,true,false,true,true,false,true,true,false,true,false,true,false,true,false,true,true,false,true,false,true,false,true,false,false,false,false,true,false,false,true,true,true},new boolean[]{false,false,false,true,false,true,true,true,true,false,true,true,true,false,false,false,false,true,false,false,false,true,true,false,true,true,false,true,false,false,false,false,false,true,true,true,false,false,false},new boolean[]{true,false,false,true,false,false,false,true,false,true,true,false,false,true,true,true,false,false,false,false,false,true,true,false,true,false,false,true,false,true,false,false,false,true,false,true,false,true,false},new boolean[]{false,true,true,false,false,true,false,true,false,true,false,true,true,true,true,true,false,true,false,false,false,true,true,true,false,false,false,false,true,true,true,false,true,false,true,true,false,true,true},new boolean[]{false,false,true,false,true,true,true,true,false,true,true,true,true,false,false,true,false,true,false,false,false,true,true,true,false,true,true,true,false,false,false,false,false,true,true,false,true,true,false},new boolean[]{false,true,false,false,true,false,false,false,true,false,true,true,true,false,true,true,false,false,false,true,true,true,false,true,false,false,true,false,true,false,false,true,false,true,true,false,true,false,true},new boolean[]{true,true,true,false,true,true,true,false,false,false,false,true,true,false,false,false,true,false,false,true,false,false,false,true,true,false,false,false,true,true,false,true,false,true,false,false,false,true,false},new boolean[]{false,false,true,false,true,true,true,false,true,false,false,false,true,false,true,false,true,false,false,false,false,true,false,false,true,false,true,false,false,true,false,true,true,false,true,false,false,false,false},new boolean[]{true,false,true,true,true,false,true,true,false,true,false,true,false,false,false,true,true,true,true,true,false,true,true,false,true,true,true,true,false,false,true,false,false,false,false,true,false,false,false},new boolean[]{false,true,true,false,true,false,true,true,true,true,false,false,false,false,true,false,true,true,true,false,true,false,false,true,true,true,true,false,false,true,false,false,true,false,false,true,false,true,true},new boolean[]{false,false,false,false,true,false,false,true,true,true,false,true,true,false,true,false,false,false,true,true,true,true,true,false,false,true,false,false,true,false,true,false,false,false,true,true,true,false,false},new boolean[]{false,true,false,true,false,true,true,true,false,false,true,true,true,false,false,true,true,false,true,true,false,true,false,true,true,false,false,true,false,false,true,false,false,true,true,false,false,false,true},new boolean[]{false,false,true,false,true,true,false,false,false,true,true,true,true,true,false,true,false,false,false,false,false,false,true,false,false,false,false,false,true,true,false,false,false,true,false,true,true,false,false},new boolean[]{false,true,false,true,true,true,true,false,false,false,true,true,false,true,true,false,false,true,false,true,true,true,true,true,false,true,false,true,true,true,false,false,true,true,false,false,false,false,false},new boolean[]{true,true,false,false,true,true,true,false,false,false,true,true,true,true,false,true,false,false,true,true,false,true,true,true,false,true,true,false,false,false,true,true,false,false,false,false,true,false,true},new boolean[]{false,false,false,true,false,false,true,false,true,true,false,true,true,true,false,true,false,false,true,true,false,false,true,false,false,true,false,false,false,true,false,false,false,true,false,false,false,false,false},new boolean[]{false,true,false,false,true,false,true,true,true,false,true,true,true,true,true,false,false,false,true,false,true,true,true,false,true,false,true,false,false,true,true,true,true,true,false,true,true,true,true},new boolean[]{true,false,true,false,true,true,false,false,false,true,true,false,true,true,true,true,true,false,false,true,false,true,false,true,true,true,true,true,false,false,true,true,false,true,false,true,false,false,false},new boolean[]{true,true,false,false,false,false,false,true,true,true,false,true,false,true,true,true,false,true,false,true,true,false,true,true,true,false,false,true,true,true,false,true,false,true,true,false,true,false,true},new boolean[]{false,false,false,false,true,true,true,false,false,true,true,true,false,false,true,true,true,false,true,false,false,true,false,false,true,false,true,true,true,true,false,true,true,false,false,true,false,true,true},new boolean[]{false,true,true,false,true,true,true,true,false,false,true,false,false,true,true,true,false,false,false,true,true,true,false,true,true,true,true,false,true,false,true,false,false,false,true,false,false,true,true},new boolean[]{true,false,false,false,false,true,true,false,false,true,false,false,true,true,false,false,true,true,true,false,true,true,false,false,true,false,true,false,false,true,true,true,true,true,false,false,true,true,true},new boolean[]{true,true,true,false,false,true,false,true,false,true,true,true,true,false,false,true,true,true,false,false,false,true,false,false,false,false,false,true,true,true,false,true,true,false,false,false,true,true,true},new boolean[]{true,false,true,true,true,false,false,true,true,false,false,false,true,true,false,true,false,true,true,true,false,false,false,true,false,false,true,true,true,false,true,false,false,true,true,true,false,false,true},new boolean[]{false,false,false,true,true,false,false,false,true,true,false,false,false,true,false,true,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,true,false,false,true},new boolean[]{false,false,false,true,false,false,false,true,false,false,true,false,false,true,false,true,true,false,true,true,true,true,true,true,false,false,false,true,true,true,true,false,false,false,false,false,true,true,true},new boolean[]{false,true,false,true,true,false,true,true,true,true,true,true,false,false,true,true,true,true,false,false,true,false,true,false,true,true,true,true,true,true,false,true,true,true,true,false,true,true,false},new boolean[]{true,false,false,true,false,true,true,true,true,false,false,true,false,false,false,true,true,true,false,false,true,false,false,false,false,true,false,true,true,false,false,true,false,false,true,true,true,true,true},new boolean[]{false,true,true,true,false,false,true,false,false,true,false,false,true,true,true,false,false,true,false,false,false,true,false,true,true,true,false,true,false,false,true,true,false,false,false,true,false,true,false},new boolean[]{false,false,true,false,true,false,false,false,false,true,false,false,false,true,true,false,false,true,false,false,true,false,true,false,true,false,false,false,true,true,false,true,false,false,false,true,false,true,true},new boolean[]{false,true,false,false,true,true,true,true,true,true,false,false,true,false,true,false,false,true,true,true,true,false,false,true,false,true,false,true,true,true,true,true,true,false,true,false,false,true,true},new boolean[]{false,false,false,true,true,true,false,false,false,false,true,true,false,true,false,false,true,false,false,false,true,true,true,true,false,true,false,true,true,true,false,true,true,true,false,false,false,false,false},new boolean[]{false,false,true,true,true,false,true,false,true,true,true,true,false,true,false,true,false,false,true,false,false,true,false,true,false,true,false,true,true,false,false,false,true,false,false,false,true,false,true},new boolean[]{false,false,false,false,true,true,false,true,false,true,false,true,true,true,false,false,false,true,false,false,true,false,false,false,false,false,true,false,true,true,true,false,false,true,true,true,true,true,false},new boolean[]{true,true,true,true,false,false,false,true,false,false,false,true,false,false,true,false,false,false,false,false,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,false,true,true,true},new boolean[]{true,false,false,true,true,false,true,false,false,false,true,false,true,false,false,false,false,true,true,false,false,false,true,false,false,true,true,true,false,true,true,false,false,false,false,true,false,false,false},new boolean[]{true,true,false,true,true,false,true,true,false,false,true,true,true,false,true,false,true,false,true,false,true,false,true,true,true,true,false,false,false,false,false,true,true,false,false,true,true,false,false}}); param0.add(new boolean[][]{new boolean[]{false,false,false,false,false,true,true,true,true},new boolean[]{false,false,false,false,true,true,true,true,true},new boolean[]{false,false,false,false,false,true,true,true,true},new boolean[]{false,false,false,false,false,true,true,true,true},new boolean[]{false,false,false,false,false,false,true,true,true},new boolean[]{true,true,true,true,true,true,true,true,true},new boolean[]{false,false,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,true,true,true,true},new boolean[]{false,false,false,false,false,false,true,true,true}}); param0.add(new boolean[][]{new boolean[]{false,true,true,true,true,false,false,true,false,false,false,true,true,false,true,false,false,false,false,true,true,true,true,false,false},new boolean[]{false,true,false,false,false,false,true,true,true,true,false,true,true,false,true,true,true,false,true,false,true,true,false,false,true},new boolean[]{true,false,false,false,true,false,false,true,true,false,true,false,true,true,false,false,true,false,true,true,true,false,false,true,true},new boolean[]{false,true,true,false,true,true,true,true,false,true,false,false,false,true,false,false,false,false,true,false,true,true,false,true,false},new boolean[]{true,true,true,false,true,true,false,false,true,true,false,false,false,true,true,false,true,false,false,true,true,false,false,true,false},new boolean[]{true,false,false,true,false,false,true,false,true,true,true,false,false,true,false,true,true,false,false,false,false,false,true,true,false},new boolean[]{true,false,false,false,false,false,false,false,true,false,true,false,true,false,false,false,true,true,true,true,false,true,false,false,false},new boolean[]{true,false,true,false,false,false,false,false,true,false,true,false,true,false,true,false,false,true,true,false,false,true,false,true,false},new boolean[]{true,true,true,false,true,true,true,false,false,false,true,true,false,true,true,false,true,true,false,false,false,true,false,true,false},new boolean[]{true,false,true,false,true,false,true,true,false,true,true,false,false,true,true,true,true,true,false,false,true,false,true,true,false},new boolean[]{true,false,false,false,true,true,false,false,true,false,false,false,true,true,false,true,false,false,true,true,false,false,false,false,true},new boolean[]{false,true,false,true,true,false,true,false,false,true,false,false,false,false,false,true,false,true,true,true,false,true,true,false,false},new boolean[]{true,false,false,true,true,false,false,true,false,true,false,false,false,true,false,false,true,true,false,true,true,true,true,true,false},new boolean[]{false,true,true,true,true,false,false,false,false,true,true,true,true,false,true,true,false,false,true,true,true,true,true,true,false},new boolean[]{true,false,true,false,false,true,false,true,true,true,true,false,true,true,false,true,false,true,true,false,true,true,true,false,true},new boolean[]{true,true,true,false,false,false,true,false,true,false,true,false,true,true,false,false,true,true,true,false,false,true,true,false,true},new boolean[]{false,false,true,true,true,false,false,false,true,true,false,true,true,true,false,true,false,true,true,false,false,false,false,false,false},new boolean[]{false,false,false,true,true,true,true,false,false,true,true,true,false,true,true,false,true,true,true,false,false,true,false,true,false},new boolean[]{false,false,true,false,false,true,false,true,false,false,false,false,true,false,false,false,false,true,false,true,false,false,true,false,false},new boolean[]{false,false,true,true,false,false,false,true,true,true,false,false,true,false,false,true,true,false,false,false,false,true,false,true,false},new boolean[]{true,false,false,false,false,true,false,true,false,false,false,false,true,false,true,false,false,true,true,true,false,false,false,true,true},new boolean[]{false,true,false,false,true,false,false,true,false,true,true,true,true,false,true,false,true,true,false,true,true,false,false,false,false},new boolean[]{true,false,true,true,false,true,true,true,true,true,true,false,false,true,true,true,false,false,false,true,false,true,true,false,false},new boolean[]{true,true,true,false,true,false,true,true,true,false,true,true,true,false,false,false,false,true,false,true,true,true,true,false,true},new boolean[]{true,true,true,true,false,true,false,false,false,true,false,false,true,false,true,false,true,true,false,false,false,true,false,false,true}}); param0.add(new boolean[][]{new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true},new boolean[]{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true}}); param0.add(new boolean[][]{new boolean[]{true,false,true,false,false,false,true,true,false,true,false,true,true,true,false,false,false,false,true,false,true,false,false,true,false,false,true},new boolean[]{false,true,false,true,false,false,true,true,false,false,false,true,true,false,true,false,true,false,true,false,true,false,false,false,false,true,true},new boolean[]{true,false,true,true,true,false,false,true,true,true,true,true,true,true,true,false,false,false,true,false,true,true,false,false,true,false,true},new boolean[]{true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,true,false,false,true,true,true,false,false,true},new boolean[]{true,false,true,false,false,true,true,false,false,true,true,true,false,false,false,true,false,true,false,true,true,true,true,true,true,false,false},new boolean[]{true,false,false,true,true,false,false,true,false,true,true,true,true,false,false,true,true,true,false,false,true,false,false,true,true,true,false},new boolean[]{true,false,true,true,true,true,false,true,false,false,false,true,true,false,true,true,false,true,true,false,true,false,false,false,false,false,false},new boolean[]{true,false,false,true,false,false,true,true,true,false,true,false,false,false,true,true,true,true,false,true,false,false,true,false,true,false,true},new boolean[]{false,true,false,true,false,true,true,true,false,true,true,false,false,false,true,false,false,false,false,true,true,false,true,false,true,false,true},new boolean[]{false,true,true,true,false,true,false,true,false,true,true,false,true,true,true,true,true,true,true,false,true,true,false,false,true,false,true},new boolean[]{false,true,false,false,true,true,false,false,false,false,true,true,false,false,true,false,false,true,true,true,true,false,false,true,false,false,true},new boolean[]{false,false,true,true,false,true,true,true,false,false,false,false,true,false,true,false,true,false,false,true,false,false,true,true,true,false,false},new boolean[]{true,true,false,false,true,true,false,false,true,true,true,false,false,true,true,false,false,false,true,false,false,false,true,false,false,false,true},new boolean[]{false,true,true,true,false,true,true,true,false,false,false,false,false,true,true,false,false,false,false,false,true,false,true,true,false,true,false},new boolean[]{true,true,true,true,true,true,true,true,true,false,true,true,true,true,false,false,false,false,false,true,false,false,false,false,false,false,true},new boolean[]{false,false,false,true,false,false,false,false,false,true,false,false,false,false,false,false,false,true,false,true,false,true,false,true,false,true,false},new boolean[]{true,true,false,true,true,true,true,true,true,false,false,true,true,false,true,true,false,false,false,false,false,true,true,false,false,false,false},new boolean[]{false,false,false,false,true,true,true,false,true,true,false,true,false,false,true,true,false,false,false,false,true,true,false,true,true,false,false},new boolean[]{true,false,true,true,false,true,false,false,false,false,false,false,false,false,true,false,true,true,false,true,true,true,true,false,false,false,true},new boolean[]{true,false,false,false,true,false,true,false,true,true,false,false,false,true,false,true,true,true,false,false,false,true,false,true,true,false,true},new boolean[]{true,false,true,true,true,true,false,true,true,false,true,true,true,false,false,true,true,false,false,false,false,false,true,false,true,true,true},new boolean[]{true,true,false,false,false,true,false,true,true,true,true,false,true,true,true,true,true,true,false,false,false,false,true,true,false,false,false},new boolean[]{true,false,false,false,false,false,false,true,true,true,false,true,false,false,false,false,true,false,false,false,true,true,false,true,true,true,true},new boolean[]{false,true,true,true,true,false,false,false,true,true,false,true,false,false,false,true,false,false,true,true,true,false,false,false,true,true,true},new boolean[]{false,false,true,true,false,true,true,false,false,true,true,true,false,false,true,false,true,true,true,true,false,true,true,true,true,false,false},new boolean[]{true,true,false,true,false,true,false,true,true,false,false,true,false,false,true,true,false,false,true,true,false,true,true,true,true,false,false},new boolean[]{true,false,true,false,true,true,true,true,true,false,false,false,false,false,false,true,true,false,false,false,false,false,false,true,false,true,true}}); param0.add(new boolean[][]{new boolean[]{false,false,false,true},new boolean[]{false,true,true,true},new boolean[]{false,false,false,true},new boolean[]{false,true,true,true}}); param0.add(new boolean[][]{new boolean[]{true,true,false,false,true,true,true,true,true,false,true,true,false,true,true,false,false,false,false,false,true,false,true,false,true,true,false,true},new boolean[]{false,false,true,true,false,false,false,true,true,false,false,true,false,true,false,false,true,true,false,false,true,true,true,true,false,true,false,false},new boolean[]{true,true,false,false,false,true,false,true,true,true,false,true,false,true,false,false,true,true,false,true,true,false,true,true,false,false,false,false},new boolean[]{true,false,true,false,true,false,true,false,false,true,true,true,true,true,true,false,true,false,false,true,false,false,false,true,false,true,false,true},new boolean[]{true,true,true,true,false,false,false,true,true,false,true,false,true,false,true,true,true,true,false,false,true,true,true,true,false,true,true,true},new boolean[]{true,false,true,true,true,true,true,true,false,true,false,false,false,false,false,true,false,true,true,false,true,true,false,true,false,false,false,true},new boolean[]{true,true,false,false,false,true,true,false,true,false,true,false,false,false,true,true,true,false,false,true,true,false,true,false,false,false,true,false},new boolean[]{false,true,true,true,true,false,false,true,false,false,false,false,false,false,false,false,true,false,true,false,false,true,false,true,true,true,false,true},new boolean[]{true,false,true,false,false,false,true,false,true,true,true,true,false,true,true,true,false,false,true,true,false,false,false,false,true,false,false,false},new boolean[]{false,false,true,true,false,true,false,false,true,true,true,true,false,false,true,false,false,true,true,false,true,false,true,true,false,true,true,true},new boolean[]{true,false,true,true,true,true,false,true,true,true,false,true,true,false,false,false,true,false,true,true,true,true,true,false,false,false,false,false},new boolean[]{false,false,false,false,true,false,true,true,true,false,false,false,false,true,false,false,true,true,false,true,true,true,true,true,true,true,true,false},new boolean[]{false,false,false,true,true,false,false,true,false,false,false,false,true,true,true,true,false,false,true,true,true,true,true,true,true,true,false,false},new boolean[]{false,true,true,true,true,true,true,true,true,true,true,true,true,true,false,true,true,true,true,true,false,false,false,false,true,false,true,false},new boolean[]{false,true,false,false,false,true,true,false,false,true,false,true,false,true,false,true,true,false,true,true,false,false,true,false,true,false,false,true},new boolean[]{true,true,false,true,true,true,true,true,false,false,false,true,true,false,false,true,true,true,false,false,false,false,true,false,true,true,false,true},new boolean[]{true,false,true,false,false,false,true,true,false,true,true,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,true},new boolean[]{true,false,true,false,true,false,false,false,true,true,true,false,true,true,true,false,false,false,false,false,true,true,true,true,true,true,false,false},new boolean[]{true,false,true,false,true,true,true,false,false,false,false,false,false,false,true,true,false,false,false,true,true,true,true,false,true,false,false,false},new boolean[]{false,false,true,false,true,false,true,false,true,true,false,true,true,true,false,false,true,true,true,false,false,false,false,false,false,false,false,false},new boolean[]{true,false,true,false,true,true,true,true,false,true,true,false,false,true,true,false,true,false,true,true,true,true,true,true,false,false,true,false},new boolean[]{true,false,false,true,false,false,false,false,false,true,true,false,false,true,false,false,true,false,true,false,true,false,true,true,false,true,false,false},new boolean[]{false,true,true,true,true,true,true,false,false,true,true,false,true,false,true,true,true,false,true,true,true,true,false,true,false,false,false,false},new boolean[]{true,true,false,false,true,true,false,false,true,false,false,false,true,false,false,false,false,false,true,true,true,false,true,true,false,false,true,false},new boolean[]{false,true,true,true,true,true,true,true,false,true,false,false,false,true,true,false,false,true,true,false,false,true,false,true,true,false,true,false},new boolean[]{true,true,true,true,true,true,true,true,false,true,false,false,true,false,true,false,true,true,true,true,false,false,true,false,true,false,true,true},new boolean[]{true,false,true,true,true,false,false,true,false,true,true,false,false,false,true,true,true,false,false,true,false,false,true,true,true,true,false,true},new boolean[]{false,true,true,false,false,false,true,true,true,true,false,true,true,false,false,false,true,true,true,true,false,true,true,true,true,false,true,false}}); List<Integer> param1 = new ArrayList<>(); param1.add(2); param1.add(4); param1.add(2); param1.add(30); param1.add(7); param1.add(13); param1.add(19); param1.add(15); param1.add(3); param1.add(18); 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()); } }
null
null
CHECK_STRING_FOLLOWS_ANBN_PATTERN_NOT
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_STRING_FOLLOWS_ANBN_PATTERN_NOT{ public static boolean f_gold ( String s ) { int l = s . length ( ) ; if ( l % 2 == 1 ) { return false ; } int i = 0 ; int j = l - 1 ; while ( i < j ) { if ( s . charAt ( i ) != 'a' || s . charAt ( j ) != 'b' ) { return false ; } i ++ ; j -- ; } return true ; }
def f_gold ( str ) : n = len ( str ) for i in range ( n ) : if ( str [ i ] != 'a' ) : break if ( i * 2 != n ) : return False for j in range ( i , n ) : if ( str [ j ] != 'b' ) : return False return True
using namespace std; bool f_gold ( string str ) { int n = str . length ( ); int i; for ( i = 0; i < n; i ++ ) if ( str [ i ] != 'a' ) break; if ( i * 2 != n ) return false; int j; for ( j = i; j < n; j ++ ) if ( str [ j ] != 'b' ) return false; return true; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("ba"); param0.add("aabb"); param0.add("abab"); param0.add("aaabb"); param0.add("aabbb"); param0.add("abaabbaa"); param0.add("abaababb"); param0.add("bbaa"); param0.add("11001000"); param0.add("ZWXv te"); 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()); } }
if __name__ == '__main__': param = [ ('ba',), ('aabb',), ('abab',), ('aaabb',), ('aabbb',), ('abaabbaa',), ('abaababb',), ('bbaa',), ('11001000',), ('ZWXv te',) ] n_success = 0 for i, parameters_set in enumerate(param): if f_filled(*parameters_set) == f_gold(*parameters_set): n_success+=1 print("#Results: %i, %i" % (n_success, len(param)))
int main() { int n_success = 0; vector<string> param0 {"ba","aabb","abab","aaabb","aabbb","abaabbaa","abaababb","bbaa","11001000","ZWXv te"}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i]) == f_gold(param0[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }