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_DISTANCE_TWO_OCCURRENCES_ELEMENT_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_DISTANCE_TWO_OCCURRENCES_ELEMENT_ARRAY{ static int f_gold ( int [ ] arr , int n ) { HashMap < Integer , Integer > map = new HashMap < > ( ) ; int max_dist = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! map . containsKey ( arr [ i ] ) ) map . put ( arr [ i ] , i ) ; else max_dist = Math . max ( max_dist , i - map . get ( arr [ i ] ) ) ; } return max_dist ; }
def f_gold ( arr , n ) : mp = { } maxDict = 0 for i in range ( n ) : if arr [ i ] not in mp.keys ( ) : mp [ arr [ i ] ] = i else : maxDict = max ( maxDict , i - mp [ arr [ i ] ] ) return maxDict
using namespace std; int f_gold ( int arr [ ], int n ) { unordered_map < int, int > mp; int max_dist = 0; for ( int i = 0; i < n; i ++ ) { if ( mp . find ( arr [ i ] ) == mp . end ( ) ) mp [ arr [ i ] ] = i; else max_dist = max ( max_dist, i - mp [ arr [ i ] ] ); } return max_dist; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,20,25,28,29,31,34,35,38,39,41,43,46,55,56,60,65,66,74,77,79,80,81,83,84,88,88,88,90,91,99}); param0.add(new int[]{26,14,56,84,-56,-84,-98,12,-78,18,-42,58,46,-66,-46,66,98,34,-16,8,-20,66,74,26,42,-84,38,86,14,86,26,-42,-30,6,-54,-76,-66,18,58,66,74,-62,8,-42,62,-14,-90,98,-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,1,1}); param0.add(new int[]{69,87}); param0.add(new int[]{-98,-88,-86,-62,-52,-26,-24,-20,-12,6,8,26,36,40,42,54,68,72,84,92,94,98,98}); param0.add(new int[]{1,1,1,1,0,1,0,1,1,0,0,0,1,1,1,0,0,1,0,1,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0}); param0.add(new int[]{11,16,17,19,20,21,21,22,27,37,45,49,64,77,81,85,96}); param0.add(new int[]{-20,0,18,-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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{54,5,98,71,9,34,60,28,58,66,28,45,4}); List<Integer> param1 = new ArrayList<>(); param1.add(27); param1.add(34); param1.add(11); param1.add(1); param1.add(12); param1.add(29); param1.add(9); param1.add(2); param1.add(22); param1.add(10); 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, 20, 25, 28, 29, 31, 34, 35, 38, 39, 41, 43, 46, 55, 56, 60, 65, 66, 74, 77, 79, 80, 81, 83, 84, 88, 88, 88, 90, 91, 99],27,), ([26, 14, 56, 84, -56, -84, -98, 12, -78, 18, -42, 58, 46, -66, -46, 66, 98, 34, -16, 8, -20, 66, 74, 26, 42, -84, 38, 86, 14, 86, 26, -42, -30, 6, -54, -76, -66, 18, 58, 66, 74, -62, 8, -42, 62, -14, -90, 98, -24],34,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],11,), ([69, 87],1,), ([-98, -88, -86, -62, -52, -26, -24, -20, -12, 6, 8, 26, 36, 40, 42, 54, 68, 72, 84, 92, 94, 98, 98],12,), ([1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0],29,), ([11, 16, 17, 19, 20, 21, 21, 22, 27, 37, 45, 49, 64, 77, 81, 85, 96],9,), ([-20, 0, 18, -96],2,), ([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],22,), ([54, 5, 98, 71, 9, 34, 60, 28, 58, 66, 28, 45, 4],10,) ] 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,20,25,28,29,31,34,35,38,39,41,43,46,55,56,60,65,66,74,77,79,80,81,83,84,88,88,88,90,91,99},{26,14,56,84,-56,-84,-98,12,-78,18,-42,58,46,-66,-46,66,98,34,-16,8,-20,66,74,26,42,-84,38,86,14,86,26,-42,-30,6,-54,-76,-66,18,58,66,74,-62,8,-42,62,-14,-90,98,-24},{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},{69,87},{-98,-88,-86,-62,-52,-26,-24,-20,-12,6,8,26,36,40,42,54,68,72,84,92,94,98,98},{1,1,1,1,0,1,0,1,1,0,0,0,1,1,1,0,0,1,0,1,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0},{11,16,17,19,20,21,21,22,27,37,45,49,64,77,81,85,96},{-20,0,18,-96},{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},{54,5,98,71,9,34,60,28,58,66,28,45,4}}; vector<int> param1 {27,34,11,1,12,29,9,2,22,10}; 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; }
NTH_PENTAGONAL_NUMBER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NTH_PENTAGONAL_NUMBER{ static int f_gold ( int n ) { return ( 3 * n * n - n ) / 2 ; }
def f_gold ( n ) : return ( 3 * n * n - n ) / 2
using namespace std; int f_gold ( int n ) { return ( 3 * n * n - n ) / 2; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(96); param0.add(93); param0.add(15); param0.add(8); param0.add(21); param0.add(14); param0.add(11); param0.add(79); param0.add(24); param0.add(94); 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 = [ (96,), (93,), (15,), (8,), (21,), (14,), (11,), (79,), (24,), (94,) ] 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 {96,93,15,8,21,14,11,79,24,94}; 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
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{ static int f_gold ( int n ) { int count = 0 ; if ( n > 0 && ( n & ( n - 1 ) ) == 0 ) return n ; while ( n != 0 ) { n >>= 1 ; count += 1 ; } return 1 << count ; }
def f_gold ( n ) : count = 0 ; if ( n and not ( n & ( n - 1 ) ) ) : return n while ( n != 0 ) : n >>= 1 count += 1 return 1 << count ;
using namespace std; unsigned int f_gold ( unsigned int n ) { unsigned count = 0; if ( n && ! ( n & ( n - 1 ) ) ) return n; while ( n != 0 ) { n >>= 1; count += 1; } return 1 << count; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(13); param0.add(27); param0.add(1); param0.add(24); param0.add(98); param0.add(94); param0.add(36); param0.add(41); param0.add(74); param0.add(39); 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 = [ (13,), (27,), (1,), (24,), (98,), (94,), (36,), (41,), (74,), (39,) ] 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 {13,27,1,24,98,94,36,41,74,39}; 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_ELEMENT_TWO_SORTED_ARRAYS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class K_TH_ELEMENT_TWO_SORTED_ARRAYS{ static int f_gold ( int arr1 [ ] , int arr2 [ ] , int m , int n , int k ) { int [ ] sorted1 = new int [ m + n ] ; int i = 0 , j = 0 , d = 0 ; while ( i < m && j < n ) { if ( arr1 [ i ] < arr2 [ j ] ) sorted1 [ d ++ ] = arr1 [ i ++ ] ; else sorted1 [ d ++ ] = arr2 [ j ++ ] ; } while ( i < m ) sorted1 [ d ++ ] = arr1 [ i ++ ] ; while ( j < n ) sorted1 [ d ++ ] = arr2 [ j ++ ] ; return sorted1 [ k - 1 ] ; }
def f_gold ( arr1 , arr2 , m , n , k ) : sorted1 = [ 0 ] * ( m + n ) i = 0 j = 0 d = 0 while ( i < m and j < n ) : if ( arr1 [ i ] < arr2 [ j ] ) : sorted1 [ d ] = arr1 [ i ] i += 1 else : sorted1 [ d ] = arr2 [ j ] j += 1 d += 1 while ( i < m ) : sorted1 [ d ] = arr1 [ i ] d += 1 i += 1 while ( j < n ) : sorted1 [ d ] = arr2 [ j ] d += 1 j += 1 return sorted1 [ k - 1 ]
using namespace std; int f_gold ( int arr1 [ ], int arr2 [ ], int m, int n, int k ) { int sorted1 [ m + n ]; int i = 0, j = 0, d = 0; while ( i < m && j < n ) { if ( arr1 [ i ] < arr2 [ j ] ) sorted1 [ d ++ ] = arr1 [ i ++ ]; else sorted1 [ d ++ ] = arr2 [ j ++ ]; } while ( i < m ) sorted1 [ d ++ ] = arr1 [ i ++ ]; while ( j < n ) sorted1 [ d ++ ] = arr2 [ j ++ ]; return sorted1 [ k - 1 ]; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,2,4,4,9,10,14,16,16,19,20,21,25,26,29,36,36,37,38,44,44,49,53,54,56,61,62,64,72,72,73,77,80,84,84,87,93,94}); param0.add(new int[]{2,4,-90,62,22,-94,-74,-22,44,-94,20,-40,20,0,32,24,78,8,4,98,-74,-60}); 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,1,1,1,1,1}); param0.add(new int[]{85,44,62,2,71,88,60,78,32,46,17,47,65,78,65,94}); param0.add(new int[]{-94,-84,-82,-70,-70,-60,-54,-54,-52,-52,-46,-40,-40,-36,-34,-32,-30,-22,-18,-16,-10,-4,8,12,18,22,32,38,38,44,50,56,64,82,84,86,88}); param0.add(new int[]{0,0,0,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0,1,1,1,1,0,1,1,1}); param0.add(new int[]{53,96,99}); param0.add(new int[]{98,86,36,-68,86,22,52,-20,-2,74,-72,86,80,-78,14,62,10,94,-66,78,28,92,-8,46,-24,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,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[]{6,21,86,58,48,27,18,73,16,79,51,33,63,26,37,88,48,58,44,32,58,23,31}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{6,8,10,10,12,14,24,31,33,33,35,35,35,41,46,47,49,51,52,56,57,59,62,65,72,72,73,73,79,80,82,83,83,84,87,87,93,99}); param1.add(new int[]{58,74,-46,38,-58,-78,-32,-84,84,-54,84,-34,-26,88,74,48,26,-92,68,-86,74,88}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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[]{18,3,15,9,61,73,3,62,87,1,54,97,61,37,23,65}); param1.add(new int[]{-92,-68,-64,-62,-54,-52,-52,-34,-24,-22,-20,-12,-12,-10,6,10,14,22,22,24,24,30,30,36,36,48,50,56,58,64,68,80,84,88,88,92,94}); param1.add(new int[]{1,0,0,0,1,0,0,0,1,1,0,1,0,1,1,1,0,1,0,1,1,0,0,0,1,0}); param1.add(new int[]{30,55,56}); param1.add(new int[]{72,-72,-90,24,-22,60,78,-68,98,26,-30,-20,44,-96,8,90,0,98,-24,-68,-32,-62,0,-60,26,-98}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{87,77,44,15,70,89,36,79,82,3,18,76,37,79,85,97,19,53,17,74,87,58,49}); List<Integer> param2 = new ArrayList<>(); param2.add(27); param2.add(18); param2.add(30); param2.add(11); param2.add(19); param2.add(24); param2.add(1); param2.add(22); param2.add(42); param2.add(14); List<Integer> param3 = new ArrayList<>(); param3.add(21); param3.add(11); param3.add(31); param3.add(11); param3.add(26); param3.add(17); param3.add(1); param3.add(19); param3.add(40); param3.add(22); List<Integer> param4 = new ArrayList<>(); param4.add(23); param4.add(12); param4.add(42); param4.add(13); param4.add(28); param4.add(23); param4.add(1); param4.add(24); param4.add(42); param4.add(19); 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, 2, 4, 4, 9, 10, 14, 16, 16, 19, 20, 21, 25, 26, 29, 36, 36, 37, 38, 44, 44, 49, 53, 54, 56, 61, 62, 64, 72, 72, 73, 77, 80, 84, 84, 87, 93, 94],[6, 8, 10, 10, 12, 14, 24, 31, 33, 33, 35, 35, 35, 41, 46, 47, 49, 51, 52, 56, 57, 59, 62, 65, 72, 72, 73, 73, 79, 80, 82, 83, 83, 84, 87, 87, 93, 99],27,21,23,), ([2, 4, -90, 62, 22, -94, -74, -22, 44, -94, 20, -40, 20, 0, 32, 24, 78, 8, 4, 98, -74, -60],[58, 74, -46, 38, -58, -78, -32, -84, 84, -54, 84, -34, -26, 88, 74, 48, 26, -92, 68, -86, 74, 88],18,11,12,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],30,31,42,), ([85, 44, 62, 2, 71, 88, 60, 78, 32, 46, 17, 47, 65, 78, 65, 94],[18, 3, 15, 9, 61, 73, 3, 62, 87, 1, 54, 97, 61, 37, 23, 65],11,11,13,), ([-94, -84, -82, -70, -70, -60, -54, -54, -52, -52, -46, -40, -40, -36, -34, -32, -30, -22, -18, -16, -10, -4, 8, 12, 18, 22, 32, 38, 38, 44, 50, 56, 64, 82, 84, 86, 88],[-92, -68, -64, -62, -54, -52, -52, -34, -24, -22, -20, -12, -12, -10, 6, 10, 14, 22, 22, 24, 24, 30, 30, 36, 36, 48, 50, 56, 58, 64, 68, 80, 84, 88, 88, 92, 94],19,26,28,), ([0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1],[1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0],24,17,23,), ([53, 96, 99],[30, 55, 56],1,1,1,), ([98, 86, 36, -68, 86, 22, 52, -20, -2, 74, -72, 86, 80, -78, 14, 62, 10, 94, -66, 78, 28, 92, -8, 46, -24, 66],[72, -72, -90, 24, -22, 60, 78, -68, 98, 26, -30, -20, 44, -96, 8, 90, 0, 98, -24, -68, -32, -62, 0, -60, 26, -98],22,19,24,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],42,40,42,), ([6, 21, 86, 58, 48, 27, 18, 73, 16, 79, 51, 33, 63, 26, 37, 88, 48, 58, 44, 32, 58, 23, 31],[87, 77, 44, 15, 70, 89, 36, 79, 82, 3, 18, 76, 37, 79, 85, 97, 19, 53, 17, 74, 87, 58, 49],14,22,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<vector<int>> param0 {{2,2,4,4,9,10,14,16,16,19,20,21,25,26,29,36,36,37,38,44,44,49,53,54,56,61,62,64,72,72,73,77,80,84,84,87,93,94},{2,4,-90,62,22,-94,-74,-22,44,-94,20,-40,20,0,32,24,78,8,4,98,-74,-60},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,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},{85,44,62,2,71,88,60,78,32,46,17,47,65,78,65,94},{-94,-84,-82,-70,-70,-60,-54,-54,-52,-52,-46,-40,-40,-36,-34,-32,-30,-22,-18,-16,-10,-4,8,12,18,22,32,38,38,44,50,56,64,82,84,86,88},{0,0,0,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0,1,1,1,1,0,1,1,1},{53,96,99},{98,86,36,-68,86,22,52,-20,-2,74,-72,86,80,-78,14,62,10,94,-66,78,28,92,-8,46,-24,66},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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},{6,21,86,58,48,27,18,73,16,79,51,33,63,26,37,88,48,58,44,32,58,23,31}}; vector<vector<int>> param1 {{6,8,10,10,12,14,24,31,33,33,35,35,35,41,46,47,49,51,52,56,57,59,62,65,72,72,73,73,79,80,82,83,83,84,87,87,93,99},{58,74,-46,38,-58,-78,-32,-84,84,-54,84,-34,-26,88,74,48,26,-92,68,-86,74,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,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{18,3,15,9,61,73,3,62,87,1,54,97,61,37,23,65},{-92,-68,-64,-62,-54,-52,-52,-34,-24,-22,-20,-12,-12,-10,6,10,14,22,22,24,24,30,30,36,36,48,50,56,58,64,68,80,84,88,88,92,94},{1,0,0,0,1,0,0,0,1,1,0,1,0,1,1,1,0,1,0,1,1,0,0,0,1,0},{30,55,56},{72,-72,-90,24,-22,60,78,-68,98,26,-30,-20,44,-96,8,90,0,98,-24,-68,-32,-62,0,-60,26,-98},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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},{87,77,44,15,70,89,36,79,82,3,18,76,37,79,85,97,19,53,17,74,87,58,49}}; vector<int> param2 {27,18,30,11,19,24,1,22,42,14}; vector<int> param3 {21,11,31,11,26,17,1,19,40,22}; vector<int> param4 {23,12,42,13,28,23,1,24,42,19}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),&param1[i].front(),param2[i],param3[i],param4[i]) == f_gold(&param0[i].front(),&param1[i].front(),param2[i],param3[i],param4[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
FIND_POSITION_GIVEN_NUMBER_AMONG_NUMBERS_MADE_4_7
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_POSITION_GIVEN_NUMBER_AMONG_NUMBERS_MADE_4_7{ static int f_gold ( String n ) { int k = 0 , pos = 0 , i = 0 ; while ( k != n . length ( ) ) { switch ( n . charAt ( i ) ) { case '4' : pos = pos * 2 + 1 ; break ; case '7' : pos = pos * 2 + 2 ; break ; } i ++ ; k ++ ; } return pos ; }
def f_gold(n): i = 0 j = len(n) pos = 0 while (i < j): if (n[i] == '4'): pos = pos * 2 + 1 if (n[i] == '7'): pos = pos * 2 + 2 i = i + 1 return pos
using namespace std; int f_gold ( string n ) { int i = 0, pos = 0; while ( n [ i ] != '\0' ) { switch ( n [ i ] ) { case '4' : pos = pos * 2 + 1; break; case '7' : pos = pos * 2 + 2; break; } i ++; } return pos; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("7"); param0.add("305745689"); param0.add("444"); param0.add("4"); param0.add("2074"); param0.add("27"); param0.add("447"); param0.add("255"); param0.add("10000111111011"); param0.add("fAKcSDRTNz"); 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 = [ ('7',), ('305745689',), ('444',), ('4',), ('2074',), ('27',), ('447',), ('255',), ('10000111111011',), ('fAKcSDRTNz',) ] 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 {"7","305745689","444","4","2074","27","447","255","10000111111011","fAKcSDRTNz"}; 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_WHETHER_A_GIVEN_NUMBER_IS_A_POWER_OF_4_OR_NOT
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_WHETHER_A_GIVEN_NUMBER_IS_A_POWER_OF_4_OR_NOT{ static int f_gold ( int n ) { if ( n == 0 ) return 0 ; while ( n != 1 ) { if ( n % 4 != 0 ) return 0 ; n = n / 4 ; } return 1 ; }
def f_gold ( n ) : if ( n == 0 ) : return False while ( n != 1 ) : if ( n % 4 != 0 ) : return False n = n // 4 return True
null
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(45); param0.add(16); param0.add(15); param0.add(91); param0.add(82); param0.add(18); param0.add(31); param0.add(6); param0.add(93); 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 = [ (45,), (16,), (15,), (91,), (82,), (18,), (31,), (6,), (93,), (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)))
null
QUICK_WAY_CHECK_CHARACTERS_STRING
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class QUICK_WAY_CHECK_CHARACTERS_STRING{ static boolean f_gold ( String s ) { int n = s . length ( ) ; for ( int i = 1 ; i < n ; i ++ ) if ( s . charAt ( i ) != s . charAt ( 0 ) ) return false ; return true ; }
def f_gold ( s ) : n = len ( s ) for i in range ( 1 , n ) : if s [ i ] != s [ 0 ] : return False return True
using namespace std; bool f_gold ( string s ) { int n = s . length ( ); for ( int i = 1; i < n; i ++ ) if ( s [ i ] != s [ 0 ] ) return false; return true; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add(""); param0.add("ggg"); param0.add("11"); param0.add("KoYIHns"); param0.add("232"); param0.add("10111000011101"); param0.add("DDDD"); param0.add("11"); param0.add("11111"); param0.add("ewJvixQzu"); 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 = [ ('',), ('ggg',), ('11',), ('KoYIHns',), ('232',), ('10111000011101',), ('DDDD',), ('11',), ('11111',), ('ewJvixQzu',) ] 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 {"","ggg","11","KoYIHns","232","10111000011101","DDDD","11","11111","ewJvixQzu"}; 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_ROTATION_COUNT_ROTATED_SORTED_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_ROTATION_COUNT_ROTATED_SORTED_ARRAY{ static int f_gold ( int arr [ ] , int n ) { int min = arr [ 0 ] , min_index = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( min > arr [ i ] ) { min = arr [ i ] ; min_index = i ; } } return min_index ; }
null
using namespace std; int f_gold ( int arr [ ], int n ) { int min = arr [ 0 ], min_index; for ( int i = 0; i < n; i ++ ) { if ( min > arr [ i ] ) { min = arr [ i ]; min_index = i; } } return min_index; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,4,4,9,10,13,14,15,28,28,41,46,47,48,52,55,62,67,69,73,74,79,79,80,87,90,96,99}); param0.add(new int[]{44,62,-40,62,98,30,16,76,-4,-2,78,-96,78,-72,94,-66,-38,-80,40,78,-26,28,-40,-32,-64,76,26,-2,12,82,16,-46,10,70,-62,-54,-6,58,32,98}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{90,26,71,74,69,47,76,96,42,31,22,17,84,20,8,98,49,87,38,53,28,77,29}); param0.add(new int[]{-64,-56,-10,-10,-6,-2,0,22,78,86,98}); param0.add(new int[]{0,1,1,1,1,0,1}); param0.add(new int[]{2,3,3,5,8,10,11,16,17,26,35,36,38,42,59,73,73,75,75,81,82,82,86,87,88,88,90,95,96,98,98,99}); param0.add(new int[]{-96,70,-32,-46,-26,42,-56,36,-72,96,-54,-12,78,30,58,92,56,22,70,10,42,70,0,-76,58,-70,-66,-32,-30,-22,56,10,18,-90,-40,-92,-70,-30,48,10,32,20,-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,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[]{35,52,21,28,96,44,80,56,10,23,48,52,15,55,43,50,6,33,62,55,39,12,31,74,53,34,41,10,52,75,57,78,3}); List<Integer> param1 = new ArrayList<>(); param1.add(27); param1.add(38); param1.add(11); param1.add(18); param1.add(9); param1.add(5); param1.add(29); param1.add(42); param1.add(28); 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()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{2,4,4,9,10,13,14,15,28,28,41,46,47,48,52,55,62,67,69,73,74,79,79,80,87,90,96,99},{44,62,-40,62,98,30,16,76,-4,-2,78,-96,78,-72,94,-66,-38,-80,40,78,-26,28,-40,-32,-64,76,26,-2,12,82,16,-46,10,70,-62,-54,-6,58,32,98},{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},{90,26,71,74,69,47,76,96,42,31,22,17,84,20,8,98,49,87,38,53,28,77,29},{-64,-56,-10,-10,-6,-2,0,22,78,86,98},{0,1,1,1,1,0,1},{2,3,3,5,8,10,11,16,17,26,35,36,38,42,59,73,73,75,75,81,82,82,86,87,88,88,90,95,96,98,98,99},{-96,70,-32,-46,-26,42,-56,36,-72,96,-54,-12,78,30,58,92,56,22,70,10,42,70,0,-76,58,-70,-66,-32,-30,-22,56,10,18,-90,-40,-92,-70,-30,48,10,32,20,-52},{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},{35,52,21,28,96,44,80,56,10,23,48,52,15,55,43,50,6,33,62,55,39,12,31,74,53,34,41,10,52,75,57,78,3}}; vector<int> param1 {27,38,11,18,9,5,29,42,28,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; }
SWAP_ALL_ODD_AND_EVEN_BITS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SWAP_ALL_ODD_AND_EVEN_BITS{ static int f_gold ( int x ) { int even_bits = x & 0xAAAAAAAA ; int odd_bits = x & 0x55555555 ; even_bits >>= 1 ; odd_bits <<= 1 ; return ( even_bits | odd_bits ) ; }
def f_gold ( x ) : even_bits = x & 0xAAAAAAAA odd_bits = x & 0x55555555 even_bits >>= 1 odd_bits <<= 1 return ( even_bits | odd_bits )
using namespace std; unsigned int f_gold ( unsigned int x ) { unsigned int even_bits = x & 0xAAAAAAAA; unsigned int odd_bits = x & 0x55555555; even_bits >>= 1; odd_bits <<= 1; return ( even_bits | odd_bits ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(99); param0.add(94); param0.add(11); param0.add(3); param0.add(77); param0.add(57); param0.add(54); param0.add(66); param0.add(98); param0.add(36); 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 = [ (99,), (94,), (11,), (3,), (77,), (57,), (54,), (66,), (98,), (36,) ] 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 {99,94,11,3,77,57,54,66,98,36}; 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; }
QUERIES_COUNTS_ARRAY_ELEMENTS_VALUES_GIVEN_RANGE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class QUERIES_COUNTS_ARRAY_ELEMENTS_VALUES_GIVEN_RANGE{ static int f_gold ( int arr [ ] , int n , int x , int y ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] >= x && arr [ i ] <= y ) count ++ ; } return count ; }
def f_gold ( arr , n , x , y ) : count = 0 ; for i in range ( n ) : if ( arr [ i ] >= x and arr [ i ] <= y ) : count += 1 return count
using namespace std; int f_gold ( int arr [ ], int n, int x, int y ) { int count = 0; for ( int i = 0; i < n; i ++ ) { if ( arr [ i ] >= x && arr [ i ] <= y ) count ++; } return count; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{9,16,19,24,36,38,42,49,51,53,53,57,57,58,71,78,78,92,92,93}); param0.add(new int[]{28,-74,-18,10,26,28,-96,-80,82,94,22,50,72,-90,76,50,20,-44,-80}); 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,8,66,90,50,65,76,90,27}); param0.add(new int[]{-98,-96,-90,-82,-80,-78,-70,-66,-60,-60,-50,-48,-34,-26,-24,-16,-14,-8,-6,4,22,24,26,30,30,48,52,56,60,62,74,76,78,86}); param0.add(new int[]{1,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,0,0}); param0.add(new int[]{4,6,17,19,24,29,30,31,32,37,37,40,43,44,44,45,57,64,69,70,73,78,86,89,91,92,94}); param0.add(new int[]{32,-88,70,-6,28,-48}); 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[]{37,84,97,74,12,26,47,10,14,33}); List<Integer> param1 = new ArrayList<>(); param1.add(13); param1.add(18); param1.add(30); param1.add(4); param1.add(32); param1.add(15); param1.add(17); param1.add(4); param1.add(13); param1.add(5); List<Integer> param2 = new ArrayList<>(); param2.add(12); param2.add(13); param2.add(21); param2.add(8); param2.add(24); param2.add(16); param2.add(21); param2.add(3); param2.add(12); param2.add(9); List<Integer> param3 = new ArrayList<>(); param3.add(13); param3.add(13); param3.add(31); param3.add(5); param3.add(24); param3.add(12); param3.add(15); param3.add(4); param3.add(11); param3.add(8); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i)) == 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 = [ ([9, 16, 19, 24, 36, 38, 42, 49, 51, 53, 53, 57, 57, 58, 71, 78, 78, 92, 92, 93],13,12,13,), ([28, -74, -18, 10, 26, 28, -96, -80, 82, 94, 22, 50, 72, -90, 76, 50, 20, -44, -80],18,13,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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],30,21,31,), ([25, 8, 66, 90, 50, 65, 76, 90, 27],4,8,5,), ([-98, -96, -90, -82, -80, -78, -70, -66, -60, -60, -50, -48, -34, -26, -24, -16, -14, -8, -6, 4, 22, 24, 26, 30, 30, 48, 52, 56, 60, 62, 74, 76, 78, 86],32,24,24,), ([1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0],15,16,12,), ([4, 6, 17, 19, 24, 29, 30, 31, 32, 37, 37, 40, 43, 44, 44, 45, 57, 64, 69, 70, 73, 78, 86, 89, 91, 92, 94],17,21,15,), ([32, -88, 70, -6, 28, -48],4,3,4,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],13,12,11,), ([37, 84, 97, 74, 12, 26, 47, 10, 14, 33],5,9,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 {{9,16,19,24,36,38,42,49,51,53,53,57,57,58,71,78,78,92,92,93},{28,-74,-18,10,26,28,-96,-80,82,94,22,50,72,-90,76,50,20,-44,-80},{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,8,66,90,50,65,76,90,27},{-98,-96,-90,-82,-80,-78,-70,-66,-60,-60,-50,-48,-34,-26,-24,-16,-14,-8,-6,4,22,24,26,30,30,48,52,56,60,62,74,76,78,86},{1,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,0,0},{4,6,17,19,24,29,30,31,32,37,37,40,43,44,44,45,57,64,69,70,73,78,86,89,91,92,94},{32,-88,70,-6,28,-48},{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},{37,84,97,74,12,26,47,10,14,33}}; vector<int> param1 {13,18,30,4,32,15,17,4,13,5}; vector<int> param2 {12,13,21,8,24,16,21,3,12,9}; vector<int> param3 {13,13,31,5,24,12,15,4,11,8}; 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; }
CALCULATE_ANGLE_HOUR_HAND_MINUTE_HAND
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CALCULATE_ANGLE_HOUR_HAND_MINUTE_HAND{ static int f_gold ( double h , double m ) { if ( h < 0 || m < 0 || h > 12 || m > 60 ) System . out . println ( "Wrong input" ) ; if ( h == 12 ) h = 0 ; if ( m == 60 ) m = 0 ; int hour_angle = ( int ) ( 0.5 * ( h * 60 + m ) ) ; int minute_angle = ( int ) ( 6 * m ) ; int angle = Math . abs ( hour_angle - minute_angle ) ; angle = Math . min ( 360 - angle , angle ) ; return angle ; }
def f_gold ( h , m ) : if ( h < 0 or m < 0 or h > 12 or m > 60 ) : print ( 'Wrong input' ) if ( h == 12 ) : h = 0 if ( m == 60 ) : m = 0 hour_angle = 0.5 * ( h * 60 + m ) minute_angle = 6 * m angle = abs ( hour_angle - minute_angle ) angle = min ( 360 - angle , angle ) return angle
using namespace std; int f_gold ( double h, double m ) { if ( h < 0 || m < 0 || h > 12 || m > 60 ) printf ( "Wrong input" ); if ( h == 12 ) h = 0; if ( m == 60 ) m = 0; int hour_angle = 0.5 * ( h * 60 + m ); int minute_angle = 6 * m; int angle = abs ( hour_angle - minute_angle ); angle = min ( 360 - angle, angle ); return angle; }
public static void main(String args[]) { int n_success = 0; List<Double> param0 = new ArrayList<>(); param0.add(7322.337365895532); param0.add(-0.5025472034247969); param0.add(8735.336068205026); param0.add(-5478.862697905712); param0.add(8264.126919165505); param0.add(-9671.311773842834); param0.add(9995.328351000411); param0.add(-5274.574323066984); param0.add(1310.8711644223736); param0.add(-2829.678131972794); List<Double> param1 = new ArrayList<>(); param1.add(6996.326968156217); param1.add(-2910.070017192333); param1.add(1910.3752934680874); param1.add(-9470.18148108585); param1.add(7058.937313484608); param1.add(-3867.070379361206); param1.add(2145.339179488316); param1.add(-3583.7503371694124); param1.add(5214.059687285893); param1.add(-9371.556600288217); 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 = [ (7322.337365895532,6996.326968156217,), (-0.5025472034247969,-2910.070017192333,), (8735.336068205026,1910.3752934680874,), (-5478.862697905712,-9470.18148108585,), (8264.126919165505,7058.937313484608,), (-9671.311773842834,-3867.070379361206,), (9995.328351000411,2145.339179488316,), (-5274.574323066984,-3583.7503371694124,), (1310.8711644223736,5214.059687285893,), (-2829.678131972794,-9371.556600288217,) ] 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<double> param0 {7322.337365895532,-0.5025472034247969,8735.336068205026,-5478.862697905712,8264.126919165505,-9671.311773842834,9995.328351000411,-5274.574323066984,1310.8711644223736,-2829.678131972794}; vector<double> param1 {6996.326968156217,-2910.070017192333,1910.3752934680874,-9470.18148108585,7058.937313484608,-3867.070379361206,2145.339179488316,-3583.7503371694124,5214.059687285893,-9371.556600288217}; 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; }
TRIANGULAR_MATCHSTICK_NUMBER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class TRIANGULAR_MATCHSTICK_NUMBER{ public static int f_gold ( int x ) { return ( 3 * x * ( x + 1 ) ) / 2 ; }
def f_gold ( x ) : return ( 3 * x * ( x + 1 ) ) / 2
using namespace std; int f_gold ( int x ) { return ( 3 * x * ( x + 1 ) ) / 2; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(6); param0.add(25); param0.add(15); param0.add(30); param0.add(17); param0.add(80); param0.add(27); param0.add(13); param0.add(12); param0.add(67); 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 = [ (6,), (25,), (15,), (30,), (17,), (80,), (27,), (13,), (12,), (67,) ] 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 {6,25,15,30,17,80,27,13,12,67}; 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_REVERSING_SUB_ARRAY_MAKE_ARRAY_SORTED_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_REVERSING_SUB_ARRAY_MAKE_ARRAY_SORTED_1{ static boolean f_gold ( int arr [ ] , int n ) { if ( n == 1 ) { return true ; } int i ; for ( i = 1 ; arr [ i - 1 ] < arr [ i ] && i < n ; i ++ ) ; if ( i == n ) { return true ; } int j = i ++ ; while ( arr [ j ] < arr [ j - 1 ] ) { if ( i > 1 && arr [ j ] < arr [ i - 2 ] ) { return false ; } j ++ ; } if ( j == n ) { return true ; } int k = j ; if ( arr [ k ] < arr [ i - 1 ] ) { return false ; } while ( k > 1 && k < n ) { if ( arr [ k ] < arr [ k - 1 ] ) { return false ; } k ++ ; } return true ; }
def f_gold ( arr , n ) : if ( n == 1 ) : return True i = 1 for i in range ( 1 , n ) : if arr [ i - 1 ] < arr [ i ] : if ( i == n ) : return True j = i while ( arr [ j ] < arr [ j - 1 ] ) : if ( i > 1 and arr [ j ] < arr [ i - 2 ] ) : return False j += 1 if ( j == n ) : return True k = j if ( arr [ k ] < arr [ i - 1 ] ) : return False while ( k > 1 and k < n ) : if ( arr [ k ] < arr [ k - 1 ] ) : return False k += 1 return True
using namespace std; bool f_gold ( int arr [ ], int n ) { if ( n == 1 ) return true; int i; for ( i = 1; i < n && arr [ i - 1 ] < arr [ i ]; i ++ ); if ( i == n ) return true; int j = i; while ( arr [ j ] < arr [ j - 1 ] ) { if ( i > 1 && arr [ j ] < arr [ i - 2 ] ) return false; j ++; } if ( j == n ) return true; int k = j; if ( arr [ k ] < arr [ i - 1 ] ) return false; while ( k > 1 && k < n ) { if ( arr [ k ] < arr [ k - 1 ] ) return false; k ++; } return true; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,2,5,4,3}); param0.add(new int[]{1,2,4,5,3}); param0.add(new int[]{1,1,0,0}); param0.add(new int[]{5,99,40,33,61,4,64,92,28,27,21,35,40,79,10,20,76,87,80,15,57,39,96,98,99,72,72,50,61,39,35,70,27}); param0.add(new int[]{-98,-92,-86,-58,-22,-12,0,26}); param0.add(new int[]{0,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,0,1,0,1,0,1,1,1,0,1,1,0}); param0.add(new int[]{6,10,27,30,40,47,49,55,59,60,68,82,91}); param0.add(new int[]{36,56,-56,94,52,-82,88,-62,70,-94,38,10,-78,66,-94,-72,18,96,-72,88,-6,48,6,-88,64,-96,-40,8,36,36,-90,-68,-20,-76,22,-92}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{2,5,42,28,47,26,88,16,30,30,36,49,21,95,99,21,41,52,57,39,69,2,42,22,55,92,64,27,95,71,19,38,40,65,7,21,29,38,13,11,41,54,38,40,35,51,88}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(5); param1.add(4); param1.add(32); param1.add(6); param1.add(24); param1.add(8); param1.add(30); param1.add(31); param1.add(46); 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,2,5,4,3],5,), ([1,2,4,5,3],5,), ([1,1,0,0],4,), ([5, 99, 40, 33, 61, 4, 64, 92, 28, 27, 21, 35, 40, 79, 10, 20, 76, 87, 80, 15, 57, 39, 96, 98, 99, 72, 72, 50, 61, 39, 35, 70, 27],32,), ([-98, -92, -86, -58, -22, -12, 0, 26],6,), ([0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0],24,), ([6, 10, 27, 30, 40, 47, 49, 55, 59, 60, 68, 82, 91],8,), ([36, 56, -56, 94, 52, -82, 88, -62, 70, -94, 38, 10, -78, 66, -94, -72, 18, 96, -72, 88, -6, 48, 6, -88, 64, -96, -40, 8, 36, 36, -90, -68, -20, -76, 22, -92],30,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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],31,), ([2, 5, 42, 28, 47, 26, 88, 16, 30, 30, 36, 49, 21, 95, 99, 21, 41, 52, 57, 39, 69, 2, 42, 22, 55, 92, 64, 27, 95, 71, 19, 38, 40, 65, 7, 21, 29, 38, 13, 11, 41, 54, 38, 40, 35, 51, 88],46,) ] 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,5,4,3}, {1,2,4,5,3}, {1,1,0,0}, {5,99,40,33,61,4,64,92,28,27,21,35,40,79,10,20,76,87,80,15,57,39,96,98,99,72,72,50,61,39,35,70,27}, {-98,-92,-86,-58,-22,-12,0,26}, {0,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,0,1,0,1,0,1,1,1,0,1,1,0}, {6,10,27,30,40,47,49,55,59,60,68,82,91}, {36,56,-56,94,52,-82,88,-62,70,-94,38,10,-78,66,-94,-72,18,96,-72,88,-6,48,6,-88,64,-96,-40,8,36,36,-90,-68,-20,-76,22,-92}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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}, {2,5,42,28,47,26,88,16,30,30,36,49,21,95,99,21,41,52,57,39,69,2,42,22,55,92,64,27,95,71,19,38,40,65,7,21,29,38,13,11,41,54,38,40,35,51,88}}; vector<int> param1 {5,5,4,32,6,24,8,30,31,46}; 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_FIND_LARGEST_ELEMENT_ARRAY_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class C_PROGRAM_FIND_LARGEST_ELEMENT_ARRAY_1{ static int f_gold ( int [ ] arr , int n ) { Arrays . sort ( arr ) ; return arr [ n - 1 ] ; }
def f_gold ( arr , n ) : return max ( arr )
using namespace std; int f_gold ( int arr [ ], int n ) { return * max_element ( arr, arr + n ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{10,12,14,16,17,17,20,24,26,28,37,38,41,45,49,50,59,61,63,65,65,66,69,70,70,73,73,74,81,81,83,87,94,97}); param0.add(new int[]{-56,38,-22,84,-60,2,68,-78,62,-98,24,26,48,62,-80,-14,-84,12,-54,-12,-20,-82,10,-34,-50,-72,78,16,30,-76,72,34,6,52,44,18,-38,48,-14}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{92,5,40,65,86,51,14,29,66,6,62,92,29,13,88,54,15,60,45,2,51,9,33,51,31,11,62,61,77,38,11,4,27,54,72,64,85,46,24,44,39,73,82,85}); param0.add(new int[]{-92,-90,-84,-80,-80,-76,-70,-70,-48,-44,-38,-28,-14,-14,-12,-2,2,4,6,10,16,16,20,22,24,26,50,52,56,56,58,58,74,80,82,84,86}); param0.add(new int[]{0,1,0,0,0,0,1,1,0,0,1,0,0,0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,0,0,0,0,0,1,0}); param0.add(new int[]{5,19,20,26,31,32,34,37,39,40,46,46,50,53,58,58,59,65,72,72,75,76,77,78,81,83,83,95,98,99}); param0.add(new int[]{32,-84,-84,86,-24,36,-12,82,48,-12,82,-76,84,-20,-12,-18,46,-74,-14,-86}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{95,73,74,14,73,74,19,93,34,53,85,75,80,15,36,57,15,98,51,37,8,9,62,71,28,24,37,53,84,76,22,48,15,19,43,88,58,38,63,68,27,22,37,76,59,66,22}); List<Integer> param1 = new ArrayList<>(); param1.add(17); param1.add(25); param1.add(11); param1.add(40); param1.add(33); param1.add(29); param1.add(28); param1.add(14); param1.add(33); param1.add(34); 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 = [ ([10, 12, 14, 16, 17, 17, 20, 24, 26, 28, 37, 38, 41, 45, 49, 50, 59, 61, 63, 65, 65, 66, 69, 70, 70, 73, 73, 74, 81, 81, 83, 87, 94, 97],17,), ([-56, 38, -22, 84, -60, 2, 68, -78, 62, -98, 24, 26, 48, 62, -80, -14, -84, 12, -54, -12, -20, -82, 10, -34, -50, -72, 78, 16, 30, -76, 72, 34, 6, 52, 44, 18, -38, 48, -14],25,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1],11,), ([92, 5, 40, 65, 86, 51, 14, 29, 66, 6, 62, 92, 29, 13, 88, 54, 15, 60, 45, 2, 51, 9, 33, 51, 31, 11, 62, 61, 77, 38, 11, 4, 27, 54, 72, 64, 85, 46, 24, 44, 39, 73, 82, 85],40,), ([-92, -90, -84, -80, -80, -76, -70, -70, -48, -44, -38, -28, -14, -14, -12, -2, 2, 4, 6, 10, 16, 16, 20, 22, 24, 26, 50, 52, 56, 56, 58, 58, 74, 80, 82, 84, 86],33,), ([0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0],29,), ([5, 19, 20, 26, 31, 32, 34, 37, 39, 40, 46, 46, 50, 53, 58, 58, 59, 65, 72, 72, 75, 76, 77, 78, 81, 83, 83, 95, 98, 99],28,), ([32, -84, -84, 86, -24, 36, -12, 82, 48, -12, 82, -76, 84, -20, -12, -18, 46, -74, -14, -86],14,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],33,), ([95, 73, 74, 14, 73, 74, 19, 93, 34, 53, 85, 75, 80, 15, 36, 57, 15, 98, 51, 37, 8, 9, 62, 71, 28, 24, 37, 53, 84, 76, 22, 48, 15, 19, 43, 88, 58, 38, 63, 68, 27, 22, 37, 76, 59, 66, 22],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 {{10,12,14,16,17,17,20,24,26,28,37,38,41,45,49,50,59,61,63,65,65,66,69,70,70,73,73,74,81,81,83,87,94,97},{-56,38,-22,84,-60,2,68,-78,62,-98,24,26,48,62,-80,-14,-84,12,-54,-12,-20,-82,10,-34,-50,-72,78,16,30,-76,72,34,6,52,44,18,-38,48,-14},{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},{92,5,40,65,86,51,14,29,66,6,62,92,29,13,88,54,15,60,45,2,51,9,33,51,31,11,62,61,77,38,11,4,27,54,72,64,85,46,24,44,39,73,82,85},{-92,-90,-84,-80,-80,-76,-70,-70,-48,-44,-38,-28,-14,-14,-12,-2,2,4,6,10,16,16,20,22,24,26,50,52,56,56,58,58,74,80,82,84,86},{0,1,0,0,0,0,1,1,0,0,1,0,0,0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,1,1,0,0,0,0,0,1,0},{5,19,20,26,31,32,34,37,39,40,46,46,50,53,58,58,59,65,72,72,75,76,77,78,81,83,83,95,98,99},{32,-84,-84,86,-24,36,-12,82,48,-12,82,-76,84,-20,-12,-18,46,-74,-14,-86},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{95,73,74,14,73,74,19,93,34,53,85,75,80,15,36,57,15,98,51,37,8,9,62,71,28,24,37,53,84,76,22,48,15,19,43,88,58,38,63,68,27,22,37,76,59,66,22}}; vector<int> param1 {17,25,11,40,33,29,28,14,33,34}; 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_TO_FIND_REMAINDER_WITHOUT_USING_MODULO_OR_OPERATOR
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_TO_FIND_REMAINDER_WITHOUT_USING_MODULO_OR_OPERATOR{ static int f_gold ( int num , int divisor ) { return ( num - divisor * ( num / divisor ) ) ; }
def f_gold ( num , divisor ) : return ( num - divisor * ( num // divisor ) )
using namespace std; int f_gold ( int num, int divisor ) { return ( num - divisor * ( num / divisor ) ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(80); param0.add(63); param0.add(1); param0.add(22); param0.add(66); param0.add(61); param0.add(45); param0.add(29); param0.add(95); param0.add(9); List<Integer> param1 = new ArrayList<>(); param1.add(54); param1.add(21); param1.add(56); param1.add(39); param1.add(7); param1.add(67); param1.add(63); param1.add(44); param1.add(65); param1.add(68); 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 = [ (80,54,), (63,21,), (1,56,), (22,39,), (66,7,), (61,67,), (45,63,), (29,44,), (95,65,), (9,68,) ] 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 {80,63,1,22,66,61,45,29,95,9}; vector<int> param1 {54,21,56,39,7,67,63,44,65,68}; 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_INCREASING_SUBSEQUENCE_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LONGEST_INCREASING_SUBSEQUENCE_1{ static int f_gold ( int arr [ ] , int n ) { int f_gold [ ] = new int [ n ] ; int i , j , max = 0 ; for ( i = 0 ; i < n ; i ++ ) f_gold [ i ] = 1 ; for ( i = 1 ; i < n ; i ++ ) for ( j = 0 ; j < i ; j ++ ) if ( arr [ i ] > arr [ j ] && f_gold [ i ] < f_gold [ j ] + 1 ) f_gold [ i ] = f_gold [ j ] + 1 ; for ( i = 0 ; i < n ; i ++ ) if ( max < f_gold [ i ] ) max = f_gold [ i ] ; return max ; }
null
using namespace std; int f_gold ( int arr [ ], int n ) { int f_gold [ n ]; f_gold [ 0 ] = 1; for ( int i = 1; i < n; i ++ ) { f_gold [ i ] = 1; for ( int j = 0; j < i; j ++ ) if ( arr [ i ] > arr [ j ] && f_gold [ i ] < f_gold [ j ] + 1 ) f_gold [ i ] = f_gold [ j ] + 1; } return * max_element ( f_gold, f_gold + n ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{14,17,27,28,36,38,40,49,51,57,58,61,62,71,91,94,99}); param0.add(new int[]{-48,54,98,68,24,-46,4,-28,-34,40}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{94,74,27,59,3,71,67,91,91,87,1,79,42,33,85,37,76,86,80,84,62,8,31,54,17,48,4,12,88,63,12,51,36,20,73,48,41,88,21,98,57,3,54}); param0.add(new int[]{-96,-94,-90,-88,-86,-82,-76,-74,-68,-54,-54,-50,-50,-46,-46,-40,-36,-34,-34,-32,-30,-26,-26,-20,-16,-6,-4,2,10,14,22,26,26,28,28,30,30,36,54,64,68,74,78,80,84,90,92,94}); param0.add(new int[]{0,0,0,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,0,1,1,0,0,1,0,0}); param0.add(new int[]{6,12,18,34,37,37,37,40,45,60,64,66,73,78,79,80,92}); param0.add(new int[]{64,-18,-22,96,-92,6,-46,-54,76,0,46,74,-8,22,-46,-44,-94,-88,-52,-54,2,98,-22,46,26,2,-64,-84,20,22,12,-32,-16,-96,46,-4,-8,46,-64,-58,58,92,0,-26,-58,82}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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[]{57,34,3,67,21,69,31,49,7,70,27,53,94,23,74,24,44,53,78,46,6,29,5,41,38,22,40,38,40,59,9}); List<Integer> param1 = new ArrayList<>(); param1.add(14); param1.add(8); param1.add(17); param1.add(24); param1.add(36); param1.add(34); param1.add(11); param1.add(24); param1.add(33); 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()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{14,17,27,28,36,38,40,49,51,57,58,61,62,71,91,94,99},{-48,54,98,68,24,-46,4,-28,-34,40},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},{94,74,27,59,3,71,67,91,91,87,1,79,42,33,85,37,76,86,80,84,62,8,31,54,17,48,4,12,88,63,12,51,36,20,73,48,41,88,21,98,57,3,54},{-96,-94,-90,-88,-86,-82,-76,-74,-68,-54,-54,-50,-50,-46,-46,-40,-36,-34,-34,-32,-30,-26,-26,-20,-16,-6,-4,2,10,14,22,26,26,28,28,30,30,36,54,64,68,74,78,80,84,90,92,94},{0,0,0,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,1,1,1,0,1,1,0,0,1,0,0},{6,12,18,34,37,37,37,40,45,60,64,66,73,78,79,80,92},{64,-18,-22,96,-92,6,-46,-54,76,0,46,74,-8,22,-46,-44,-94,-88,-52,-54,2,98,-22,46,26,2,-64,-84,20,22,12,-32,-16,-96,46,-4,-8,46,-64,-58,58,92,0,-26,-58,82},{0,0,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},{57,34,3,67,21,69,31,49,7,70,27,53,94,23,74,24,44,53,78,46,6,29,5,41,38,22,40,38,40,59,9}}; vector<int> param1 {14,8,17,24,36,34,11,24,33,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; }
CONSTRUCT_LEXICOGRAPHICALLY_SMALLEST_PALINDROME
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CONSTRUCT_LEXICOGRAPHICALLY_SMALLEST_PALINDROME{ static String f_gold ( char [ ] str , int len ) { int i = 0 , j = len - 1 ; for ( ; i < j ; i ++ , j -- ) { if ( str [ i ] == str [ j ] && str [ i ] != '*' ) continue ; else if ( str [ i ] == str [ j ] && str [ i ] == '*' ) { str [ i ] = 'a' ; str [ j ] = 'a' ; continue ; } else if ( str [ i ] == '*' ) { str [ i ] = str [ j ] ; continue ; } else if ( str [ j ] == '*' ) { str [ j ] = str [ i ] ; continue ; } System . out . println ( "Not Possible" ) ; return "" ; } return String . valueOf ( str ) ; }
def f_gold ( string , l ) : string = list ( string ) i = - 1 j = l while i < j : i += 1 j -= 1 if ( string [ i ] == string [ j ] and string [ i ] != '*' ) : continue elif ( string [ i ] == string [ j ] and string [ i ] == '*' ) : string [ i ] = 'a' string [ j ] = 'a' continue elif string [ i ] == '*' : string [ i ] = string [ j ] continue elif string [ j ] == '*' : string [ j ] = string [ i ] continue print ( "Not Possible" ) return "" return ''.join ( string )
null
public static void main(String args[]) { int n_success = 0; List<char [ ]> param0 = new ArrayList<>(); param0.add(new char[]{'A','B','C','G','I','L','L','O','O','P','Q','S','W','Y','c','d','e','f','f','i','m','m','o','q','v','w','x','x','y','z'}); param0.add(new char[]{'3','2','3','6','8','9','0','5','0','5','8','7','9','0','3','6','9','6','2','4','2','3','1','2','7','9','1','8','8','7','1','1','6','1'}); param0.add(new char[]{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1'}); param0.add(new char[]{'z','v','B','Y','n','K','h','C','T','L','g'}); param0.add(new char[]{'1','2','5','6','7'}); param0.add(new char[]{'0','0','1','0'}); param0.add(new char[]{'D','n','r'}); param0.add(new char[]{'0','9','9','1','2','1','5','3','7','5','9','2','4','4','8','9','6','4','2','8','8','5','5','7','1','7','6','2','2','2','3','3','7','9'}); param0.add(new char[]{'0','0','0','0','0','0','0','0','0','0','0','0','1','1','1','1','1','1','1','1','1','1','1','1','1'}); param0.add(new char[]{'E','s','I','S','h','H','i','m','v','B'}); List<Integer> param1 = new ArrayList<>(); param1.add(27); param1.add(30); param1.add(27); param1.add(7); param1.add(4); param1.add(3); param1.add(1); param1.add(24); param1.add(21); param1.add(6); 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 = [ (['A', 'B', 'C', 'G', 'I', 'L', 'L', 'O', 'O', 'P', 'Q', 'S', 'W', 'Y', 'c', 'd', 'e', 'f', 'f', 'i', 'm', 'm', 'o', 'q', 'v', 'w', 'x', 'x', 'y', 'z'],27,), (['3', '2', '3', '6', '8', '9', '0', '5', '0', '5', '8', '7', '9', '0', '3', '6', '9', '6', '2', '4', '2', '3', '1', '2', '7', '9', '1', '8', '8', '7', '1', '1', '6', '1'],30,), (['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'],27,), (['z', 'v', 'B', 'Y', 'n', 'K', 'h', 'C', 'T', 'L', 'g'],7,), (['1', '2', '5', '6', '7'],4,), (['0', '0', '1', '0'],3,), (['D', 'n', 'r'],1,), (['0', '9', '9', '1', '2', '1', '5', '3', '7', '5', '9', '2', '4', '4', '8', '9', '6', '4', '2', '8', '8', '5', '5', '7', '1', '7', '6', '2', '2', '2', '3', '3', '7', '9'],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'],21,), (['E', 's', 'I', 'S', 'h', 'H', 'i', 'm', 'v', 'B'],6,) ] 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
REARRANGE_ARRAY_MAXIMUM_MINIMUM_FORM_SET_2_O1_EXTRA_SPACE
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{ public static void f_gold ( int arr [ ] , int n ) { int max_idx = n - 1 , min_idx = 0 ; int max_elem = arr [ n - 1 ] + 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 2 == 0 ) { arr [ i ] += ( arr [ max_idx ] % max_elem ) * max_elem ; max_idx -- ; } else { arr [ i ] += ( arr [ min_idx ] % max_elem ) * max_elem ; min_idx ++ ; } } for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = arr [ i ] / max_elem ; }
def f_gold ( arr , n ) : max_idx = n - 1 min_idx = 0 max_elem = arr [ n - 1 ] + 1 for i in range ( 0 , n ) : if i % 2 == 0 : arr [ i ] += ( arr [ max_idx ] % max_elem ) * max_elem max_idx -= 1 else : arr [ i ] += ( arr [ min_idx ] % max_elem ) * max_elem min_idx += 1 for i in range ( 0 , n ) : arr [ i ] = arr [ i ] / max_elem
using namespace std; void f_gold ( int arr [ ], int n ) { int max_idx = n - 1, min_idx = 0; int max_elem = arr [ n - 1 ] + 1; for ( int i = 0; i < n; i ++ ) { if ( i % 2 == 0 ) { arr [ i ] += ( arr [ max_idx ] % max_elem ) * max_elem; max_idx --; } else { arr [ i ] += ( arr [ min_idx ] % max_elem ) * max_elem; min_idx ++; } } for ( int i = 0; i < n; i ++ ) arr [ i ] = arr [ i ] / max_elem; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,1,2,3,9,10,14,22,26,28,29,29,30,32,32,32,34,37,39,40,42,42,42,43,45,47,49,52,53,54,56,58,59,68,71,73,76,81,81,83,84,91,94}); param0.add(new int[]{50,46,6,-57,67,34,-52,26,-93,97,-84,29,15,-63,65,25,-19,92,-38,-28,89,25,61,-34,-70,-80,88,-18,7,52,32,-63,32,-23,-11,46,-12,94,76,-67,-42}); param0.add(new int[]{0,0,0,0,0,0,1,1,1}); param0.add(new int[]{15,99,57,69,22,64,41,87,71,56,23,25,91,6,34,63,9,60,49,97,51,60,70,37,31,98,41,62,93,58,14,36,36,79,8,26,36,48,85,28,68,62,80,86,76,80,51}); param0.add(new int[]{-99,-99,-90,-90,-85,-85,-79,-77,-72,-71,-67,-66,-61,-39,-39,-35,-35,-23,-20,-18,-16,-13,-2,1,5,6,10,24,27,32,33,38,48,67,70,76,82,88}); param0.add(new int[]{0,0,0,1,0,1,0,1,1,1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,1,1,1,1,0,0,0,1,0}); param0.add(new int[]{2,22,32,34,43,66,70,74,94,94}); param0.add(new int[]{-99,-28,76,-50,41,-85,-47,72,-92,-26,-54,-31,14,47,66,23}); 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[]{19,31,26,42,41,23,47,13,89,66,66,16,73,28,77,35,41,77,31,85,32,54,98,72,59}); List<Integer> param1 = new ArrayList<>(); param1.add(29); param1.add(38); param1.add(4); param1.add(30); param1.add(34); param1.add(33); param1.add(6); param1.add(10); param1.add(42); param1.add(20); List<int [ ]> filled_function_param0 = new ArrayList<>(); filled_function_param0.add(new int[]{1,1,2,3,9,10,14,22,26,28,29,29,30,32,32,32,34,37,39,40,42,42,42,43,45,47,49,52,53,54,56,58,59,68,71,73,76,81,81,83,84,91,94}); filled_function_param0.add(new int[]{50,46,6,-57,67,34,-52,26,-93,97,-84,29,15,-63,65,25,-19,92,-38,-28,89,25,61,-34,-70,-80,88,-18,7,52,32,-63,32,-23,-11,46,-12,94,76,-67,-42}); filled_function_param0.add(new int[]{0,0,0,0,0,0,1,1,1}); filled_function_param0.add(new int[]{15,99,57,69,22,64,41,87,71,56,23,25,91,6,34,63,9,60,49,97,51,60,70,37,31,98,41,62,93,58,14,36,36,79,8,26,36,48,85,28,68,62,80,86,76,80,51}); filled_function_param0.add(new int[]{-99,-99,-90,-90,-85,-85,-79,-77,-72,-71,-67,-66,-61,-39,-39,-35,-35,-23,-20,-18,-16,-13,-2,1,5,6,10,24,27,32,33,38,48,67,70,76,82,88}); filled_function_param0.add(new int[]{0,0,0,1,0,1,0,1,1,1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,1,1,1,1,0,0,0,1,0}); filled_function_param0.add(new int[]{2,22,32,34,43,66,70,74,94,94}); filled_function_param0.add(new int[]{-99,-28,76,-50,41,-85,-47,72,-92,-26,-54,-31,14,47,66,23}); 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}); filled_function_param0.add(new int[]{19,31,26,42,41,23,47,13,89,66,66,16,73,28,77,35,41,77,31,85,32,54,98,72,59}); List<Integer> filled_function_param1 = new ArrayList<>(); filled_function_param1.add(29); filled_function_param1.add(38); filled_function_param1.add(4); filled_function_param1.add(30); filled_function_param1.add(34); filled_function_param1.add(33); filled_function_param1.add(6); filled_function_param1.add(10); filled_function_param1.add(42); filled_function_param1.add(20); 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 = [ ([1, 1, 2, 3, 9, 10, 14, 22, 26, 28, 29, 29, 30, 32, 32, 32, 34, 37, 39, 40, 42, 42, 42, 43, 45, 47, 49, 52, 53, 54, 56, 58, 59, 68, 71, 73, 76, 81, 81, 83, 84, 91, 94],29,), ([50, 46, 6, -57, 67, 34, -52, 26, -93, 97, -84, 29, 15, -63, 65, 25, -19, 92, -38, -28, 89, 25, 61, -34, -70, -80, 88, -18, 7, 52, 32, -63, 32, -23, -11, 46, -12, 94, 76, -67, -42],38,), ([0, 0, 0, 0, 0, 0, 1, 1, 1],4,), ([15, 99, 57, 69, 22, 64, 41, 87, 71, 56, 23, 25, 91, 6, 34, 63, 9, 60, 49, 97, 51, 60, 70, 37, 31, 98, 41, 62, 93, 58, 14, 36, 36, 79, 8, 26, 36, 48, 85, 28, 68, 62, 80, 86, 76, 80, 51],30,), ([-99, -99, -90, -90, -85, -85, -79, -77, -72, -71, -67, -66, -61, -39, -39, -35, -35, -23, -20, -18, -16, -13, -2, 1, 5, 6, 10, 24, 27, 32, 33, 38, 48, 67, 70, 76, 82, 88],34,), ([0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0],33,), ([2, 22, 32, 34, 43, 66, 70, 74, 94, 94],6,), ([-99, -28, 76, -50, 41, -85, -47, 72, -92, -26, -54, -31, 14, 47, 66, 23],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],42,), ([19, 31, 26, 42, 41, 23, 47, 13, 89, 66, 66, 16, 73, 28, 77, 35, 41, 77, 31, 85, 32, 54, 98, 72, 59],20,) ] filled_function_param = [ ([1, 1, 2, 3, 9, 10, 14, 22, 26, 28, 29, 29, 30, 32, 32, 32, 34, 37, 39, 40, 42, 42, 42, 43, 45, 47, 49, 52, 53, 54, 56, 58, 59, 68, 71, 73, 76, 81, 81, 83, 84, 91, 94],29,), ([50, 46, 6, -57, 67, 34, -52, 26, -93, 97, -84, 29, 15, -63, 65, 25, -19, 92, -38, -28, 89, 25, 61, -34, -70, -80, 88, -18, 7, 52, 32, -63, 32, -23, -11, 46, -12, 94, 76, -67, -42],38,), ([0, 0, 0, 0, 0, 0, 1, 1, 1],4,), ([15, 99, 57, 69, 22, 64, 41, 87, 71, 56, 23, 25, 91, 6, 34, 63, 9, 60, 49, 97, 51, 60, 70, 37, 31, 98, 41, 62, 93, 58, 14, 36, 36, 79, 8, 26, 36, 48, 85, 28, 68, 62, 80, 86, 76, 80, 51],30,), ([-99, -99, -90, -90, -85, -85, -79, -77, -72, -71, -67, -66, -61, -39, -39, -35, -35, -23, -20, -18, -16, -13, -2, 1, 5, 6, 10, 24, 27, 32, 33, 38, 48, 67, 70, 76, 82, 88],34,), ([0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0],33,), ([2, 22, 32, 34, 43, 66, 70, 74, 94, 94],6,), ([-99, -28, 76, -50, 41, -85, -47, 72, -92, -26, -54, -31, 14, 47, 66, 23],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],42,), ([19, 31, 26, 42, 41, 23, 47, 13, 89, 66, 66, 16, 73, 28, 77, 35, 41, 77, 31, 85, 32, 54, 98, 72, 59],20,) ] 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 {{1,1,2,3,9,10,14,22,26,28,29,29,30,32,32,32,34,37,39,40,42,42,42,43,45,47,49,52,53,54,56,58,59,68,71,73,76,81,81,83,84,91,94},{50,46,6,-57,67,34,-52,26,-93,97,-84,29,15,-63,65,25,-19,92,-38,-28,89,25,61,-34,-70,-80,88,-18,7,52,32,-63,32,-23,-11,46,-12,94,76,-67,-42},{0,0,0,0,0,0,1,1,1},{15,99,57,69,22,64,41,87,71,56,23,25,91,6,34,63,9,60,49,97,51,60,70,37,31,98,41,62,93,58,14,36,36,79,8,26,36,48,85,28,68,62,80,86,76,80,51},{-99,-99,-90,-90,-85,-85,-79,-77,-72,-71,-67,-66,-61,-39,-39,-35,-35,-23,-20,-18,-16,-13,-2,1,5,6,10,24,27,32,33,38,48,67,70,76,82,88},{0,0,0,1,0,1,0,1,1,1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,1,1,1,1,0,0,0,1,0},{2,22,32,34,43,66,70,74,94,94},{-99,-28,76,-50,41,-85,-47,72,-92,-26,-54,-31,14,47,66,23},{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},{19,31,26,42,41,23,47,13,89,66,66,16,73,28,77,35,41,77,31,85,32,54,98,72,59}}; vector<int> param1 {29,38,4,30,34,33,6,10,42,20}; vector<vector<int>> filled_function_param0 {{1,1,2,3,9,10,14,22,26,28,29,29,30,32,32,32,34,37,39,40,42,42,42,43,45,47,49,52,53,54,56,58,59,68,71,73,76,81,81,83,84,91,94},{50,46,6,-57,67,34,-52,26,-93,97,-84,29,15,-63,65,25,-19,92,-38,-28,89,25,61,-34,-70,-80,88,-18,7,52,32,-63,32,-23,-11,46,-12,94,76,-67,-42},{0,0,0,0,0,0,1,1,1},{15,99,57,69,22,64,41,87,71,56,23,25,91,6,34,63,9,60,49,97,51,60,70,37,31,98,41,62,93,58,14,36,36,79,8,26,36,48,85,28,68,62,80,86,76,80,51},{-99,-99,-90,-90,-85,-85,-79,-77,-72,-71,-67,-66,-61,-39,-39,-35,-35,-23,-20,-18,-16,-13,-2,1,5,6,10,24,27,32,33,38,48,67,70,76,82,88},{0,0,0,1,0,1,0,1,1,1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,1,1,1,1,0,0,0,1,0},{2,22,32,34,43,66,70,74,94,94},{-99,-28,76,-50,41,-85,-47,72,-92,-26,-54,-31,14,47,66,23},{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},{19,31,26,42,41,23,47,13,89,66,66,16,73,28,77,35,41,77,31,85,32,54,98,72,59}}; vector<int> filled_function_param1 {29,38,4,30,34,33,6,10,42,20}; 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; }
HORNERS_METHOD_POLYNOMIAL_EVALUATION
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class HORNERS_METHOD_POLYNOMIAL_EVALUATION{ static int f_gold ( int poly [ ] , int n , int x ) { int result = poly [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) result = result * x + poly [ i ] ; return result ; }
def f_gold ( poly , n , x ) : result = poly [ 0 ] for i in range ( 1 , n ) : result = result * x + poly [ i ] return result
using namespace std; int f_gold ( int poly [ ], int n, int x ) { int result = poly [ 0 ]; for ( int i = 1; i < n; i ++ ) result = result * x + poly [ i ]; return result; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,18,22,27,31,33,36,36,37,37,40,48,49,49,50,58,66,71,75,85,89,91}); param0.add(new int[]{42,-88,28,8,30,-8,-16,86,50,84,12,-20,-70,-40,-54,-76,84,90,-40,-68,-40,36,-34,14,94,-44,70,58,-48,-72,14,-70,32}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1}); param0.add(new int[]{66,72,27,72,71,75,94,49,47,21,21,71,84,61,14,20,5,31,62,12,56,56,12,66,26,68,30,98,20}); param0.add(new int[]{-96,-96,-94,-82,-72,-54,-54,-46,-34,-30,-28,-18,-2,2,6,8,10,16,18,24,26,28,44,48,48,52,56,58,58,70,70,82,84,88,94}); param0.add(new int[]{0,1,0,1,0,0,0,1,0,1,1,1,0,0,0,0,1,1,0,1,1,0,0,1,0,0,1,1,1,0,1,1,0,0,1}); param0.add(new int[]{2,3,8,13,15,17,18,18,25,29,29,31,36,37,42,42,42,51,52,52,54,54,58,64,70,70,74,75,78,80,83,85,86,88,95,96,97,98,99}); param0.add(new int[]{-56,-12,-92,-48,-98,-80,-96,-42,-50,74,88,20,78,-74,-20,-32,-30,58,-22,-16,68,72,-50,-72,66,72,74,-98,-22,-40,-90,88,42,24}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{86,62,30,27,98,75,93,37,70,16,20,74,46,74,25,59,86,32,17,90,80,10,17}); List<Integer> param1 = new ArrayList<>(); param1.add(16); param1.add(31); param1.add(10); param1.add(15); param1.add(25); param1.add(20); param1.add(19); param1.add(29); param1.add(20); param1.add(12); List<Integer> param2 = new ArrayList<>(); param2.add(16); param2.add(20); param2.add(8); param2.add(26); param2.add(34); param2.add(25); param2.add(32); param2.add(23); param2.add(23); 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 = [ ([3, 18, 22, 27, 31, 33, 36, 36, 37, 37, 40, 48, 49, 49, 50, 58, 66, 71, 75, 85, 89, 91],16,16,), ([42, -88, 28, 8, 30, -8, -16, 86, 50, 84, 12, -20, -70, -40, -54, -76, 84, 90, -40, -68, -40, 36, -34, 14, 94, -44, 70, 58, -48, -72, 14, -70, 32],31,20,), ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1],10,8,), ([66, 72, 27, 72, 71, 75, 94, 49, 47, 21, 21, 71, 84, 61, 14, 20, 5, 31, 62, 12, 56, 56, 12, 66, 26, 68, 30, 98, 20],15,26,), ([-96, -96, -94, -82, -72, -54, -54, -46, -34, -30, -28, -18, -2, 2, 6, 8, 10, 16, 18, 24, 26, 28, 44, 48, 48, 52, 56, 58, 58, 70, 70, 82, 84, 88, 94],25,34,), ([0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1],20,25,), ([2, 3, 8, 13, 15, 17, 18, 18, 25, 29, 29, 31, 36, 37, 42, 42, 42, 51, 52, 52, 54, 54, 58, 64, 70, 70, 74, 75, 78, 80, 83, 85, 86, 88, 95, 96, 97, 98, 99],19,32,), ([-56, -12, -92, -48, -98, -80, -96, -42, -50, 74, 88, 20, 78, -74, -20, -32, -30, 58, -22, -16, 68, 72, -50, -72, 66, 72, 74, -98, -22, -40, -90, 88, 42, 24],29,23,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],20,23,), ([86, 62, 30, 27, 98, 75, 93, 37, 70, 16, 20, 74, 46, 74, 25, 59, 86, 32, 17, 90, 80, 10, 17],12,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 {{3,18,22,27,31,33,36,36,37,37,40,48,49,49,50,58,66,71,75,85,89,91},{42,-88,28,8,30,-8,-16,86,50,84,12,-20,-70,-40,-54,-76,84,90,-40,-68,-40,36,-34,14,94,-44,70,58,-48,-72,14,-70,32},{0,0,0,0,0,0,0,1,1,1,1},{66,72,27,72,71,75,94,49,47,21,21,71,84,61,14,20,5,31,62,12,56,56,12,66,26,68,30,98,20},{-96,-96,-94,-82,-72,-54,-54,-46,-34,-30,-28,-18,-2,2,6,8,10,16,18,24,26,28,44,48,48,52,56,58,58,70,70,82,84,88,94},{0,1,0,1,0,0,0,1,0,1,1,1,0,0,0,0,1,1,0,1,1,0,0,1,0,0,1,1,1,0,1,1,0,0,1},{2,3,8,13,15,17,18,18,25,29,29,31,36,37,42,42,42,51,52,52,54,54,58,64,70,70,74,75,78,80,83,85,86,88,95,96,97,98,99},{-56,-12,-92,-48,-98,-80,-96,-42,-50,74,88,20,78,-74,-20,-32,-30,58,-22,-16,68,72,-50,-72,66,72,74,-98,-22,-40,-90,88,42,24},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{86,62,30,27,98,75,93,37,70,16,20,74,46,74,25,59,86,32,17,90,80,10,17}}; vector<int> param1 {16,31,10,15,25,20,19,29,20,12}; vector<int> param2 {16,20,8,26,34,25,32,23,23,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; }
PAIR_WITH_GIVEN_PRODUCT_SET_1_FIND_IF_ANY_PAIR_EXISTS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PAIR_WITH_GIVEN_PRODUCT_SET_1_FIND_IF_ANY_PAIR_EXISTS{ static boolean f_gold ( int arr [ ] , int n , int x ) { for ( int i = 0 ; i < n - 1 ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) if ( arr [ i ] * arr [ j ] == x ) return true ; return false ; }
def f_gold ( arr , n , x ) : for i in arr : for j in arr : if i * j == x : return True return False
using namespace std; bool f_gold ( int arr [ ], int n, int x ) { for ( int i = 0; i < n - 1; i ++ ) for ( int j = i + 1; i < n; i ++ ) if ( arr [ i ] * arr [ j ] == x ) return true; return false; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{10, 20, 9, 40}); param0.add(new int[]{1,-10, 20, 9, -40}); param0.add(new int[]{0,0,0,0,0,1,1,1,1}); param0.add(new int[]{4,10, 20, 9, -40}); param0.add(new int[]{-90,-86,-76,-72,-70,-62,-56,-50,-18,-12,-10,4,16,26,42,48,52,54,54,70,84,86,88,98}); param0.add(new int[]{1}); param0.add(new int[]{4,7,14,14,16,18,19,20,22,24,29,38,38,38,40,40,46,46,47,51,51,52,55,56,56,62,62,62,78,79,81,84,86,88,89,89,89}); param0.add(new int[]{72,80,-82,24,-98,90,-32,-56,-22,8,-12,8,-78,60,-62,50,12,-60,10,-54,74,98,26,56,24}); 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}); param0.add(new int[]{93,40,48,99,95,59,43,58,79,70,28}); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(5); param1.add(7); param1.add(5); param1.add(23); param1.add(0); param1.add(23); param1.add(21); param1.add(22); param1.add(9); List<Integer> param2 = new ArrayList<>(); param2.add(400); param2.add(400); param2.add(8); param2.add(-400); param2.add(23); param2.add(0); param2.add(32); param2.add(19); param2.add(18); 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()); } }
if __name__ == '__main__': param = [ ([10, 20, 9, 40],4,400,), ([1,-10, 20, 9, -40],5,400,), ([0,0,0,0,0,1,1,1,1],7,8,), ([4,10, 20, 9, -40],5,-400,), ([-90,-86,-76,-72,-70,-62,-56,-50,-18,-12,-10,4,16,26,42,48,52,54,54,70,84,86,88,98],23,23,), ([1],0,0,), ([4,7,14,14,16,18,19,20,22,24,29,38,38,38,40,40,46,46,47,51,51,52,55,56,56,62,62,62,78,79,81,84,86,88,89,89,89],23,32,), ([72,80,-82,24,-98,90,-32,-56,-22,8,-12,8,-78,60,-62,50,12,-60,10,-54,74,98,26,56,24],21,19,), ([0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1],22,18,), ([93,40,48,99,95,59,43,58,79,70,28],9,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<vector<int>> param0 {{3,4,5,5,6,11,18,29,29,30,35,36,38,38,40,43,43,43,50,53,58,61,62,63,64,64,65,72,73,77,78,78,84,90,94,96},{-72,16,0,68,-58,58,46,38,-28,-56,-28,-14,-56,40,30,80,94,-52,0,-88,8,-96,-52,-96,48,-10,-32,-74,88,18,70},{0,0,0,0,0,1,1,1,1},{78,49,30,28,71,70,29,43,91,56,51,47,21,57,69,28,68,78,38,31,35,33,55,18,88,15,69,7,51,75,8,64,6,84,79,23,62,10,71,52,77},{-90,-86,-76,-72,-70,-62,-56,-50,-18,-12,-10,4,16,26,42,48,52,54,54,70,84,86,88,98},{1},{4,7,14,14,16,18,19,20,22,24,29,38,38,38,40,40,46,46,47,51,51,52,55,56,56,62,62,62,78,79,81,84,86,88,89,89,89},{72,80,-82,24,-98,90,-32,-56,-22,8,-12,8,-78,60,-62,50,12,-60,10,-54,74,98,26,56,24},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1},{93,40,48,99,95,59,43,58,79,70,28}}; vector<int> param1 {28,25,7,35,23,0,23,21,22,9}; vector<int> param2 {26,16,8,25,23,0,32,19,18,5}; 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; }
FIND_LAST_DIGIT_FACTORIAL_DIVIDES_FACTORIAL_B
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_LAST_DIGIT_FACTORIAL_DIVIDES_FACTORIAL_B{ static int f_gold ( long A , long B ) { int variable = 1 ; if ( A == B ) return 1 ; else if ( ( B - A ) >= 5 ) return 0 ; else { for ( long i = A + 1 ; i <= B ; i ++ ) variable = ( int ) ( variable * ( i % 10 ) ) % 10 ; return variable % 10 ; } }
def f_gold ( A , B ) : variable = 1 if ( A == B ) : return 1 elif ( ( B - A ) >= 5 ) : return 0 else : for i in range ( A + 1 , B + 1 ) : variable = ( variable * ( i % 10 ) ) % 10 return variable % 10
using namespace std; int f_gold ( long long int A, long long int B ) { int variable = 1; if ( A == B ) return 1; else if ( ( B - A ) >= 5 ) return 0; else { for ( long long int i = A + 1; i <= B; i ++ ) variable = ( variable * ( i % 10 ) ) % 10; return variable % 10; } }
public static void main(String args[]) { int n_success = 0; List<Long> param0 = new ArrayList<>(); param0.add(79L); param0.add(61L); param0.add(39L); param0.add(39L); param0.add(61L); param0.add(86L); param0.add(7L); param0.add(86L); param0.add(86L); param0.add(11L); List<Long> param1 = new ArrayList<>(); param1.add(84L); param1.add(29L); param1.add(77L); param1.add(65L); param1.add(78L); param1.add(73L); param1.add(92L); param1.add(50L); param1.add(63L); param1.add(2L); 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 = [ (79,84,), (61,29,), (39,77,), (39,65,), (61,78,), (86,73,), (7,92,), (86,50,), (86,63,), (11,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<long> param0 {79,61,39,39,61,86,7,86,86,11}; vector<long> param1 {84,29,77,65,78,73,92,50,63,2}; 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; }
SQUARE_PYRAMIDAL_NUMBER_SUM_SQUARES
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SQUARE_PYRAMIDAL_NUMBER_SUM_SQUARES{ static int f_gold ( int s ) { int sum = 0 ; for ( int n = 1 ; sum < s ; n ++ ) { sum += n * n ; if ( sum == s ) return n ; } return - 1 ; }
def f_gold ( s ) : _sum = 0 n = 1 while ( _sum < s ) : _sum += 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; if ( sum == s ) return n; } return - 1; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(1); param0.add(5); param0.add(14); param0.add(140); param0.add(204); param0.add(3); param0.add(506); param0.add(42); param0.add(4); param0.add(87); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (1,), (5,), (14,), (140,), (204,), (3,), (506,), (42,), (4,), (87,) ] 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 {1,5,14,140,204,3,506,42,4,87}; 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_MINIMUM_DIFFERENCE_PAIR
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_MINIMUM_DIFFERENCE_PAIR{ static int f_gold ( int [ ] arr , int n ) { int diff = Integer . MAX_VALUE ; for ( int i = 0 ; i < n - 1 ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) if ( Math . abs ( ( arr [ i ] - arr [ j ] ) ) < diff ) diff = Math . abs ( ( arr [ i ] - arr [ j ] ) ) ; return diff ; }
def f_gold ( arr , n ) : diff = 10 ** 20 for i in range ( n - 1 ) : for j in range ( i + 1 , n ) : if abs ( arr [ i ] - arr [ j ] ) < diff : diff = abs ( arr [ i ] - arr [ j ] ) return diff
using namespace std; int f_gold ( int arr [ ], int n ) { int diff = INT_MAX; for ( int i = 0; i < n - 1; i ++ ) for ( int j = i + 1; j < n; j ++ ) if ( abs ( arr [ i ] - arr [ j ] ) < diff ) diff = abs ( arr [ i ] - arr [ j ] ); return diff; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,1,2,3,5,8,10,11,15,15,16,20,26,28,30,30,33,33,39,50,50,50,54,62,66,68,69,69,74,74,75,75,76,78,82,83,85,86,86,89,89,91,91,92,92,92,93,94,98}); param0.add(new int[]{6,6,-20,88,-78,-18,74,72,80,76,-62,38}); param0.add(new int[]{0,1,1,1,1}); param0.add(new int[]{75,85,49,66,44,89,80,39,64,70,25,21,81,33,90,68,51}); param0.add(new int[]{-96,-10,0,4,54,64}); param0.add(new int[]{1,0,1,0,0,1,0,0,0,0,1,0,1,1,0,1,1,1,1,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,0,0}); param0.add(new int[]{3,3,5,5,7,7,9,11,11,18,18,18,20,29,29,31,31,32,37,43,44,46,48,50,52,52,53,63,63,65,69,72,76,76,81,84,85,86,87,87,90,94,97,97}); param0.add(new int[]{40,-46,72,-28,8,90,86,-90,8,-66,-98,6,42,86,88,42,-50,74,-34,-16,-94,-56,-18,-18,84,-44,34,80,96,42,-50,-92,70,80,62,-38,-4,68,54,-14,30,-18,-58}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{15,41,32,19,68,36,61,59,5,91,53,95,10,64,15,32,14,64,48,70,85,19,83,2,33,58,93,88,21,88,45,45,18,8}); List<Integer> param1 = new ArrayList<>(); param1.add(32); param1.add(11); param1.add(3); param1.add(16); param1.add(3); param1.add(41); param1.add(27); param1.add(33); param1.add(26); param1.add(24); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([1, 1, 2, 3, 5, 8, 10, 11, 15, 15, 16, 20, 26, 28, 30, 30, 33, 33, 39, 50, 50, 50, 54, 62, 66, 68, 69, 69, 74, 74, 75, 75, 76, 78, 82, 83, 85, 86, 86, 89, 89, 91, 91, 92, 92, 92, 93, 94, 98],32,), ([6, 6, -20, 88, -78, -18, 74, 72, 80, 76, -62, 38],11,), ([0, 1, 1, 1, 1],3,), ([75, 85, 49, 66, 44, 89, 80, 39, 64, 70, 25, 21, 81, 33, 90, 68, 51],16,), ([-96, -10, 0, 4, 54, 64],3,), ([1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0],41,), ([3, 3, 5, 5, 7, 7, 9, 11, 11, 18, 18, 18, 20, 29, 29, 31, 31, 32, 37, 43, 44, 46, 48, 50, 52, 52, 53, 63, 63, 65, 69, 72, 76, 76, 81, 84, 85, 86, 87, 87, 90, 94, 97, 97],27,), ([40, -46, 72, -28, 8, 90, 86, -90, 8, -66, -98, 6, 42, 86, 88, 42, -50, 74, -34, -16, -94, -56, -18, -18, 84, -44, 34, 80, 96, 42, -50, -92, 70, 80, 62, -38, -4, 68, 54, -14, 30, -18, -58],33,), ([0, 0, 0, 0, 0, 0, 0, 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,), ([15, 41, 32, 19, 68, 36, 61, 59, 5, 91, 53, 95, 10, 64, 15, 32, 14, 64, 48, 70, 85, 19, 83, 2, 33, 58, 93, 88, 21, 88, 45, 45, 18, 8],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<vector<int>> param0 {{1,1,2,3,5,8,10,11,15,15,16,20,26,28,30,30,33,33,39,50,50,50,54,62,66,68,69,69,74,74,75,75,76,78,82,83,85,86,86,89,89,91,91,92,92,92,93,94,98},{6,6,-20,88,-78,-18,74,72,80,76,-62,38},{0,1,1,1,1},{75,85,49,66,44,89,80,39,64,70,25,21,81,33,90,68,51},{-96,-10,0,4,54,64},{1,0,1,0,0,1,0,0,0,0,1,0,1,1,0,1,1,1,1,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,0,0},{3,3,5,5,7,7,9,11,11,18,18,18,20,29,29,31,31,32,37,43,44,46,48,50,52,52,53,63,63,65,69,72,76,76,81,84,85,86,87,87,90,94,97,97},{40,-46,72,-28,8,90,86,-90,8,-66,-98,6,42,86,88,42,-50,74,-34,-16,-94,-56,-18,-18,84,-44,34,80,96,42,-50,-92,70,80,62,-38,-4,68,54,-14,30,-18,-58},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{15,41,32,19,68,36,61,59,5,91,53,95,10,64,15,32,14,64,48,70,85,19,83,2,33,58,93,88,21,88,45,45,18,8}}; vector<int> param1 {32,11,3,16,3,41,27,33,26,24}; 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; }
POSITION_OF_RIGHTMOST_SET_BIT
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class POSITION_OF_RIGHTMOST_SET_BIT{ public static int f_gold ( int n ) { return ( int ) ( ( Math . log10 ( n & - n ) ) / Math . log10 ( 2 ) ) + 1 ; }
import math def f_gold ( n ) : return math.log2 ( n & - n ) + 1
null
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(45); param0.add(26); param0.add(74); param0.add(80); param0.add(46); param0.add(67); param0.add(16); param0.add(87); param0.add(27); param0.add(17); 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 = [ (45,), (26,), (74,), (80,), (46,), (67,), (16,), (87,), (27,), (17,) ] 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
STACK_PERMUTATIONS_CHECK_IF_AN_ARRAY_IS_STACK_PERMUTATION_OF_OTHER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class STACK_PERMUTATIONS_CHECK_IF_AN_ARRAY_IS_STACK_PERMUTATION_OF_OTHER{ static boolean f_gold ( int ip [ ] , int op [ ] , int n ) { Queue < Integer > input = new LinkedList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { input . add ( ip [ i ] ) ; } Queue < Integer > output = new LinkedList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { output . add ( op [ i ] ) ; } Stack < Integer > tempStack = new Stack < > ( ) ; while ( ! input . isEmpty ( ) ) { int ele = input . poll ( ) ; if ( ele == output . peek ( ) ) { output . poll ( ) ; while ( ! tempStack . isEmpty ( ) ) { if ( tempStack . peek ( ) == output . peek ( ) ) { tempStack . pop ( ) ; output . poll ( ) ; } else break ; } } else { tempStack . push ( ele ) ; } } return ( input . isEmpty ( ) && tempStack . isEmpty ( ) ) ; }
from queue import Queue def f_gold ( ip , op , n ) : Input = Queue ( ) for i in range ( n ) : Input.put ( ip [ i ] ) output = Queue ( ) for i in range ( n ) : output.put ( op [ i ] ) tempStack = [ ] while ( not Input.empty ( ) ) : ele = Input.queue [ 0 ] Input.get ( ) if ( ele == output.queue [ 0 ] ) : output.get ( ) while ( len ( tempStack ) != 0 ) : if ( tempStack [ - 1 ] == output.queue [ 0 ] ) : tempStack.pop ( ) output.get ( ) else : break else : tempStack.append ( ele ) return ( Input.empty ( ) and len ( tempStack ) == 0 )
using namespace std; bool f_gold ( int ip [ ], int op [ ], int n ) { queue < int > input; for ( int i = 0; i < n; i ++ ) input . push ( ip [ i ] ); queue < int > output; for ( int i = 0; i < n; i ++ ) output . push ( op [ i ] ); stack < int > tempStack; while ( ! input . empty ( ) ) { int ele = input . front ( ); input . pop ( ); if ( ele == output . front ( ) ) { output . pop ( ); while ( ! tempStack . empty ( ) ) { if ( tempStack . top ( ) == output . front ( ) ) { tempStack . pop ( ); output . pop ( ); } else break; } } else tempStack . push ( ele ); } return ( input . empty ( ) && tempStack . empty ( ) ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,3,3,3,4,5,6,9,18,20,35,39,39,45,50,55,57,61,63,65,72,73,77,77,78,87,88,91,93,95,98}); param0.add(new int[]{-86,10,-8,8,-24,-2,-84,-86,-54,50,56,-22,-8,-62,0,-50,-32}); 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}); param0.add(new int[]{3,42,88,89,41,71,67,5,84,20,75,36,34,20,31,16,86,89,53,47,57,27,47,93,59,66,40,18,69,36,98,99,81}); param0.add(new int[]{-98,-94,-94,-90,-88,-82,-80,-78,-78,-68,-58,-58,-52,-36,-30,-14,-12,-6,-2,-2,2,4,10,14,22,24,26,38,38,46,46,48,50,54,58,60,64,64,66,70,74,74,86,88,96,96}); param0.add(new int[]{1,0,1,0,1,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1}); param0.add(new int[]{19,37,44,65,72,87}); param0.add(new int[]{88}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}); param0.add(new int[]{5,8,53,60,85,94,77,53,81,54,67,48,56,49,16,1,85,6,55,98,62,36,4,7,64}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{2,5,7,13,16,23,24,25,27,31,31,33,34,35,38,46,49,49,51,52,58,61,62,66,68,71,73,78,91,94,98}); param1.add(new int[]{-8,-46,22,-66,-94,-96,70,58,-4,-70,-96,34,-80,-26,-52,52,-76}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{16,61,39,99,71,73,35,47,62,80,1,49,54,35,39,55,7,6,85,84,11,51,38,4,72,10,33,65,64,32,16,99,9}); param1.add(new int[]{-92,-92,-80,-72,-72,-72,-70,-68,-64,-56,-40,-38,-34,-24,-10,-8,-8,-2,0,2,4,6,14,14,18,20,34,36,36,38,38,42,48,56,64,70,72,76,76,76,76,78,84,90,94,96}); param1.add(new int[]{0,0,1,0,1,0,1,1,1,1,0,0,0,0,1,0,1,1,1,0,0,0}); param1.add(new int[]{17,31,39,46,56,88}); param1.add(new int[]{-30}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1}); param1.add(new int[]{69,37,32,5,84,14,25,9,86,85,30,82,99,92,32,43,79,58,75,90,49,54,95,76,80}); List<Integer> param2 = new ArrayList<>(); param2.add(23); param2.add(16); param2.add(21); param2.add(19); param2.add(27); param2.add(19); param2.add(4); param2.add(0); param2.add(13); 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 = [ ([2, 3, 3, 3, 4, 5, 6, 9, 18, 20, 35, 39, 39, 45, 50, 55, 57, 61, 63, 65, 72, 73, 77, 77, 78, 87, 88, 91, 93, 95, 98],[2, 5, 7, 13, 16, 23, 24, 25, 27, 31, 31, 33, 34, 35, 38, 46, 49, 49, 51, 52, 58, 61, 62, 66, 68, 71, 73, 78, 91, 94, 98],23,), ([-86, 10, -8, 8, -24, -2, -84, -86, -54, 50, 56, -22, -8, -62, 0, -50, -32],[-8, -46, 22, -66, -94, -96, 70, 58, -4, -70, -96, 34, -80, -26, -52, 52, -76],16,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],21,), ([3, 42, 88, 89, 41, 71, 67, 5, 84, 20, 75, 36, 34, 20, 31, 16, 86, 89, 53, 47, 57, 27, 47, 93, 59, 66, 40, 18, 69, 36, 98, 99, 81],[16, 61, 39, 99, 71, 73, 35, 47, 62, 80, 1, 49, 54, 35, 39, 55, 7, 6, 85, 84, 11, 51, 38, 4, 72, 10, 33, 65, 64, 32, 16, 99, 9],19,), ([-98, -94, -94, -90, -88, -82, -80, -78, -78, -68, -58, -58, -52, -36, -30, -14, -12, -6, -2, -2, 2, 4, 10, 14, 22, 24, 26, 38, 38, 46, 46, 48, 50, 54, 58, 60, 64, 64, 66, 70, 74, 74, 86, 88, 96, 96],[-92, -92, -80, -72, -72, -72, -70, -68, -64, -56, -40, -38, -34, -24, -10, -8, -8, -2, 0, 2, 4, 6, 14, 14, 18, 20, 34, 36, 36, 38, 38, 42, 48, 56, 64, 70, 72, 76, 76, 76, 76, 78, 84, 90, 94, 96],27,), ([1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],[0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0],19,), ([19, 37, 44, 65, 72, 87],[17, 31, 39, 46, 56, 88],4,), ([88],[-30],0,), ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1],13,), ([5, 8, 53, 60, 85, 94, 77, 53, 81, 54, 67, 48, 56, 49, 16, 1, 85, 6, 55, 98, 62, 36, 4, 7, 64],[69, 37, 32, 5, 84, 14, 25, 9, 86, 85, 30, 82, 99, 92, 32, 43, 79, 58, 75, 90, 49, 54, 95, 76, 80],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,3,3,3,4,5,6,9,18,20,35,39,39,45,50,55,57,61,63,65,72,73,77,77,78,87,88,91,93,95,98},{-86,10,-8,8,-24,-2,-84,-86,-54,50,56,-22,-8,-62,0,-50,-32},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{3,42,88,89,41,71,67,5,84,20,75,36,34,20,31,16,86,89,53,47,57,27,47,93,59,66,40,18,69,36,98,99,81},{-98,-94,-94,-90,-88,-82,-80,-78,-78,-68,-58,-58,-52,-36,-30,-14,-12,-6,-2,-2,2,4,10,14,22,24,26,38,38,46,46,48,50,54,58,60,64,64,66,70,74,74,86,88,96,96},{1,0,1,0,1,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1},{19,37,44,65,72,87},{88},{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1},{5,8,53,60,85,94,77,53,81,54,67,48,56,49,16,1,85,6,55,98,62,36,4,7,64}}; vector<vector<int>> param1 {{2,5,7,13,16,23,24,25,27,31,31,33,34,35,38,46,49,49,51,52,58,61,62,66,68,71,73,78,91,94,98},{-8,-46,22,-66,-94,-96,70,58,-4,-70,-96,34,-80,-26,-52,52,-76},{0,0,0,0,0,0,0,0,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},{16,61,39,99,71,73,35,47,62,80,1,49,54,35,39,55,7,6,85,84,11,51,38,4,72,10,33,65,64,32,16,99,9},{-92,-92,-80,-72,-72,-72,-70,-68,-64,-56,-40,-38,-34,-24,-10,-8,-8,-2,0,2,4,6,14,14,18,20,34,36,36,38,38,42,48,56,64,70,72,76,76,76,76,78,84,90,94,96},{0,0,1,0,1,0,1,1,1,1,0,0,0,0,1,0,1,1,1,0,0,0},{17,31,39,46,56,88},{-30},{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1},{69,37,32,5,84,14,25,9,86,85,30,82,99,92,32,43,79,58,75,90,49,54,95,76,80}}; vector<int> param2 {23,16,21,19,27,19,4,0,13,12}; 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_HEIGHT_OF_TRIANGULAR_ARRANGEMENT_OF_ARRAY_VALUES_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_HEIGHT_OF_TRIANGULAR_ARRANGEMENT_OF_ARRAY_VALUES_1{ static int f_gold ( int a [ ] , int n ) { return ( int ) Math . floor ( ( - 1 + Math . sqrt ( 1 + ( 8 * n ) ) ) / 2 ) ; }
import math def f_gold ( a , n ) : return ( - 1 + int ( math.sqrt ( 1 + ( 8 * n ) ) ) ) // 2
using namespace std; int f_gold ( int a [ ], int n ) { return floor ( ( - 1 + sqrt ( 1 + ( 8 * n ) ) ) / 2 ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,2,2,3,5,6,7,8,8,12,15,16,18,18,20,21,21,22,22,24,24,25,30,35,42,49,52,55,55,63,68,70,72,73,77,80,83,87,87,88,88,94,95,97}); param0.add(new int[]{48,-72,84,-24,28,94,36,28,32,66,-62,64,6,-68,-12,46,4,98,18,86,-60,76,14,98}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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[]{11,16,84,8,86,44,79,11,73,12,29,62,22,44,28,8,48,92,73,63,59,44,95,66}); param0.add(new int[]{-94,-94,-92,-88,-86,-82,-80,-80,-78,-76,-56,-56,-50,-44,-42,-36,-36,-32,-32,-26,-14,-12,-6,12,24,28,34,38,42,42,46,50,56,62,62,74,84,92,94}); param0.add(new int[]{0,1,0,1,0,1,1,0,1,1,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,1,1,1,0,1,1,1,1,1,0,0}); param0.add(new int[]{2,2,3,3,3,4,5,13,16,18,21,22,27,28,32,34,36,37,41,42,43,51,52,52,54,54,61,65,67,67,68,71,75,77,77,78,80,81,81,84,86,90,90,93,93,94,99,99}); param0.add(new int[]{54,-86}); param0.add(new int[]{0,1}); param0.add(new int[]{5,54,49,80,56,62,31,49,60,19,45,94,33,46,32}); List<Integer> param1 = new ArrayList<>(); param1.add(22); param1.add(12); param1.add(25); param1.add(14); param1.add(19); param1.add(24); param1.add(31); param1.add(1); param1.add(1); param1.add(8); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([1, 2, 2, 3, 5, 6, 7, 8, 8, 12, 15, 16, 18, 18, 20, 21, 21, 22, 22, 24, 24, 25, 30, 35, 42, 49, 52, 55, 55, 63, 68, 70, 72, 73, 77, 80, 83, 87, 87, 88, 88, 94, 95, 97],22,), ([48, -72, 84, -24, 28, 94, 36, 28, 32, 66, -62, 64, 6, -68, -12, 46, 4, 98, 18, 86, -60, 76, 14, 98],12,), ([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],25,), ([11, 16, 84, 8, 86, 44, 79, 11, 73, 12, 29, 62, 22, 44, 28, 8, 48, 92, 73, 63, 59, 44, 95, 66],14,), ([-94, -94, -92, -88, -86, -82, -80, -80, -78, -76, -56, -56, -50, -44, -42, -36, -36, -32, -32, -26, -14, -12, -6, 12, 24, 28, 34, 38, 42, 42, 46, 50, 56, 62, 62, 74, 84, 92, 94],19,), ([0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0],24,), ([2, 2, 3, 3, 3, 4, 5, 13, 16, 18, 21, 22, 27, 28, 32, 34, 36, 37, 41, 42, 43, 51, 52, 52, 54, 54, 61, 65, 67, 67, 68, 71, 75, 77, 77, 78, 80, 81, 81, 84, 86, 90, 90, 93, 93, 94, 99, 99],31,), ([54, -86],1,), ([0, 1],1,), ([5, 54, 49, 80, 56, 62, 31, 49, 60, 19, 45, 94, 33, 46, 32],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 {{1,2,2,3,5,6,7,8,8,12,15,16,18,18,20,21,21,22,22,24,24,25,30,35,42,49,52,55,55,63,68,70,72,73,77,80,83,87,87,88,88,94,95,97},{48,-72,84,-24,28,94,36,28,32,66,-62,64,6,-68,-12,46,4,98,18,86,-60,76,14,98},{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},{11,16,84,8,86,44,79,11,73,12,29,62,22,44,28,8,48,92,73,63,59,44,95,66},{-94,-94,-92,-88,-86,-82,-80,-80,-78,-76,-56,-56,-50,-44,-42,-36,-36,-32,-32,-26,-14,-12,-6,12,24,28,34,38,42,42,46,50,56,62,62,74,84,92,94},{0,1,0,1,0,1,1,0,1,1,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,1,1,1,0,1,1,1,1,1,0,0},{2,2,3,3,3,4,5,13,16,18,21,22,27,28,32,34,36,37,41,42,43,51,52,52,54,54,61,65,67,67,68,71,75,77,77,78,80,81,81,84,86,90,90,93,93,94,99,99},{54,-86},{0,1},{5,54,49,80,56,62,31,49,60,19,45,94,33,46,32}}; vector<int> param1 {22,12,25,14,19,24,31,1,1,8}; 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; }
EULERS_CRITERION_CHECK_IF_SQUARE_ROOT_UNDER_MODULO_P_EXISTS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class EULERS_CRITERION_CHECK_IF_SQUARE_ROOT_UNDER_MODULO_P_EXISTS{ static boolean f_gold ( int n , int p ) { n = n % p ; for ( int x = 2 ; x < p ; x ++ ) if ( ( x * x ) % p == n ) return true ; return false ; }
def f_gold ( n , p ) : n = n % p for x in range ( 2 , p , 1 ) : if ( ( x * x ) % p == n ) : return True return False
using namespace std; bool f_gold ( int n, int p ) { n = n % p; for ( int x = 2; x < p; x ++ ) if ( ( x * x ) % p == n ) return true; return false; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(71); param0.add(85); param0.add(4); param0.add(20); param0.add(71); param0.add(72); param0.add(36); param0.add(95); param0.add(83); param0.add(72); List<Integer> param1 = new ArrayList<>(); param1.add(78); param1.add(75); param1.add(35); param1.add(99); param1.add(29); param1.add(88); param1.add(54); param1.add(52); param1.add(33); 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 = [ (71,78,), (85,75,), (4,35,), (20,99,), (71,29,), (72,88,), (36,54,), (95,52,), (83,33,), (72,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 {71,85,4,20,71,72,36,95,83,72}; vector<int> param1 {78,75,35,99,29,88,54,52,33,13}; 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; }
CHECK_IF_A_GIVEN_ARRAY_CAN_REPRESENT_PREORDER_TRAVERSAL_OF_BINARY_SEARCH_TREE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_IF_A_GIVEN_ARRAY_CAN_REPRESENT_PREORDER_TRAVERSAL_OF_BINARY_SEARCH_TREE{ static boolean f_gold ( int pre [ ] , int n ) { Stack < Integer > s = new Stack < Integer > ( ) ; int root = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { if ( pre [ i ] < root ) { return false ; } while ( ! s . empty ( ) && s . peek ( ) < pre [ i ] ) { root = s . peek ( ) ; s . pop ( ) ; } s . push ( pre [ i ] ) ; } return true ; }
null
using namespace std; bool f_gold ( int pre [ ], int n ) { stack < int > s; int root = INT_MIN; for ( int i = 0; i < n; i ++ ) { if ( pre [ i ] < root ) return false; while ( ! s . empty ( ) && s . top ( ) < pre [ i ] ) { root = s . top ( ); s . pop ( ); } s . push ( pre [ i ] ); } return true; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,9,21,25,33,36,44,48,55,55,56,58,66,66,66,66,78,92,96,97}); param0.add(new int[]{-16,80,70,72,-86,-28,42,28,-28,56,-32,40,-78,32,22,-52,-58}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{10,85,45,52,98,9,59,58,61,91,4,90,43,48,47}); param0.add(new int[]{-92,-90,-88,-50,-48,-48,-44,-42,-40,-34,-28,-26,-26,-24,-8,-6,4,8,12,20,32,36,38,40,46,52,58,88,92}); param0.add(new int[]{1,0,1,1,1}); param0.add(new int[]{1,2,3,4,14,16,17,18,19,19,21,21,22,25,25,28,29,33,34,40,41,42,44,50,52,58,61,62,67,70,74,74,75,75,76,77,77,77,81,83,87,90,90,90,96,98,99,99}); param0.add(new int[]{-98,40,84,-8,42,-52,2,16,-68,-28,-54,88,8,-4,-98,-40,-32,-64,54,32,-76,-10,-48,-88,80,32,-2,-94,-26,-54,30,-56}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{9,35,62,78,55,29,55,36,77,89,73,31,53,94,22,23,87,96,7,15,71,61,25,61,99,34,1,87,21,14,58,69,61,49,54,7,89,52,78,97,11,78,27,37,56,19,20,21}); List<Integer> param1 = new ArrayList<>(); param1.add(18); param1.add(16); param1.add(35); param1.add(8); param1.add(17); param1.add(2); param1.add(30); param1.add(26); param1.add(17); param1.add(34); 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 {{4,9,21,25,33,36,44,48,55,55,56,58,66,66,66,66,78,92,96,97},{-16,80,70,72,-86,-28,42,28,-28,56,-32,40,-78,32,22,-52,-58},{0,0,0,0,0,0,0,0,0,0,0,0,0,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},{10,85,45,52,98,9,59,58,61,91,4,90,43,48,47},{-92,-90,-88,-50,-48,-48,-44,-42,-40,-34,-28,-26,-26,-24,-8,-6,4,8,12,20,32,36,38,40,46,52,58,88,92},{1,0,1,1,1},{1,2,3,4,14,16,17,18,19,19,21,21,22,25,25,28,29,33,34,40,41,42,44,50,52,58,61,62,67,70,74,74,75,75,76,77,77,77,81,83,87,90,90,90,96,98,99,99},{-98,40,84,-8,42,-52,2,16,-68,-28,-54,88,8,-4,-98,-40,-32,-64,54,32,-76,-10,-48,-88,80,32,-2,-94,-26,-54,30,-56},{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},{9,35,62,78,55,29,55,36,77,89,73,31,53,94,22,23,87,96,7,15,71,61,25,61,99,34,1,87,21,14,58,69,61,49,54,7,89,52,78,97,11,78,27,37,56,19,20,21}}; vector<int> param1 {18,16,35,8,17,2,30,26,17,34}; 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; }
WAYS_REMOVE_ONE_ELEMENT_BINARY_STRING_XOR_BECOMES_ZERO
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class WAYS_REMOVE_ONE_ELEMENT_BINARY_STRING_XOR_BECOMES_ZERO{ static int f_gold ( String s ) { int one_count = 0 , zero_count = 0 ; char [ ] str = s . toCharArray ( ) ; int n = str . length ; for ( int i = 0 ; i < n ; i ++ ) if ( str [ i ] == '1' ) one_count ++ ; else zero_count ++ ; if ( one_count % 2 == 0 ) return zero_count ; return one_count ; }
def f_gold ( str ) : one_count = 0 zero_count = 0 n = len ( str ) for i in range ( 0 , n , 1 ) : if ( str [ i ] == '1' ) : one_count += 1 else : zero_count += 1 if ( one_count % 2 == 0 ) : return zero_count return one_count
using namespace std; int f_gold ( string str ) { int one_count = 0, zero_count = 0; int n = str . length ( ); for ( int i = 0; i < n; i ++ ) if ( str [ i ] == '1' ) one_count ++; else zero_count ++; if ( one_count % 2 == 0 ) return zero_count; return one_count; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("KfcTJNP"); param0.add("05312505872"); param0.add("100111"); param0.add("tDEEhKxrQ"); param0.add("50824233019"); param0.add("10001110010"); param0.add("T SEZaNm MYQ"); param0.add("838415739"); param0.add("01110100"); param0.add("WYQiAey H"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('KfcTJNP',), ('05312505872',), ('100111',), ('tDEEhKxrQ',), ('50824233019',), ('10001110010',), ('T SEZaNm MYQ',), ('838415739',), ('01110100',), ('WYQiAey H',) ] 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 {"KfcTJNP","05312505872","100111","tDEEhKxrQ","50824233019","10001110010","T SEZaNm MYQ","838415739","01110100","WYQiAey H"}; 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_SUCH_THAT_DIFFERENCE_BETWEEN_ADJACENTS_IS_ONE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LONGEST_SUBSEQUENCE_SUCH_THAT_DIFFERENCE_BETWEEN_ADJACENTS_IS_ONE{ static int f_gold ( int arr [ ] , int n ) { int dp [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) dp [ i ] = 1 ; for ( int i = 1 ; i < n ; i ++ ) { for ( int j = 0 ; j < i ; j ++ ) { if ( ( arr [ i ] == arr [ j ] + 1 ) || ( arr [ i ] == arr [ j ] - 1 ) ) dp [ i ] = Math . max ( dp [ i ] , dp [ j ] + 1 ) ; } } int result = 1 ; for ( int i = 0 ; i < n ; i ++ ) if ( result < dp [ i ] ) result = dp [ i ] ; return result ; }
def f_gold ( arr , n ) : dp = [ 1 for i in range ( n ) ] for i in range ( n ) : for j in range ( i ) : if ( ( arr [ i ] == arr [ j ] + 1 ) or ( arr [ i ] == arr [ j ] - 1 ) ) : dp [ i ] = max ( dp [ i ] , dp [ j ] + 1 ) result = 1 for i in range ( n ) : if ( result < dp [ i ] ) : result = dp [ i ] return result
using namespace std; int f_gold ( int arr [ ], int n ) { int dp [ n ]; for ( int i = 0; i < n; i ++ ) dp [ i ] = 1; for ( int i = 1; i < n; i ++ ) { for ( int j = 0; j < i; j ++ ) { if ( ( arr [ i ] == arr [ j ] + 1 ) || ( arr [ i ] == arr [ j ] - 1 ) ) dp [ i ] = max ( dp [ i ], dp [ j ] + 1 ); } } int result = 1; for ( int i = 0; i < n; i ++ ) if ( result < dp [ i ] ) result = dp [ i ]; return result; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,13,15,17,18,20,22,24,28,34,37,43,46,47,49,51,52,54,58,64,65,77,78,79,87,90,92,93,94,97}); param0.add(new int[]{-86,-56,76,86,42,-40,8,34,-48,-54,-80,6,42,48,76,-26,6}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{5,22,15,26,29,47,22}); param0.add(new int[]{-90,-84,-76,-76,-74,-74,-66,-58,-58,-56,-56,-44,-38,-36,-34,-32,-16,-10,2,6,24,24,24,34,36,54,60,68,70,76,88}); param0.add(new int[]{0,1,1,1,0,0,1,0,1,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,1,1,1,0,0,0,1,0,0,1,1,1,0,0,1}); param0.add(new int[]{1,3,12,12,12,12,14,17,18,19,23,27,28,30,35,38,42,44,45,48,52,59,61,64,65,69,73,76,77,82,83,85,87,99}); param0.add(new int[]{-54,-20,24,-78,-58,64,34,70,-36,-24}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{5,35,75,21,82,32,28,53,20,27,42,92,32,70,81,75,72,66,97,60,11,83,14,30,5,68,17,27,62,86,26,20,97,91,44,69}); List<Integer> param1 = new ArrayList<>(); param1.add(23); param1.add(15); param1.add(16); param1.add(5); param1.add(17); param1.add(26); param1.add(23); param1.add(8); param1.add(27); param1.add(20); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([2, 13, 15, 17, 18, 20, 22, 24, 28, 34, 37, 43, 46, 47, 49, 51, 52, 54, 58, 64, 65, 77, 78, 79, 87, 90, 92, 93, 94, 97],23,), ([-86, -56, 76, 86, 42, -40, 8, 34, -48, -54, -80, 6, 42, 48, 76, -26, 6],15,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],16,), ([5, 22, 15, 26, 29, 47, 22],5,), ([-90, -84, -76, -76, -74, -74, -66, -58, -58, -56, -56, -44, -38, -36, -34, -32, -16, -10, 2, 6, 24, 24, 24, 34, 36, 54, 60, 68, 70, 76, 88],17,), ([0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1],26,), ([1, 3, 12, 12, 12, 12, 14, 17, 18, 19, 23, 27, 28, 30, 35, 38, 42, 44, 45, 48, 52, 59, 61, 64, 65, 69, 73, 76, 77, 82, 83, 85, 87, 99],23,), ([-54, -20, 24, -78, -58, 64, 34, 70, -36, -24],8,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],27,), ([5, 35, 75, 21, 82, 32, 28, 53, 20, 27, 42, 92, 32, 70, 81, 75, 72, 66, 97, 60, 11, 83, 14, 30, 5, 68, 17, 27, 62, 86, 26, 20, 97, 91, 44, 69],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,13,15,17,18,20,22,24,28,34,37,43,46,47,49,51,52,54,58,64,65,77,78,79,87,90,92,93,94,97},{-86,-56,76,86,42,-40,8,34,-48,-54,-80,6,42,48,76,-26,6},{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},{5,22,15,26,29,47,22},{-90,-84,-76,-76,-74,-74,-66,-58,-58,-56,-56,-44,-38,-36,-34,-32,-16,-10,2,6,24,24,24,34,36,54,60,68,70,76,88},{0,1,1,1,0,0,1,0,1,0,1,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,0,1,1,1,1,0,0,0,1,0,0,1,1,1,0,0,1},{1,3,12,12,12,12,14,17,18,19,23,27,28,30,35,38,42,44,45,48,52,59,61,64,65,69,73,76,77,82,83,85,87,99},{-54,-20,24,-78,-58,64,34,70,-36,-24},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{5,35,75,21,82,32,28,53,20,27,42,92,32,70,81,75,72,66,97,60,11,83,14,30,5,68,17,27,62,86,26,20,97,91,44,69}}; vector<int> param1 {23,15,16,5,17,26,23,8,27,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; }
FIND_MINIMUM_ELEMENT_IN_A_SORTED_AND_ROTATED_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_MINIMUM_ELEMENT_IN_A_SORTED_AND_ROTATED_ARRAY{ static int f_gold ( int arr [ ] , int low , int high ) { if ( high < low ) return arr [ 0 ] ; if ( high == low ) return arr [ low ] ; int mid = low + ( high - low ) / 2 ; if ( mid < high && arr [ mid + 1 ] < arr [ mid ] ) return arr [ mid + 1 ] ; if ( mid > low && arr [ mid ] < arr [ mid - 1 ] ) return arr [ mid ] ; if ( arr [ high ] > arr [ mid ] ) return f_gold ( arr , low , mid - 1 ) ; return f_gold ( arr , mid + 1 , high ) ; }
def f_gold ( arr , low , high ) : if high < low : return arr [ 0 ] if high == low : return arr [ low ] mid = int ( ( low + high ) / 2 ) if mid < high and arr [ mid + 1 ] < arr [ mid ] : return arr [ mid + 1 ] if mid > low and arr [ mid ] < arr [ mid - 1 ] : return arr [ mid ] if arr [ high ] > arr [ mid ] : return f_gold ( arr , low , mid - 1 ) return f_gold ( arr , mid + 1 , high )
using namespace std; int f_gold ( int arr [ ], int low, int high ) { if ( high < low ) return arr [ 0 ]; if ( high == low ) return arr [ low ]; int mid = low + ( high - low ) / 2; if ( mid < high && arr [ mid + 1 ] < arr [ mid ] ) return arr [ mid + 1 ]; if ( mid > low && arr [ mid ] < arr [ mid - 1 ] ) return arr [ mid ]; if ( arr [ high ] > arr [ mid ] ) return f_gold ( arr, low, mid - 1 ); return f_gold ( arr, mid + 1, high ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{16,22,50,64,68,79,84,88,89}); param0.add(new int[]{88,-38,46,24,-52,-12,-90,28,18,14,-72,58,-98,28,-84,44,-42,-32,-22,-22,-82,-30,90,18,62,62,92,6,60,28,-90,92,82,62,98,-68,48,-74,-8,50,62,24,30,-86,98,-96,-98}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{26,66,94,28,38,31,92,66,81,8,36,64,80,32,48,71,72,54,61,60,89}); param0.add(new int[]{-46,-26,-22,-14,46,62}); param0.add(new int[]{0,1,1,1}); param0.add(new int[]{14,81,87}); param0.add(new int[]{4}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{3,41,40,53,82,9,90,43,90,59,37,21,92,98,36,99,35,67,24,29,40,31,46,12,29,8,93,67,44,83,71,29,22,32,33,11,44,97,84,44,8,10,31,50,22,8}); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(42); param1.add(28); param1.add(19); param1.add(4); param1.add(2); param1.add(1); param1.add(0); param1.add(15); param1.add(42); List<Integer> param2 = new ArrayList<>(); param2.add(6); param2.add(31); param2.add(21); param2.add(17); param2.add(4); param2.add(2); param2.add(1); param2.add(0); param2.add(17); param2.add(31); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([16, 22, 50, 64, 68, 79, 84, 88, 89],4,6,), ([88, -38, 46, 24, -52, -12, -90, 28, 18, 14, -72, 58, -98, 28, -84, 44, -42, -32, -22, -22, -82, -30, 90, 18, 62, 62, 92, 6, 60, 28, -90, 92, 82, 62, 98, -68, 48, -74, -8, 50, 62, 24, 30, -86, 98, -96, -98],42,31,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],28,21,), ([26, 66, 94, 28, 38, 31, 92, 66, 81, 8, 36, 64, 80, 32, 48, 71, 72, 54, 61, 60, 89],19,17,), ([-46, -26, -22, -14, 46, 62],4,4,), ([0, 1, 1, 1],2,2,), ([14, 81, 87],1,1,), ([4],0,0,), ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],15,17,), ([3, 41, 40, 53, 82, 9, 90, 43, 90, 59, 37, 21, 92, 98, 36, 99, 35, 67, 24, 29, 40, 31, 46, 12, 29, 8, 93, 67, 44, 83, 71, 29, 22, 32, 33, 11, 44, 97, 84, 44, 8, 10, 31, 50, 22, 8],42,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 {{16,22,50,64,68,79,84,88,89},{88,-38,46,24,-52,-12,-90,28,18,14,-72,58,-98,28,-84,44,-42,-32,-22,-22,-82,-30,90,18,62,62,92,6,60,28,-90,92,82,62,98,-68,48,-74,-8,50,62,24,30,-86,98,-96,-98},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{26,66,94,28,38,31,92,66,81,8,36,64,80,32,48,71,72,54,61,60,89},{-46,-26,-22,-14,46,62},{0,1,1,1},{14,81,87},{4},{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},{3,41,40,53,82,9,90,43,90,59,37,21,92,98,36,99,35,67,24,29,40,31,46,12,29,8,93,67,44,83,71,29,22,32,33,11,44,97,84,44,8,10,31,50,22,8}}; vector<int> param1 {4,42,28,19,4,2,1,0,15,42}; vector<int> param2 {6,31,21,17,4,2,1,0,17,31}; 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; }
MINIMUM_NUMBER_OF_SQUARES_WHOSE_SUM_EQUALS_TO_GIVEN_NUMBER_N_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_NUMBER_OF_SQUARES_WHOSE_SUM_EQUALS_TO_GIVEN_NUMBER_N_1{ static int f_gold ( int n ) { if ( n <= 3 ) return n ; int dp [ ] = new int [ n + 1 ] ; dp [ 0 ] = 0 ; dp [ 1 ] = 1 ; dp [ 2 ] = 2 ; dp [ 3 ] = 3 ; for ( int i = 4 ; i <= n ; i ++ ) { dp [ i ] = i ; for ( int x = 1 ; x <= Math . ceil ( Math . sqrt ( i ) ) ; x ++ ) { int temp = x * x ; if ( temp > i ) break ; else dp [ i ] = Math . min ( dp [ i ] , 1 + dp [ i - temp ] ) ; } } int res = dp [ n ] ; return res ; }
null
using namespace std; int f_gold ( int n ) { int * dp = new int [ n + 1 ]; dp [ 0 ] = 0; dp [ 1 ] = 1; dp [ 2 ] = 2; dp [ 3 ] = 3; for ( int i = 4; i <= n; i ++ ) { dp [ i ] = i; for ( int x = 1; x <= ceil ( sqrt ( i ) ); x ++ ) { int temp = x * x; if ( temp > i ) break; else dp [ i ] = min ( dp [ i ], 1 + dp [ i - temp ] ); } } int res = dp [ n ]; delete [ ] dp; return res; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(16); param0.add(33); param0.add(47); param0.add(98); param0.add(36); param0.add(81); param0.add(55); param0.add(19); param0.add(4); param0.add(22); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<int> param0 {16,33,47,98,36,81,55,19,4,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; }
MINIMUM_COST_CONNECT_WEIGHTED_NODES_REPRESENTED_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_COST_CONNECT_WEIGHTED_NODES_REPRESENTED_ARRAY{ static int f_gold ( int a [ ] , int n ) { int mn = Integer . MAX_VALUE ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { mn = Math . min ( a [ i ] , mn ) ; sum += a [ i ] ; } return mn * ( sum - mn ) ; }
import sys def f_gold ( a , n ) : mn = sys.maxsize sum = 0 for i in range ( n ) : mn = min ( a [ i ] , mn ) sum += a [ i ] return mn * ( sum - mn )
using namespace std; int f_gold ( int a [ ], int n ) { int mn = INT_MAX; int sum = 0; for ( int i = 0; i < n; i ++ ) { mn = min ( a [ i ], mn ); sum += a [ i ]; } return mn * ( sum - mn ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,8,14,15,17,17,19,21,22,23,29,32,36,37,43,45,46,47,47,53,57,57,70,71,72,76,81,82,90,95,96,98,99}); param0.add(new int[]{94,-18,50,94,-74,-50,-44,-92,-58,14,-66,-78}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{15,18,64,28}); param0.add(new int[]{-96,-88,-88,-84,-82,-78,-78,-60,-58,-56,-54,-52,-48,-44,-28,-26,-14,-12,6,10,10,14,14,50,52,54,60,62,62,64,66,70,72,72,78,80,84}); param0.add(new int[]{0,1,1,0,1,1,1,1}); param0.add(new int[]{3,10,14,14,15,16,18,20,21,30,31,33,35,39,46,48,59,59,61,77,78,79,81,83,85,92,97,97,99}); param0.add(new int[]{4,-32,68,-48,54,24,78,98,-70,44,-82,-92,-16,-92,-70,52,-58,-62,-58,32,14,-4,80,-78,-26,-24,-8}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{82,74,53,91,81,88,42,62,38,43,29,60,43,44,19,28,20,1,5,94,18,77,52,38,55,1,10,29,34,91,64,80,81,39,4,47,30,62,58,66,73,52,62,9,36,49}); List<Integer> param1 = new ArrayList<>(); param1.add(32); param1.add(10); param1.add(24); param1.add(2); param1.add(31); param1.add(6); param1.add(23); param1.add(18); param1.add(35); param1.add(38); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([3, 8, 14, 15, 17, 17, 19, 21, 22, 23, 29, 32, 36, 37, 43, 45, 46, 47, 47, 53, 57, 57, 70, 71, 72, 76, 81, 82, 90, 95, 96, 98, 99],32,), ([94, -18, 50, 94, -74, -50, -44, -92, -58, 14, -66, -78],10,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,), ([15, 18, 64, 28],2,), ([-96, -88, -88, -84, -82, -78, -78, -60, -58, -56, -54, -52, -48, -44, -28, -26, -14, -12, 6, 10, 10, 14, 14, 50, 52, 54, 60, 62, 62, 64, 66, 70, 72, 72, 78, 80, 84],31,), ([0, 1, 1, 0, 1, 1, 1, 1],6,), ([3, 10, 14, 14, 15, 16, 18, 20, 21, 30, 31, 33, 35, 39, 46, 48, 59, 59, 61, 77, 78, 79, 81, 83, 85, 92, 97, 97, 99],23,), ([4, -32, 68, -48, 54, 24, 78, 98, -70, 44, -82, -92, -16, -92, -70, 52, -58, -62, -58, 32, 14, -4, 80, -78, -26, -24, -8],18,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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],35,), ([82, 74, 53, 91, 81, 88, 42, 62, 38, 43, 29, 60, 43, 44, 19, 28, 20, 1, 5, 94, 18, 77, 52, 38, 55, 1, 10, 29, 34, 91, 64, 80, 81, 39, 4, 47, 30, 62, 58, 66, 73, 52, 62, 9, 36, 49],38,) ] 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,8,14,15,17,17,19,21,22,23,29,32,36,37,43,45,46,47,47,53,57,57,70,71,72,76,81,82,90,95,96,98,99},{94,-18,50,94,-74,-50,-44,-92,-58,14,-66,-78},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{15,18,64,28},{-96,-88,-88,-84,-82,-78,-78,-60,-58,-56,-54,-52,-48,-44,-28,-26,-14,-12,6,10,10,14,14,50,52,54,60,62,62,64,66,70,72,72,78,80,84},{0,1,1,0,1,1,1,1},{3,10,14,14,15,16,18,20,21,30,31,33,35,39,46,48,59,59,61,77,78,79,81,83,85,92,97,97,99},{4,-32,68,-48,54,24,78,98,-70,44,-82,-92,-16,-92,-70,52,-58,-62,-58,32,14,-4,80,-78,-26,-24,-8},{0,0,0,0,0,0,0,0,0,0,0,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},{82,74,53,91,81,88,42,62,38,43,29,60,43,44,19,28,20,1,5,94,18,77,52,38,55,1,10,29,34,91,64,80,81,39,4,47,30,62,58,66,73,52,62,9,36,49}}; vector<int> param1 {32,10,24,2,31,6,23,18,35,38}; 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_A_TRIPLET_THAT_SUM_TO_A_GIVEN_VALUE_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_A_TRIPLET_THAT_SUM_TO_A_GIVEN_VALUE_2{ static boolean f_gold ( int A [ ] , int arr_size , int sum ) { for ( int i = 0 ; i < arr_size - 2 ; i ++ ) { HashSet < Integer > s = new HashSet < Integer > ( ) ; int curr_sum = sum - A [ i ] ; for ( int j = i + 1 ; j < arr_size ; j ++ ) { if ( s . contains ( curr_sum - A [ j ] ) && curr_sum - A [ j ] != ( int ) s . toArray ( ) [ s . size ( ) - 1 ] ) { System . out . printf ( "Triplet is %d, %d, %d" , A [ i ] , A [ j ] , curr_sum - A [ j ] ) ; return true ; } s . add ( A [ j ] ) ; } } return false ; }
def f_gold ( A , arr_size , sum ) : for i in range ( 0 , arr_size - 1 ) : s = set ( ) curr_sum = sum - A [ i ] for j in range ( i + 1 , arr_size ) : if ( curr_sum - A [ j ] ) in s : print ( "Triplet is" , A [ i ] , ", " , A [ j ] , ", " , curr_sum - A [ j ] ) return True s.add ( A [ j ] ) return False
using namespace std; bool f_gold ( int A [ ], int arr_size, int sum ) { for ( int i = 0; i < arr_size - 2; i ++ ) { unordered_set < int > s; int curr_sum = sum - A [ i ]; for ( int j = i + 1; j < arr_size; j ++ ) { if ( s . find ( curr_sum - A [ j ] ) != s . end ( ) ) { printf ( "Triplet is %d, %d, %d", A [ i ], A [ j ], curr_sum - A [ j ] ); return true; } s . insert ( A [ j ] ); } } return false; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,6,8,8,9,11,13,13,15,17,21,24,38,38,42,43,46,46,47,54,55,56,57,58,60,60,60,62,63,63,65,66,67,67,69,81,84,84,85,86,95,99}); param0.add(new int[]{20,-86,-24,38,-32,-64,-72,72,68,94,18,-60,-4,-18,-18,-70,6,-86,46,-16,46,-28}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{13,96,31,39,23,39,50,10,21,64,41,54,44,97,24,91,79,86,38,49,77,71,8,98,85,36,37,65,42,48}); param0.add(new int[]{-86,-68,-58,-56,-54,-54,-48,-40,-36,-32,-26,-16,-14,-12,-12,-4,-4,-4,0,10,22,22,30,54,62,68,88,88}); param0.add(new int[]{0,1,1,1,1,0,0}); param0.add(new int[]{8,8,9,13,20,24,29,52,53,96}); param0.add(new int[]{18,-92,-10,26,58,-48,38,66,-98,-72,4,76,-52,20,60,-56,96,60,-10,-26,-64,-66,-22,-86,74,82,2,-14,76,82,40,70,-40,-2,-46,-38,22,98,58}); param0.add(new int[]{1,1,1,1}); param0.add(new int[]{72}); List<Integer> param1 = new ArrayList<>(); param1.add(27); param1.add(21); param1.add(17); param1.add(17); param1.add(21); param1.add(5); param1.add(9); param1.add(30); param1.add(2); param1.add(0); List<Integer> param2 = new ArrayList<>(); param2.add(24); param2.add(20); param2.add(13); param2.add(18); param2.add(25); param2.add(3); param2.add(8); param2.add(30); param2.add(2); param2.add(0); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([1, 6, 8, 8, 9, 11, 13, 13, 15, 17, 21, 24, 38, 38, 42, 43, 46, 46, 47, 54, 55, 56, 57, 58, 60, 60, 60, 62, 63, 63, 65, 66, 67, 67, 69, 81, 84, 84, 85, 86, 95, 99],27,24,), ([20, -86, -24, 38, -32, -64, -72, 72, 68, 94, 18, -60, -4, -18, -18, -70, 6, -86, 46, -16, 46, -28],21,20,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1],17,13,), ([13, 96, 31, 39, 23, 39, 50, 10, 21, 64, 41, 54, 44, 97, 24, 91, 79, 86, 38, 49, 77, 71, 8, 98, 85, 36, 37, 65, 42, 48],17,18,), ([-86, -68, -58, -56, -54, -54, -48, -40, -36, -32, -26, -16, -14, -12, -12, -4, -4, -4, 0, 10, 22, 22, 30, 54, 62, 68, 88, 88],21,25,), ([0, 1, 1, 1, 1, 0, 0],5,3,), ([8, 8, 9, 13, 20, 24, 29, 52, 53, 96],9,8,), ([18, -92, -10, 26, 58, -48, 38, 66, -98, -72, 4, 76, -52, 20, 60, -56, 96, 60, -10, -26, -64, -66, -22, -86, 74, 82, 2, -14, 76, 82, 40, 70, -40, -2, -46, -38, 22, 98, 58],30,30,), ([1, 1, 1, 1],2,2,), ([72],0,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)))
int main() { int n_success = 0; vector<vector<int>> param0 {{1,6,8,8,9,11,13,13,15,17,21,24,38,38,42,43,46,46,47,54,55,56,57,58,60,60,60,62,63,63,65,66,67,67,69,81,84,84,85,86,95,99},{20,-86,-24,38,-32,-64,-72,72,68,94,18,-60,-4,-18,-18,-70,6,-86,46,-16,46,-28},{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},{13,96,31,39,23,39,50,10,21,64,41,54,44,97,24,91,79,86,38,49,77,71,8,98,85,36,37,65,42,48},{-86,-68,-58,-56,-54,-54,-48,-40,-36,-32,-26,-16,-14,-12,-12,-4,-4,-4,0,10,22,22,30,54,62,68,88,88},{0,1,1,1,1,0,0},{8,8,9,13,20,24,29,52,53,96},{18,-92,-10,26,58,-48,38,66,-98,-72,4,76,-52,20,60,-56,96,60,-10,-26,-64,-66,-22,-86,74,82,2,-14,76,82,40,70,-40,-2,-46,-38,22,98,58},{1,1,1,1},{72}}; vector<int> param1 {27,21,17,17,21,5,9,30,2,0}; vector<int> param2 {24,20,13,18,25,3,8,30,2,0}; 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; }
MAXIMUM_PRODUCT_INCREASING_SUBSEQUENCE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_PRODUCT_INCREASING_SUBSEQUENCE{ static int f_gold ( int [ ] arr , int n ) { int [ ] mpis = new int [ n ] ; int max = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) mpis [ i ] = arr [ i ] ; for ( int i = 1 ; i < n ; i ++ ) for ( int j = 0 ; j < i ; j ++ ) if ( arr [ i ] > arr [ j ] && mpis [ i ] < ( mpis [ j ] * arr [ i ] ) ) mpis [ i ] = mpis [ j ] * arr [ i ] ; for ( int k = 0 ; k < mpis . length ; k ++ ) { if ( mpis [ k ] > max ) { max = mpis [ k ] ; } } return max ; }
def f_gold ( arr , n ) : mpis = [ 0 ] * ( n ) for i in range ( n ) : mpis [ i ] = arr [ i ] for i in range ( 1 , n ) : for j in range ( i ) : if ( arr [ i ] > arr [ j ] and mpis [ i ] < ( mpis [ j ] * arr [ i ] ) ) : mpis [ i ] = mpis [ j ] * arr [ i ] return max ( mpis )
null
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,1,4,7,7,9,12,20,45,53,58,63,65,65,86,98,98}); param0.add(new int[]{46,-58,70,60,74,42,6,-26,78,32,14,-56,-48,86,-2,94,-44,-62,-50,-8,-4,-36,-62,-98,-98,-78,56,92,88}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{13,71,93,68,43,75,44,15,1,91,7,9,65,85,46,87,37,74,19,30,87,27,82,92,12,36,6,27,76,80,30,83,67,83,65,28,81,59,63,11,70}); param0.add(new int[]{-96,-94,-92,-88,-84,-80,-74,-70,-62,-56,-48,-46,-40,-34,-32,-26,-22,-22,-12,-10,-8,-6,-2,0,2,4,6,18,18,30,34,34,38,38,40,48,54,56,60,84,88,88,90,94,96}); param0.add(new int[]{1,1,1,1,1,0,1,0,0,1,1,0,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1}); param0.add(new int[]{1,1,5,5,6,7,18,35,39,51,64,73,87,90,91,92}); param0.add(new int[]{-54,8,-92,-28,72,54,-74,36,-10,54,-30,-16,-72,-32,-92,38,-76,-76,-50,-92,48}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{47,57,72,40,53,46,62,51,42,89,9,91,58,67,20,91,63,50,32,6,63,49,3,89,87,54,65,72,72,62,31,6,48,87,17,95,59,57}); List<Integer> param1 = new ArrayList<>(); param1.add(12); param1.add(27); param1.add(14); param1.add(20); param1.add(30); param1.add(22); param1.add(11); param1.add(19); param1.add(26); param1.add(30); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([1, 1, 4, 7, 7, 9, 12, 20, 45, 53, 58, 63, 65, 65, 86, 98, 98],12,), ([46, -58, 70, 60, 74, 42, 6, -26, 78, 32, 14, -56, -48, 86, -2, 94, -44, -62, -50, -8, -4, -36, -62, -98, -98, -78, 56, 92, 88],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],14,), ([13, 71, 93, 68, 43, 75, 44, 15, 1, 91, 7, 9, 65, 85, 46, 87, 37, 74, 19, 30, 87, 27, 82, 92, 12, 36, 6, 27, 76, 80, 30, 83, 67, 83, 65, 28, 81, 59, 63, 11, 70],20,), ([-96, -94, -92, -88, -84, -80, -74, -70, -62, -56, -48, -46, -40, -34, -32, -26, -22, -22, -12, -10, -8, -6, -2, 0, 2, 4, 6, 18, 18, 30, 34, 34, 38, 38, 40, 48, 54, 56, 60, 84, 88, 88, 90, 94, 96],30,), ([1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],22,), ([1, 1, 5, 5, 6, 7, 18, 35, 39, 51, 64, 73, 87, 90, 91, 92],11,), ([-54, 8, -92, -28, 72, 54, -74, 36, -10, 54, -30, -16, -72, -32, -92, 38, -76, -76, -50, -92, 48],19,), ([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,), ([47, 57, 72, 40, 53, 46, 62, 51, 42, 89, 9, 91, 58, 67, 20, 91, 63, 50, 32, 6, 63, 49, 3, 89, 87, 54, 65, 72, 72, 62, 31, 6, 48, 87, 17, 95, 59, 57],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
FIND_NUMBER_PERFECT_SQUARES_TWO_GIVEN_NUMBERS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_NUMBER_PERFECT_SQUARES_TWO_GIVEN_NUMBERS{ static int f_gold ( int a , int b ) { int cnt = 0 ; for ( int i = a ; i <= b ; i ++ ) for ( int j = 1 ; j * j <= i ; j ++ ) if ( j * j == i ) cnt ++ ; return cnt ; }
null
using namespace std; int f_gold ( int a, int b ) { int cnt = 0; for ( int i = a; i <= b; i ++ ) for ( int j = 1; j * j <= i; j ++ ) if ( j * j == i ) cnt ++; return cnt; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(48); param0.add(3); param0.add(20); param0.add(98); param0.add(96); param0.add(40); param0.add(9); param0.add(57); param0.add(28); param0.add(98); List<Integer> param1 = new ArrayList<>(); param1.add(42); param1.add(82); param1.add(72); param1.add(98); param1.add(90); param1.add(82); param1.add(15); param1.add(77); param1.add(80); param1.add(75); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<int> param0 {48,3,20,98,96,40,9,57,28,98}; vector<int> param1 {42,82,72,98,90,82,15,77,80,75}; 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; }
SUM_SERIES_0_6_0_06_0_006_0_0006_N_TERMS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_SERIES_0_6_0_06_0_006_0_0006_N_TERMS{ static double f_gold ( int n ) { return ( 0.666 ) * ( 1 - 1 / Math . pow ( 10 , n ) ) ; }
def f_gold ( n ) : return ( ( 0.666 ) * ( 1 - 1 / pow ( 10 , n ) ) ) ;
using namespace std; float f_gold ( int n ) { return ( 0.666 ) * ( 1 - 1 / pow ( 10, n ) ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(1); param0.add(2); param0.add(3); param0.add(4); param0.add(5); param0.add(74); param0.add(77); param0.add(67); param0.add(9); param0.add(12); for(int i = 0; i < param0.size(); ++i) { if(Math.abs(1 - (0.0000001 + Math.abs(f_gold(param0.get(i))) )/ (Math.abs(f_filled(param0.get(i))) + 0.0000001)) < 0.001) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (1,), (2,), (3,), (4,), (5,), (74,), (77,), (67,), (9,), (12,) ] 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 {1,2,3,4,5,74,77,67,9,12}; 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; }
MAXIMIZE_SUM_CONSECUTIVE_DIFFERENCES_CIRCULAR_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMIZE_SUM_CONSECUTIVE_DIFFERENCES_CIRCULAR_ARRAY{ static int f_gold ( int arr [ ] , int n ) { int sum = 0 ; Arrays . sort ( arr ) ; for ( int i = 0 ; i < n / 2 ; i ++ ) { sum -= ( 2 * arr [ i ] ) ; sum += ( 2 * arr [ n - i - 1 ] ) ; } return sum ; }
def f_gold ( arr , n ) : sum = 0 arr.sort ( ) for i in range ( 0 , int ( n / 2 ) ) : sum -= ( 2 * arr [ i ] ) sum += ( 2 * arr [ n - i - 1 ] ) return sum
using namespace std; int f_gold ( int arr [ ], int n ) { int sum = 0; sort ( arr, arr + n ); for ( int i = 0; i < n / 2; i ++ ) { sum -= ( 2 * arr [ i ] ); sum += ( 2 * arr [ n - i - 1 ] ); } return sum; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{8,9,12,13,17,21,24,29,37,37,39,40,41,45,49,50,53,54,56,59,60,60,70,71,72,74,77,77,78,85,89,89,90,90,95,98,98}); param0.add(new int[]{0,48,-32,28,-84,14,30,-80,92,76,-52,-20,52,78,20,32,96,66,48,26,88,6,94,32,-40,44,-84,54,-84,-80,-80,-64,-92,-84,-16,-18}); param0.add(new int[]{0,0,0,1,1,1}); param0.add(new int[]{47,7,84,96,59,53,80}); param0.add(new int[]{-88,-80,-68,-62,-60,-60,-48,-46,-44,-38,-16,-16,0,0,2,8,20,36,40,40,44,54,60,68,70,82,82,84,92,94,96}); param0.add(new int[]{1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,1,0,0,0,1,0,0,1,0,0,0,1,0,1,1}); param0.add(new int[]{2,5,10,11,13,14,15,17,17,23,23,24,27,27,28,29,30,40,42,43,46,47,51,52,57,64,65,73,74,75,76,77,81,81,82,87,89,93,95,95,99}); param0.add(new int[]{-72,-84,84,2,-76,48,12,-72,-92,-72,38,26,-38,26,50,2,20,26,-48,30,24,-12,-84,-54,20,-16,-94,26,-22,86}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{57,74,53,52,80,31,27,53,8,57,46,73,46,56,73,84,37,7,97}); List<Integer> param1 = new ArrayList<>(); param1.add(34); param1.add(24); param1.add(3); param1.add(5); param1.add(29); param1.add(32); param1.add(35); param1.add(21); param1.add(37); param1.add(13); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([8, 9, 12, 13, 17, 21, 24, 29, 37, 37, 39, 40, 41, 45, 49, 50, 53, 54, 56, 59, 60, 60, 70, 71, 72, 74, 77, 77, 78, 85, 89, 89, 90, 90, 95, 98, 98],34,), ([0, 48, -32, 28, -84, 14, 30, -80, 92, 76, -52, -20, 52, 78, 20, 32, 96, 66, 48, 26, 88, 6, 94, 32, -40, 44, -84, 54, -84, -80, -80, -64, -92, -84, -16, -18],24,), ([0, 0, 0, 1, 1, 1],3,), ([47, 7, 84, 96, 59, 53, 80],5,), ([-88, -80, -68, -62, -60, -60, -48, -46, -44, -38, -16, -16, 0, 0, 2, 8, 20, 36, 40, 40, 44, 54, 60, 68, 70, 82, 82, 84, 92, 94, 96],29,), ([1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1],32,), ([2, 5, 10, 11, 13, 14, 15, 17, 17, 23, 23, 24, 27, 27, 28, 29, 30, 40, 42, 43, 46, 47, 51, 52, 57, 64, 65, 73, 74, 75, 76, 77, 81, 81, 82, 87, 89, 93, 95, 95, 99],35,), ([-72, -84, 84, 2, -76, 48, 12, -72, -92, -72, 38, 26, -38, 26, 50, 2, 20, 26, -48, 30, 24, -12, -84, -54, 20, -16, -94, 26, -22, 86],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, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],37,), ([57, 74, 53, 52, 80, 31, 27, 53, 8, 57, 46, 73, 46, 56, 73, 84, 37, 7, 97],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 {{8,9,12,13,17,21,24,29,37,37,39,40,41,45,49,50,53,54,56,59,60,60,70,71,72,74,77,77,78,85,89,89,90,90,95,98,98},{0,48,-32,28,-84,14,30,-80,92,76,-52,-20,52,78,20,32,96,66,48,26,88,6,94,32,-40,44,-84,54,-84,-80,-80,-64,-92,-84,-16,-18},{0,0,0,1,1,1},{47,7,84,96,59,53,80},{-88,-80,-68,-62,-60,-60,-48,-46,-44,-38,-16,-16,0,0,2,8,20,36,40,40,44,54,60,68,70,82,82,84,92,94,96},{1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,1,0,0,0,1,0,0,1,0,0,0,1,0,1,1},{2,5,10,11,13,14,15,17,17,23,23,24,27,27,28,29,30,40,42,43,46,47,51,52,57,64,65,73,74,75,76,77,81,81,82,87,89,93,95,95,99},{-72,-84,84,2,-76,48,12,-72,-92,-72,38,26,-38,26,50,2,20,26,-48,30,24,-12,-84,-54,20,-16,-94,26,-22,86},{0,0,0,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},{57,74,53,52,80,31,27,53,8,57,46,73,46,56,73,84,37,7,97}}; vector<int> param1 {34,24,3,5,29,32,35,21,37,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; }
FINDING_POWER_PRIME_NUMBER_P_N
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FINDING_POWER_PRIME_NUMBER_P_N{ static int f_gold ( int n , int p ) { int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int count = 0 , temp = i ; while ( temp % p == 0 ) { count ++ ; temp = temp / p ; } ans += count ; } return ans ; }
def f_gold ( n , p ) : ans = 0 ; temp = p ; while ( temp <= n ) : ans += n / temp ; temp = temp * p ; return ans ;
using namespace std; int f_gold ( int n, int p ) { int ans = 0; int temp = p; while ( temp <= n ) { ans += n / temp; temp = temp * p; } return ans; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(49); param0.add(80); param0.add(10); param0.add(81); param0.add(11); param0.add(45); param0.add(86); param0.add(27); param0.add(80); param0.add(97); List<Integer> param1 = new ArrayList<>(); param1.add(30); param1.add(25); param1.add(9); param1.add(57); param1.add(4); param1.add(34); param1.add(90); param1.add(78); param1.add(60); param1.add(31); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (49,30,), (80,25,), (10,9,), (81,57,), (11,4,), (45,34,), (86,90,), (27,78,), (80,60,), (97,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<int> param0 {49,80,10,81,11,45,86,27,80,97}; vector<int> param1 {30,25,9,57,4,34,90,78,60,31}; 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; }
DYNAMIC_PROGRAMMING_SET_8_MATRIX_CHAIN_MULTIPLICATION
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DYNAMIC_PROGRAMMING_SET_8_MATRIX_CHAIN_MULTIPLICATION{ static int f_gold ( int p [ ] , int i , int j ) { if ( i == j ) return 0 ; int min = Integer . MAX_VALUE ; for ( int k = i ; k < j ; k ++ ) { int count = f_gold ( p , i , k ) + f_gold ( p , k + 1 , j ) + p [ i - 1 ] * p [ k ] * p [ j ] ; if ( count < min ) min = count ; } return min ; }
null
using namespace std; int f_gold ( int p [ ], int i, int j ) { if ( i == j ) return 0; int k; int min = INT_MAX; int count; for ( k = i; k < j; k ++ ) { count = f_gold ( p, i, k ) + f_gold ( p, k + 1, j ) + p [ i - 1 ] * p [ k ] * p [ j ]; if ( count < min ) min = count; } return min; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{6,12,16,30,31,31,33,34,45,48,57,63,81,83}); param0.add(new int[]{30,-78,42,-6,42,56,-38,28,-96,-96,84,-18,0,20,-56,-40,-58,-74,64,62,-22,78,10,-22,16,-48,2,14,82,-92,-64,-18,42,24,22,-50,12,-76,38,-30,-86,-58,-6,-4,10,28}); param0.add(new int[]{0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{54,46}); param0.add(new int[]{-80,-76,-68,-66,-54,-12,-10,-6,6,8,20,20,22,60,66,78,78,82,98}); param0.add(new int[]{0,0,1,0,0,1,0,1,1,1,0,0,1,1,0,1,1,1,0,1,0}); param0.add(new int[]{14,21,29,31,37,50,51,54,57,62,64,72,85,98}); param0.add(new int[]{-86,98,90,-20,90,68,70,-24,-10,-80,70,-42,14,56,-26,-42,2,-62,24,10,-46,-66,-82,-98,-84,-2,-52,-50,0,-18,90,-32,98,86}); param0.add(new int[]{0,0,1,1,1,1}); param0.add(new int[]{52,15,61,73,45,5,15,54,69,90,5,56,13,54,27,72,58,21,35,2,59,55,64,92,54,63,50,95,38,53,38,53,73,27,86,86,99,42,85,80,43,32,80,57,78}); List<Integer> param1 = new ArrayList<>(); param1.add(10); param1.add(30); param1.add(7); param1.add(1); param1.add(13); param1.add(20); param1.add(7); param1.add(23); param1.add(5); param1.add(26); List<Integer> param2 = new ArrayList<>(); param2.add(9); param2.add(27); param2.add(7); param2.add(1); param2.add(10); param2.add(17); param2.add(11); param2.add(26); param2.add(4); param2.add(42); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{6,12,16,30,31,31,33,34,45,48,57,63,81,83},{30,-78,42,-6,42,56,-38,28,-96,-96,84,-18,0,20,-56,-40,-58,-74,64,62,-22,78,10,-22,16,-48,2,14,82,-92,-64,-18,42,24,22,-50,12,-76,38,-30,-86,-58,-6,-4,10,28},{0,0,0,0,0,0,1,1,1,1,1,1,1},{54,46},{-80,-76,-68,-66,-54,-12,-10,-6,6,8,20,20,22,60,66,78,78,82,98},{0,0,1,0,0,1,0,1,1,1,0,0,1,1,0,1,1,1,0,1,0},{14,21,29,31,37,50,51,54,57,62,64,72,85,98},{-86,98,90,-20,90,68,70,-24,-10,-80,70,-42,14,56,-26,-42,2,-62,24,10,-46,-66,-82,-98,-84,-2,-52,-50,0,-18,90,-32,98,86},{0,0,1,1,1,1},{52,15,61,73,45,5,15,54,69,90,5,56,13,54,27,72,58,21,35,2,59,55,64,92,54,63,50,95,38,53,38,53,73,27,86,86,99,42,85,80,43,32,80,57,78}}; vector<int> param1 {10,30,7,1,13,20,7,23,5,26}; vector<int> param2 {9,27,7,1,10,17,11,26,4,42}; 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; }
NON_REPEATING_ELEMENT
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NON_REPEATING_ELEMENT{ static int f_gold ( int arr [ ] , int n ) { for ( int i = 0 ; i < n ; i ++ ) { int j ; for ( j = 0 ; j < n ; j ++ ) if ( i != j && arr [ i ] == arr [ j ] ) break ; if ( j == n ) return arr [ i ] ; } return - 1 ; }
def f_gold ( arr , n ) : for i in range ( n ) : j = 0 while ( j < n ) : if ( i != j and arr [ i ] == arr [ j ] ) : break j += 1 if ( j == n ) : return arr [ i ] return - 1
using namespace std; int f_gold ( int arr [ ], int n ) { for ( int i = 0; i < n; i ++ ) { int j; for ( j = 0; j < n; j ++ ) if ( i != j && arr [ i ] == arr [ j ] ) break; if ( j == n ) return arr [ i ]; } return - 1; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{1,2,3,4,6,6,7,9,10,13,16,23,30,32,36,42,42,43,44,47,48,48,49,52,52,53,55,56,58,59,60,60,63,67,68,68,74,75,76,80,81,81,83,83,86,87,91,92,97}); param0.add(new int[]{-96,-46,-86,56,-72,50,18,8,50}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{19,10,49,40,34,21,63,51}); param0.add(new int[]{-96,-96,-90,-88,-88,-84,-80,-76,-68,-64,-64,-52,-52,-52,-52,-50,-50,-48,-48,-40,-32,-26,-24,-22,-20,-14,-12,0,6,8,10,20,24,28,34,36,54,60,60,60,68,74,74,74,84,88,94}); param0.add(new int[]{1,0,0,1,0,1,1,1,1,0,0,1,0,0,1,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,0}); param0.add(new int[]{1,2,3,10,15,21,28,36,41,44,45,47,72,77,77,79,85}); param0.add(new int[]{42,-84,42,36,-10,24,-62,60}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{2,21,42,92,65,62,75,43,81,17,92,86,37,63,27,97,24,61,85,49,84,7,14,19,60,55,68,79,8,12,75,12,92,79,42}); List<Integer> param1 = new ArrayList<>(); param1.add(47); param1.add(8); param1.add(14); param1.add(5); param1.add(27); param1.add(19); param1.add(15); param1.add(7); param1.add(35); param1.add(27); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([1, 2, 3, 4, 6, 6, 7, 9, 10, 13, 16, 23, 30, 32, 36, 42, 42, 43, 44, 47, 48, 48, 49, 52, 52, 53, 55, 56, 58, 59, 60, 60, 63, 67, 68, 68, 74, 75, 76, 80, 81, 81, 83, 83, 86, 87, 91, 92, 97],47,), ([-96, -46, -86, 56, -72, 50, 18, 8, 50],8,), ([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],14,), ([19, 10, 49, 40, 34, 21, 63, 51],5,), ([-96, -96, -90, -88, -88, -84, -80, -76, -68, -64, -64, -52, -52, -52, -52, -50, -50, -48, -48, -40, -32, -26, -24, -22, -20, -14, -12, 0, 6, 8, 10, 20, 24, 28, 34, 36, 54, 60, 60, 60, 68, 74, 74, 74, 84, 88, 94],27,), ([1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0],19,), ([1, 2, 3, 10, 15, 21, 28, 36, 41, 44, 45, 47, 72, 77, 77, 79, 85],15,), ([42, -84, 42, 36, -10, 24, -62, 60],7,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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],35,), ([2, 21, 42, 92, 65, 62, 75, 43, 81, 17, 92, 86, 37, 63, 27, 97, 24, 61, 85, 49, 84, 7, 14, 19, 60, 55, 68, 79, 8, 12, 75, 12, 92, 79, 42],27,) ] 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,4,6,6,7,9,10,13,16,23,30,32,36,42,42,43,44,47,48,48,49,52,52,53,55,56,58,59,60,60,63,67,68,68,74,75,76,80,81,81,83,83,86,87,91,92,97},{-96,-46,-86,56,-72,50,18,8,50},{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1},{19,10,49,40,34,21,63,51},{-96,-96,-90,-88,-88,-84,-80,-76,-68,-64,-64,-52,-52,-52,-52,-50,-50,-48,-48,-40,-32,-26,-24,-22,-20,-14,-12,0,6,8,10,20,24,28,34,36,54,60,60,60,68,74,74,74,84,88,94},{1,0,0,1,0,1,1,1,1,0,0,1,0,0,1,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,0},{1,2,3,10,15,21,28,36,41,44,45,47,72,77,77,79,85},{42,-84,42,36,-10,24,-62,60},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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},{2,21,42,92,65,62,75,43,81,17,92,86,37,63,27,97,24,61,85,49,84,7,14,19,60,55,68,79,8,12,75,12,92,79,42}}; vector<int> param1 {47,8,14,5,27,19,15,7,35,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; }
PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD_1{ static boolean f_gold ( int n ) { if ( n <= 1 ) return false ; if ( n <= 3 ) return true ; if ( n % 2 == 0 || n % 3 == 0 ) return false ; for ( int i = 5 ; i * i <= n ; i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return false ; return true ; }
def f_gold(n): if (n <= 1): return False if (n <= 3): return True if (n % 2 == 0 or n % 3 == 0): return False i = 5 while (i * i <= n): if (n % i == 0 or n % (i + 2) == 0): return False i = i + 6 return True
using namespace std; bool f_gold ( int n ) { if ( n <= 1 ) return false; if ( n <= 3 ) return true; if ( n % 2 == 0 || n % 3 == 0 ) return false; for ( int i = 5; i * i <= n; i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return false; return true; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(15); param0.add(90); param0.add(38); param0.add(65); param0.add(91); param0.add(16); param0.add(48); param0.add(74); param0.add(14); param0.add(47); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (15,), (90,), (38,), (65,), (91,), (16,), (48,), (74,), (14,), (47,) ] 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,90,38,65,91,16,48,74,14,47}; 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_PRODUCT_OF_4_ADJACENT_ELEMENTS_IN_MATRIX
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_PRODUCT_OF_4_ADJACENT_ELEMENTS_IN_MATRIX{ static int f_gold ( int arr [ ] [ ] , int n ) { int max = 0 , result ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( ( j - 3 ) >= 0 ) { result = arr [ i ] [ j ] * arr [ i ] [ j - 1 ] * arr [ i ] [ j - 2 ] * arr [ i ] [ j - 3 ] ; if ( max < result ) max = result ; } if ( ( i - 3 ) >= 0 ) { result = arr [ i ] [ j ] * arr [ i - 1 ] [ j ] * arr [ i - 2 ] [ j ] * arr [ i - 3 ] [ j ] ; if ( max < result ) max = result ; } if ( ( i - 3 ) >= 0 && ( j - 3 ) >= 0 ) { result = arr [ i ] [ j ] * arr [ i - 1 ] [ j - 1 ] * arr [ i - 2 ] [ j - 2 ] * arr [ i - 3 ] [ j - 3 ] ; if ( max < result ) max = result ; } } } return max ; }
def f_gold ( arr , n ) : max = 0 for i in range ( n ) : for j in range ( n ) : if ( ( j - 3 ) >= 0 ) : result = ( arr [ i ] [ j ] * arr [ i ] [ j - 1 ] * arr [ i ] [ j - 2 ] * arr [ i ] [ j - 3 ] ) if ( max < result ) : max = result if ( ( i - 3 ) >= 0 ) : result = ( arr [ i ] [ j ] * arr [ i - 1 ] [ j ] * arr [ i - 2 ] [ j ] * arr [ i - 3 ] [ j ] ) if ( max < result ) : max = result if ( ( i - 3 ) >= 0 and ( j - 3 ) >= 0 ) : result = ( arr [ i ] [ j ] * arr [ i - 1 ] [ j - 1 ] * arr [ i - 2 ] [ j - 2 ] * arr [ i - 3 ] [ j - 3 ] ) if ( max < result ) : max = result return max
null
public static void main(String args[]) { int n_success = 0; List<int [ ] [ ]> param0 = new ArrayList<>(); param0.add(new int[][]{new int[]{1,2,5,6,7,11,12,14,15,16,19,19,24,25,32,34,36,36,38,38,39,43,43,45,47,49,51,51,51,52,53,56,59,59,67,69,70,74,75,75,77,79,81,90,94,96,96,96},new int[]{1,2,4,6,9,9,9,16,18,21,23,26,26,30,36,37,37,38,39,42,45,49,51,52,52,53,56,59,61,61,64,64,69,72,77,79,82,82,87,88,89,91,91,91,94,95,95,98},new int[]{2,5,5,6,10,10,14,16,16,20,22,24,25,28,28,29,30,31,36,38,42,44,44,45,45,49,51,53,56,57,61,63,66,67,67,70,76,80,87,87,91,93,95,96,96,96,97,99},new int[]{4,9,10,11,12,13,13,18,20,23,24,26,27,28,33,35,35,37,42,42,44,45,49,52,55,56,59,60,60,63,64,64,72,72,74,77,78,81,85,85,87,89,93,93,95,98,98,99},new int[]{7,7,7,9,11,11,14,18,19,21,26,32,32,34,35,37,37,39,40,41,42,53,56,59,62,62,65,68,69,70,72,73,73,75,75,77,77,78,85,86,87,88,88,88,93,94,95,98},new int[]{4,4,5,12,16,19,20,23,25,27,28,37,38,39,40,41,45,46,47,48,49,49,55,58,61,61,62,67,67,69,69,71,72,73,75,76,76,77,77,79,81,85,86,90,90,97,97,99},new int[]{1,9,9,11,19,19,21,23,25,26,26,27,28,31,37,38,41,41,43,43,49,54,55,56,58,58,61,62,63,64,64,68,70,75,79,81,83,84,85,85,86,87,92,92,92,94,94,97},new int[]{2,6,8,10,11,11,12,13,14,15,15,19,23,25,27,29,33,33,41,43,45,47,49,49,51,52,55,59,60,62,64,64,65,65,72,74,76,79,83,83,84,90,91,92,93,93,94,96},new int[]{5,9,11,12,13,15,16,21,24,28,32,33,36,37,40,45,46,48,57,60,63,63,63,63,64,66,68,68,73,75,75,77,77,79,80,81,83,84,84,85,85,85,89,91,91,92,94,99},new int[]{2,2,4,6,6,11,14,15,15,18,25,25,27,28,30,31,32,36,37,40,40,41,42,46,52,59,60,60,61,62,63,65,68,68,69,71,73,74,75,78,79,82,93,93,93,94,97,99},new int[]{1,1,4,5,5,6,8,8,9,10,11,12,15,21,22,28,32,33,35,35,36,38,41,44,49,53,54,57,58,59,62,62,63,67,68,69,70,75,77,77,82,83,83,86,90,91,92,97},new int[]{1,1,3,4,5,9,9,13,15,24,27,28,33,37,37,39,40,41,41,48,50,50,51,52,54,63,63,64,65,68,70,71,73,74,74,74,79,79,80,83,89,90,90,93,94,98,99,99},new int[]{2,3,5,9,11,11,20,22,23,25,26,26,26,29,39,39,40,40,48,48,49,49,50,51,51,53,54,58,65,66,67,71,71,72,75,76,79,85,87,87,90,91,95,97,98,98,98,99},new int[]{4,4,9,9,10,13,15,22,23,23,24,26,26,27,28,29,31,33,34,38,40,45,45,47,48,50,50,58,59,60,64,65,66,70,80,80,81,83,84,84,88,89,90,90,95,98,99,99},new int[]{2,4,5,7,9,11,11,12,13,15,17,19,23,26,26,28,28,29,34,35,43,47,48,49,51,51,51,56,57,58,60,61,63,64,66,68,68,71,72,74,78,80,81,84,86,90,91,97},new int[]{1,2,3,4,6,7,7,12,13,17,19,22,23,33,33,38,40,44,44,47,47,51,52,54,56,56,57,58,64,65,67,68,74,74,76,79,80,83,85,88,90,92,92,93,93,94,97,99},new int[]{1,4,5,10,13,13,20,22,23,28,30,31,32,33,36,36,44,46,49,49,51,51,51,55,56,60,69,72,73,74,74,75,75,77,78,78,81,82,82,84,87,87,88,91,91,95,97,99},new int[]{2,3,4,10,13,13,14,16,18,23,31,35,39,41,42,42,43,43,48,49,49,53,56,57,57,58,64,65,68,68,68,74,75,77,78,78,82,83,84,87,88,89,89,91,92,93,99,99},new int[]{2,4,5,8,10,12,13,16,17,18,23,24,28,29,29,31,32,34,38,39,39,43,45,50,51,51,54,55,58,59,59,61,62,63,63,65,65,72,74,82,82,84,92,92,93,94,95,97},new int[]{6,7,9,10,10,10,11,14,16,19,22,24,33,38,41,47,50,50,51,52,52,54,55,57,57,57,59,62,66,66,66,67,68,72,72,73,80,81,81,83,87,88,89,94,96,97,97,98},new int[]{2,4,5,6,9,13,14,14,14,16,20,21,23,23,24,24,27,29,31,33,36,37,43,48,49,50,51,56,57,59,62,62,65,70,71,72,74,74,75,77,80,81,84,87,89,93,96,99},new int[]{1,2,3,6,8,17,27,28,30,31,32,32,33,33,37,40,41,42,42,45,49,51,52,54,57,60,62,62,64,64,65,67,67,70,73,77,77,80,83,83,83,83,85,85,92,95,97,97},new int[]{1,3,11,11,12,15,20,22,22,22,23,23,23,24,26,28,33,33,34,34,36,39,41,42,42,43,50,50,54,56,59,60,64,70,74,75,76,82,82,89,89,94,96,96,96,98,98,98},new int[]{2,2,3,4,7,11,14,18,18,18,21,23,28,29,32,33,33,33,34,39,39,40,41,42,48,49,50,52,56,57,57,58,59,66,66,70,72,74,76,77,77,79,86,86,89,92,94,99},new int[]{1,9,10,12,13,14,17,18,20,21,23,23,25,26,28,28,31,33,33,36,37,41,41,41,41,42,43,44,47,51,54,57,59,59,59,63,64,67,69,69,75,78,84,85,93,98,98,99},new int[]{1,3,5,8,9,9,10,18,18,18,19,21,23,24,24,25,26,27,29,34,34,35,37,37,39,39,41,48,56,57,59,61,64,65,68,69,75,75,75,76,78,83,85,86,90,94,97,98},new int[]{7,8,11,13,14,15,16,16,17,20,28,31,39,41,42,46,51,52,53,53,54,57,57,66,66,67,72,72,73,74,74,78,82,82,83,84,85,87,89,91,93,95,95,97,98,98,98,99},new int[]{1,2,4,5,6,8,8,12,12,12,20,20,25,29,30,31,38,38,39,39,42,43,43,44,45,47,47,51,56,56,57,58,62,65,65,65,66,69,69,73,78,82,83,85,87,90,95,96},new int[]{2,2,3,3,6,7,8,14,15,16,16,17,20,23,25,29,29,31,32,33,37,37,39,40,40,47,48,48,50,51,52,55,55,56,59,62,69,70,71,72,72,81,82,84,89,92,96,99},new int[]{2,8,9,10,16,17,23,30,32,37,38,41,41,46,49,49,55,57,59,59,63,63,64,66,68,68,69,70,72,74,76,77,80,81,83,84,84,85,86,90,90,91,91,92,96,96,97,97},new int[]{1,7,13,13,17,17,18,23,24,31,33,34,34,35,36,40,40,40,40,44,45,51,53,55,55,58,58,64,64,69,72,75,75,80,80,81,82,82,83,84,86,87,87,88,89,95,96,99},new int[]{1,4,7,9,10,11,13,15,15,19,21,23,23,24,25,27,32,32,33,37,38,41,43,43,45,45,47,51,52,53,54,58,59,61,63,63,65,73,76,77,80,80,85,87,90,92,94,96},new int[]{3,4,7,7,12,13,20,20,20,21,22,22,27,27,28,31,32,35,37,39,39,40,41,45,45,45,48,48,49,49,51,54,57,64,67,70,80,83,89,89,90,90,90,92,92,98,98,99},new int[]{1,1,7,10,12,16,16,21,27,31,33,34,36,44,45,46,46,46,47,49,49,53,54,57,57,58,58,62,62,63,67,69,77,79,82,82,84,85,85,85,85,86,92,93,94,94,96,99},new int[]{1,1,4,14,14,17,19,20,21,29,30,30,32,33,34,36,36,44,46,47,48,53,57,59,59,62,63,64,65,65,66,69,69,70,72,73,74,74,80,81,83,84,84,84,85,85,87,94},new int[]{9,13,16,18,19,19,21,23,24,24,25,30,32,33,35,36,37,42,46,47,48,48,52,54,55,62,62,66,67,69,70,70,71,71,73,74,75,77,78,79,80,82,83,86,88,89,94,99},new int[]{1,2,2,4,13,14,15,15,18,18,18,19,21,22,22,22,24,28,31,36,45,46,47,49,51,52,56,56,58,66,67,68,69,71,73,75,77,78,79,79,82,87,87,93,93,97,97,98},new int[]{2,3,4,4,8,11,14,14,16,19,25,29,32,36,39,45,46,46,46,47,50,51,52,55,56,57,61,63,63,64,66,67,70,72,75,76,80,82,83,84,84,87,89,90,92,94,96,97},new int[]{3,6,10,11,14,15,19,20,21,23,28,29,30,30,32,34,34,38,39,41,41,44,45,47,50,50,50,54,57,57,58,58,63,65,66,68,68,69,73,75,76,79,83,86,89,94,95,96},new int[]{4,10,13,18,18,21,21,22,22,22,24,24,25,25,26,29,29,39,50,51,51,53,55,56,56,56,57,60,61,62,67,67,69,69,73,76,76,76,77,79,79,80,82,84,89,90,95,97},new int[]{1,6,8,10,10,25,35,38,39,40,40,40,41,41,43,47,51,56,56,56,57,60,60,62,63,64,65,68,69,72,73,75,76,76,76,78,79,79,79,80,82,82,84,90,91,95,96,99},new int[]{2,3,7,10,11,11,17,17,19,21,21,23,24,26,28,29,31,33,44,44,44,45,48,48,50,50,52,54,56,58,61,65,66,67,69,70,72,72,74,81,84,85,86,87,92,93,98,99},new int[]{1,3,3,3,6,9,13,14,14,22,25,26,28,28,33,36,38,38,41,44,45,46,46,51,55,56,57,57,59,62,64,65,65,68,77,78,79,79,84,85,87,90,94,95,95,95,97,99},new int[]{7,7,8,9,14,18,24,24,25,27,28,28,30,31,31,31,33,36,36,37,37,38,40,43,45,46,46,47,50,51,51,52,52,53,53,60,62,65,65,67,73,76,79,88,91,94,95,95},new int[]{4,5,7,16,17,18,18,18,21,24,25,27,28,31,33,35,36,36,38,40,42,42,42,45,46,46,47,49,50,52,53,65,68,68,69,69,71,71,71,72,75,76,76,80,80,87,90,95},new int[]{9,11,12,14,15,20,22,23,29,29,29,33,35,35,37,37,41,42,44,45,45,47,50,51,51,51,55,57,62,64,66,66,67,76,80,82,82,83,83,83,83,83,85,86,90,90,92,93},new int[]{1,3,3,7,8,8,11,16,19,20,25,29,32,33,39,39,42,43,43,44,47,48,49,50,51,53,54,54,58,60,60,60,62,64,65,67,71,74,75,77,83,84,85,87,87,90,91,97},new int[]{2,5,5,12,13,16,17,19,20,22,26,28,28,30,30,31,36,37,41,44,44,44,46,50,51,51,51,54,54,57,58,58,59,60,62,66,66,68,68,71,75,76,84,85,89,90,91,95}}); param0.add(new int[][]{new int[]{36,16,60,44,14,-68,-28,-98,14,-6,24,56,54,70,70},new int[]{-14,28,-16,-26,-54,60,2,52,28,-42,36,6,14,2,-30},new int[]{-26,56,-60,-6,24,-36,76,-52,20,-54,-22,38,90,-2,-70},new int[]{62,-70,-50,18,62,-34,-74,66,30,64,6,94,-72,58,-82},new int[]{30,28,6,-38,-40,-98,-14,-80,-84,-20,-8,12,-90,-26,-48},new int[]{-2,64,-38,-82,-82,-18,-14,-20,28,16,-94,-78,-80,-4,32},new int[]{-82,-74,68,78,-56,24,-58,36,-10,28,98,42,26,-98,92},new int[]{40,-82,56,98,68,-8,48,-78,-72,-40,78,22,-76,68,10},new int[]{88,88,80,52,-66,-16,-24,-84,56,-10,70,-2,42,64,62},new int[]{-76,-52,70,-10,24,-46,62,-98,28,-78,58,-10,-76,40,-98},new int[]{-82,-58,-12,-98,-54,-62,-32,52,48,64,28,72,-84,48,-14},new int[]{-72,66,-84,34,-96,66,-90,48,86,-34,-4,-70,-88,-76,46},new int[]{40,70,22,-40,64,-32,-68,-6,-78,-56,-96,-98,-26,-38,-90},new int[]{98,32,20,2,-56,12,72,-40,24,78,98,76,98,-8,70},new int[]{-30,-34,-34,46,18,-48,-96,-12,-60,-90,-50,-64,12,60,-94}}); param0.add(new int[][]{new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}}); param0.add(new int[][]{new int[]{43,44,74,24,47,58,43,11,78,61},new int[]{93,7,12,81,39,13,50,62,27,87},new int[]{27,9,63,68,8,83,44,22,83,2},new int[]{70,73,44,15,37,38,42,21,20,75},new int[]{72,43,56,93,92,73,34,9,28,38},new int[]{4,83,97,56,44,89,92,51,82,68},new int[]{55,51,72,78,65,66,10,13,71,85},new int[]{97,15,49,86,56,56,92,84,98,73},new int[]{89,44,19,45,74,7,76,60,42,34},new int[]{65,47,3,34,46,97,98,78,19,57}}); param0.add(new int[][]{new int[]{-88,-82,-70,-46,-44,-18,12,38,66,90,96},new int[]{-98,-90,-84,-62,-42,-30,-16,4,14,18,26},new int[]{-94,-48,-32,-24,-22,-18,42,44,64,70,74},new int[]{-94,-60,-58,-56,-40,-34,2,18,32,76,96},new int[]{-94,-74,-62,-56,-50,-46,-2,34,34,44,68},new int[]{-74,-56,-50,-16,-14,0,14,30,30,66,82},new int[]{-80,-78,-60,-56,-46,-32,4,8,14,42,54},new int[]{-68,-66,-58,-50,-50,-40,-16,-2,4,10,80},new int[]{-70,-68,-24,-8,-4,34,36,60,82,84,92},new int[]{-90,-62,-60,-54,-6,-6,10,10,14,52,66},new int[]{-88,-72,-70,-18,-6,28,38,50,56,72,90}}); param0.add(new int[][]{new int[]{0,0,1,1,1,0,1,1,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,1,1,1,0,0,0,1,1,1},new int[]{1,1,0,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,1,1,1,1,1,1,1,0,1,0,1,1,0,0},new int[]{1,1,1,0,0,1,0,1,1,1,0,1,0,0,1,0,0,1,1,1,1,0,0,0,1,0,1,1,0,0,0,1},new int[]{0,0,0,0,0,1,1,1,0,1,0,1,1,0,1,0,0,0,1,0,1,0,1,1,0,1,1,1,1,1,1,0},new int[]{1,1,1,1,0,1,1,0,0,1,1,1,0,1,0,0,1,1,1,1,1,0,1,0,1,1,1,0,0,1,1,0},new int[]{0,0,0,0,0,1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,1,1,0,0,0},new int[]{0,1,1,1,1,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,1,1,0},new int[]{0,0,0,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,0,0,0,1,1,1,1,1,1,1,0,0,1,1},new int[]{1,0,0,1,1,1,0,0,0,1,0,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,1,1,1},new int[]{1,0,1,0,1,1,1,0,1,1,1,1,0,0,1,0,0,0,1,0,1,0,0,1,1,1,1,1,0,1,0,1},new int[]{0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,1,0,0,1,1,1,0,1,1,0,0,1,1,0,0},new int[]{1,0,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,1,1,0,0,0,0,1},new int[]{0,0,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1},new int[]{0,1,0,0,1,1,1,0,1,0,0,1,0,1,1,1,1,1,1,1,0,1,0,0,1,1,1,0,0,0,1,0},new int[]{1,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,0,1,1,0,1,1,0,1,1,0,0,0,1,1},new int[]{0,1,0,0,1,0,0,0,0,1,0,0,1,1,1,0,1,0,0,0,0,1,1,0,1,0,0,1,0,1,0,0},new int[]{0,0,0,1,1,1,0,0,0,1,0,0,0,1,1,0,1,0,1,1,0,1,1,1,1,1,1,0,1,1,0,1},new int[]{0,1,1,0,1,0,0,1,1,0,1,0,1,0,0,1,1,0,1,1,1,1,0,1,1,1,0,0,0,1,0,1},new int[]{1,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,1},new int[]{0,1,0,1,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,1,1,1,0,0,1,1,1,0,1},new int[]{1,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0},new int[]{1,0,0,0,1,1,1,1,1,1,1,1,1,0,1,0,0,1,1,0,1,0,0,1,1,1,0,0,1,1,1,1},new int[]{0,0,1,1,0,1,1,0,0,0,0,1,1,1,0,1,1,0,1,1,1,1,0,1,1,1,1,1,0,0,1,1},new int[]{0,0,0,1,1,0,0,0,1,0,1,1,0,1,1,0,1,0,0,1,0,0,1,0,0,0,0,1,1,0,1,0},new int[]{1,1,1,0,0,1,1,0,0,1,0,0,0,0,1,1,0,1,0,0,1,1,0,1,1,0,1,1,1,0,1,1},new int[]{1,0,0,0,0,1,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0},new int[]{0,1,1,1,1,1,0,1,1,0,0,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1},new int[]{1,0,0,1,1,1,0,1,0,0,1,0,1,1,1,0,0,0,1,0,0,1,0,1,1,0,1,1,0,1,0,0},new int[]{0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,1,0},new int[]{0,0,1,1,1,1,0,1,1,0,1,1,1,1,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,1,0,0},new int[]{0,0,1,1,1,0,1,1,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,0,0,0,0,1,1,1,1,1},new int[]{0,0,0,0,1,0,1,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,1,1,1,1,0,0,0}}); param0.add(new int[][]{new int[]{8,14,19,21,33,35,37,40,44,49,52,68,68,72,77,80,86,88,88,99},new int[]{10,12,18,18,25,27,30,32,32,42,46,47,48,53,67,69,70,84,85,89},new int[]{12,15,18,24,26,33,41,45,55,71,73,79,82,87,88,88,89,91,92,98},new int[]{1,1,11,16,24,24,27,42,49,50,69,69,72,73,75,80,80,82,95,96},new int[]{1,6,12,13,14,22,28,30,39,51,53,66,68,68,69,77,86,90,96,99},new int[]{2,6,24,26,28,32,32,37,38,54,56,61,64,64,68,71,71,76,79,86},new int[]{22,31,32,34,39,47,54,57,59,61,62,72,72,74,79,79,80,85,91,93},new int[]{3,7,12,13,15,16,21,26,26,36,56,60,62,63,64,66,67,71,76,83},new int[]{3,22,29,30,34,35,36,39,41,42,43,51,57,58,72,72,80,84,88,92},new int[]{9,14,17,29,34,37,38,39,40,46,46,52,62,68,77,78,79,92,93,95},new int[]{1,17,17,18,19,23,26,27,36,37,48,53,56,62,62,68,69,78,78,84},new int[]{20,20,22,33,33,33,43,48,60,63,64,70,77,80,80,85,87,88,91,94},new int[]{7,10,10,13,14,14,23,42,64,65,65,72,73,74,75,76,77,78,79,91},new int[]{1,4,9,12,13,13,23,23,27,33,34,34,37,40,43,63,67,70,87,96},new int[]{1,2,8,11,12,14,14,23,24,33,44,45,47,55,78,79,83,98,98,99},new int[]{3,9,18,21,24,28,34,35,45,46,59,60,60,63,64,84,95,96,97,97},new int[]{4,11,17,19,20,20,20,30,31,41,45,47,64,68,76,81,83,89,93,93},new int[]{2,8,10,21,38,40,43,44,47,52,55,71,75,80,85,85,89,92,94,99},new int[]{3,7,13,14,27,28,29,30,44,47,50,53,55,64,64,75,79,86,98,99},new int[]{10,10,10,16,17,33,44,52,53,57,59,64,65,74,75,76,80,87,90,90}}); param0.add(new int[][]{new int[]{-78,34,-74,16,-10,-10,-14,28},new int[]{-22,-84,48,-20,2,86,88,-60},new int[]{32,16,98,30,-10,48,82,56},new int[]{48,-32,-76,-54,36,56,6,82},new int[]{6,-20,64,56,6,-28,30,-72},new int[]{-32,-48,10,26,40,-8,-26,-54},new int[]{-68,-36,-86,-12,-6,62,-90,26},new int[]{-76,80,44,-82,92,-12,-56,-8}}); param0.add(new int[][]{new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}}); param0.add(new int[][]{new int[]{76,57,99,99,95,61,64,17,58,47},new int[]{52,18,37,70,17,3,33,84,80,7},new int[]{2,34,4,49,17,71,12,76,74,44},new int[]{89,49,69,17,38,56,61,75,86,84},new int[]{32,56,87,23,66,67,97,5,23,51},new int[]{25,24,30,51,30,72,46,57,29,85},new int[]{80,62,87,29,37,90,88,40,55,26},new int[]{27,75,51,91,22,65,38,91,1,15},new int[]{11,56,38,93,54,94,23,90,37,51},new int[]{61,82,79,22,66,55,67,26,93,93}}); List<Integer> param1 = new ArrayList<>(); param1.add(45); param1.add(8); param1.add(18); param1.add(8); param1.add(9); param1.add(18); param1.add(15); param1.add(7); param1.add(17); param1.add(6); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([[1, 2, 5, 6, 7, 11, 12, 14, 15, 16, 19, 19, 24, 25, 32, 34, 36, 36, 38, 38, 39, 43, 43, 45, 47, 49, 51, 51, 51, 52, 53, 56, 59, 59, 67, 69, 70, 74, 75, 75, 77, 79, 81, 90, 94, 96, 96, 96], [1, 2, 4, 6, 9, 9, 9, 16, 18, 21, 23, 26, 26, 30, 36, 37, 37, 38, 39, 42, 45, 49, 51, 52, 52, 53, 56, 59, 61, 61, 64, 64, 69, 72, 77, 79, 82, 82, 87, 88, 89, 91, 91, 91, 94, 95, 95, 98], [2, 5, 5, 6, 10, 10, 14, 16, 16, 20, 22, 24, 25, 28, 28, 29, 30, 31, 36, 38, 42, 44, 44, 45, 45, 49, 51, 53, 56, 57, 61, 63, 66, 67, 67, 70, 76, 80, 87, 87, 91, 93, 95, 96, 96, 96, 97, 99], [4, 9, 10, 11, 12, 13, 13, 18, 20, 23, 24, 26, 27, 28, 33, 35, 35, 37, 42, 42, 44, 45, 49, 52, 55, 56, 59, 60, 60, 63, 64, 64, 72, 72, 74, 77, 78, 81, 85, 85, 87, 89, 93, 93, 95, 98, 98, 99], [7, 7, 7, 9, 11, 11, 14, 18, 19, 21, 26, 32, 32, 34, 35, 37, 37, 39, 40, 41, 42, 53, 56, 59, 62, 62, 65, 68, 69, 70, 72, 73, 73, 75, 75, 77, 77, 78, 85, 86, 87, 88, 88, 88, 93, 94, 95, 98], [4, 4, 5, 12, 16, 19, 20, 23, 25, 27, 28, 37, 38, 39, 40, 41, 45, 46, 47, 48, 49, 49, 55, 58, 61, 61, 62, 67, 67, 69, 69, 71, 72, 73, 75, 76, 76, 77, 77, 79, 81, 85, 86, 90, 90, 97, 97, 99], [1, 9, 9, 11, 19, 19, 21, 23, 25, 26, 26, 27, 28, 31, 37, 38, 41, 41, 43, 43, 49, 54, 55, 56, 58, 58, 61, 62, 63, 64, 64, 68, 70, 75, 79, 81, 83, 84, 85, 85, 86, 87, 92, 92, 92, 94, 94, 97], [2, 6, 8, 10, 11, 11, 12, 13, 14, 15, 15, 19, 23, 25, 27, 29, 33, 33, 41, 43, 45, 47, 49, 49, 51, 52, 55, 59, 60, 62, 64, 64, 65, 65, 72, 74, 76, 79, 83, 83, 84, 90, 91, 92, 93, 93, 94, 96], [5, 9, 11, 12, 13, 15, 16, 21, 24, 28, 32, 33, 36, 37, 40, 45, 46, 48, 57, 60, 63, 63, 63, 63, 64, 66, 68, 68, 73, 75, 75, 77, 77, 79, 80, 81, 83, 84, 84, 85, 85, 85, 89, 91, 91, 92, 94, 99], [2, 2, 4, 6, 6, 11, 14, 15, 15, 18, 25, 25, 27, 28, 30, 31, 32, 36, 37, 40, 40, 41, 42, 46, 52, 59, 60, 60, 61, 62, 63, 65, 68, 68, 69, 71, 73, 74, 75, 78, 79, 82, 93, 93, 93, 94, 97, 99], [1, 1, 4, 5, 5, 6, 8, 8, 9, 10, 11, 12, 15, 21, 22, 28, 32, 33, 35, 35, 36, 38, 41, 44, 49, 53, 54, 57, 58, 59, 62, 62, 63, 67, 68, 69, 70, 75, 77, 77, 82, 83, 83, 86, 90, 91, 92, 97], [1, 1, 3, 4, 5, 9, 9, 13, 15, 24, 27, 28, 33, 37, 37, 39, 40, 41, 41, 48, 50, 50, 51, 52, 54, 63, 63, 64, 65, 68, 70, 71, 73, 74, 74, 74, 79, 79, 80, 83, 89, 90, 90, 93, 94, 98, 99, 99], [2, 3, 5, 9, 11, 11, 20, 22, 23, 25, 26, 26, 26, 29, 39, 39, 40, 40, 48, 48, 49, 49, 50, 51, 51, 53, 54, 58, 65, 66, 67, 71, 71, 72, 75, 76, 79, 85, 87, 87, 90, 91, 95, 97, 98, 98, 98, 99], [4, 4, 9, 9, 10, 13, 15, 22, 23, 23, 24, 26, 26, 27, 28, 29, 31, 33, 34, 38, 40, 45, 45, 47, 48, 50, 50, 58, 59, 60, 64, 65, 66, 70, 80, 80, 81, 83, 84, 84, 88, 89, 90, 90, 95, 98, 99, 99], [2, 4, 5, 7, 9, 11, 11, 12, 13, 15, 17, 19, 23, 26, 26, 28, 28, 29, 34, 35, 43, 47, 48, 49, 51, 51, 51, 56, 57, 58, 60, 61, 63, 64, 66, 68, 68, 71, 72, 74, 78, 80, 81, 84, 86, 90, 91, 97], [1, 2, 3, 4, 6, 7, 7, 12, 13, 17, 19, 22, 23, 33, 33, 38, 40, 44, 44, 47, 47, 51, 52, 54, 56, 56, 57, 58, 64, 65, 67, 68, 74, 74, 76, 79, 80, 83, 85, 88, 90, 92, 92, 93, 93, 94, 97, 99], [1, 4, 5, 10, 13, 13, 20, 22, 23, 28, 30, 31, 32, 33, 36, 36, 44, 46, 49, 49, 51, 51, 51, 55, 56, 60, 69, 72, 73, 74, 74, 75, 75, 77, 78, 78, 81, 82, 82, 84, 87, 87, 88, 91, 91, 95, 97, 99], [2, 3, 4, 10, 13, 13, 14, 16, 18, 23, 31, 35, 39, 41, 42, 42, 43, 43, 48, 49, 49, 53, 56, 57, 57, 58, 64, 65, 68, 68, 68, 74, 75, 77, 78, 78, 82, 83, 84, 87, 88, 89, 89, 91, 92, 93, 99, 99], [2, 4, 5, 8, 10, 12, 13, 16, 17, 18, 23, 24, 28, 29, 29, 31, 32, 34, 38, 39, 39, 43, 45, 50, 51, 51, 54, 55, 58, 59, 59, 61, 62, 63, 63, 65, 65, 72, 74, 82, 82, 84, 92, 92, 93, 94, 95, 97], [6, 7, 9, 10, 10, 10, 11, 14, 16, 19, 22, 24, 33, 38, 41, 47, 50, 50, 51, 52, 52, 54, 55, 57, 57, 57, 59, 62, 66, 66, 66, 67, 68, 72, 72, 73, 80, 81, 81, 83, 87, 88, 89, 94, 96, 97, 97, 98], [2, 4, 5, 6, 9, 13, 14, 14, 14, 16, 20, 21, 23, 23, 24, 24, 27, 29, 31, 33, 36, 37, 43, 48, 49, 50, 51, 56, 57, 59, 62, 62, 65, 70, 71, 72, 74, 74, 75, 77, 80, 81, 84, 87, 89, 93, 96, 99], [1, 2, 3, 6, 8, 17, 27, 28, 30, 31, 32, 32, 33, 33, 37, 40, 41, 42, 42, 45, 49, 51, 52, 54, 57, 60, 62, 62, 64, 64, 65, 67, 67, 70, 73, 77, 77, 80, 83, 83, 83, 83, 85, 85, 92, 95, 97, 97], [1, 3, 11, 11, 12, 15, 20, 22, 22, 22, 23, 23, 23, 24, 26, 28, 33, 33, 34, 34, 36, 39, 41, 42, 42, 43, 50, 50, 54, 56, 59, 60, 64, 70, 74, 75, 76, 82, 82, 89, 89, 94, 96, 96, 96, 98, 98, 98], [2, 2, 3, 4, 7, 11, 14, 18, 18, 18, 21, 23, 28, 29, 32, 33, 33, 33, 34, 39, 39, 40, 41, 42, 48, 49, 50, 52, 56, 57, 57, 58, 59, 66, 66, 70, 72, 74, 76, 77, 77, 79, 86, 86, 89, 92, 94, 99], [1, 9, 10, 12, 13, 14, 17, 18, 20, 21, 23, 23, 25, 26, 28, 28, 31, 33, 33, 36, 37, 41, 41, 41, 41, 42, 43, 44, 47, 51, 54, 57, 59, 59, 59, 63, 64, 67, 69, 69, 75, 78, 84, 85, 93, 98, 98, 99], [1, 3, 5, 8, 9, 9, 10, 18, 18, 18, 19, 21, 23, 24, 24, 25, 26, 27, 29, 34, 34, 35, 37, 37, 39, 39, 41, 48, 56, 57, 59, 61, 64, 65, 68, 69, 75, 75, 75, 76, 78, 83, 85, 86, 90, 94, 97, 98], [7, 8, 11, 13, 14, 15, 16, 16, 17, 20, 28, 31, 39, 41, 42, 46, 51, 52, 53, 53, 54, 57, 57, 66, 66, 67, 72, 72, 73, 74, 74, 78, 82, 82, 83, 84, 85, 87, 89, 91, 93, 95, 95, 97, 98, 98, 98, 99], [1, 2, 4, 5, 6, 8, 8, 12, 12, 12, 20, 20, 25, 29, 30, 31, 38, 38, 39, 39, 42, 43, 43, 44, 45, 47, 47, 51, 56, 56, 57, 58, 62, 65, 65, 65, 66, 69, 69, 73, 78, 82, 83, 85, 87, 90, 95, 96], [2, 2, 3, 3, 6, 7, 8, 14, 15, 16, 16, 17, 20, 23, 25, 29, 29, 31, 32, 33, 37, 37, 39, 40, 40, 47, 48, 48, 50, 51, 52, 55, 55, 56, 59, 62, 69, 70, 71, 72, 72, 81, 82, 84, 89, 92, 96, 99], [2, 8, 9, 10, 16, 17, 23, 30, 32, 37, 38, 41, 41, 46, 49, 49, 55, 57, 59, 59, 63, 63, 64, 66, 68, 68, 69, 70, 72, 74, 76, 77, 80, 81, 83, 84, 84, 85, 86, 90, 90, 91, 91, 92, 96, 96, 97, 97], [1, 7, 13, 13, 17, 17, 18, 23, 24, 31, 33, 34, 34, 35, 36, 40, 40, 40, 40, 44, 45, 51, 53, 55, 55, 58, 58, 64, 64, 69, 72, 75, 75, 80, 80, 81, 82, 82, 83, 84, 86, 87, 87, 88, 89, 95, 96, 99], [1, 4, 7, 9, 10, 11, 13, 15, 15, 19, 21, 23, 23, 24, 25, 27, 32, 32, 33, 37, 38, 41, 43, 43, 45, 45, 47, 51, 52, 53, 54, 58, 59, 61, 63, 63, 65, 73, 76, 77, 80, 80, 85, 87, 90, 92, 94, 96], [3, 4, 7, 7, 12, 13, 20, 20, 20, 21, 22, 22, 27, 27, 28, 31, 32, 35, 37, 39, 39, 40, 41, 45, 45, 45, 48, 48, 49, 49, 51, 54, 57, 64, 67, 70, 80, 83, 89, 89, 90, 90, 90, 92, 92, 98, 98, 99], [1, 1, 7, 10, 12, 16, 16, 21, 27, 31, 33, 34, 36, 44, 45, 46, 46, 46, 47, 49, 49, 53, 54, 57, 57, 58, 58, 62, 62, 63, 67, 69, 77, 79, 82, 82, 84, 85, 85, 85, 85, 86, 92, 93, 94, 94, 96, 99], [1, 1, 4, 14, 14, 17, 19, 20, 21, 29, 30, 30, 32, 33, 34, 36, 36, 44, 46, 47, 48, 53, 57, 59, 59, 62, 63, 64, 65, 65, 66, 69, 69, 70, 72, 73, 74, 74, 80, 81, 83, 84, 84, 84, 85, 85, 87, 94], [9, 13, 16, 18, 19, 19, 21, 23, 24, 24, 25, 30, 32, 33, 35, 36, 37, 42, 46, 47, 48, 48, 52, 54, 55, 62, 62, 66, 67, 69, 70, 70, 71, 71, 73, 74, 75, 77, 78, 79, 80, 82, 83, 86, 88, 89, 94, 99], [1, 2, 2, 4, 13, 14, 15, 15, 18, 18, 18, 19, 21, 22, 22, 22, 24, 28, 31, 36, 45, 46, 47, 49, 51, 52, 56, 56, 58, 66, 67, 68, 69, 71, 73, 75, 77, 78, 79, 79, 82, 87, 87, 93, 93, 97, 97, 98], [2, 3, 4, 4, 8, 11, 14, 14, 16, 19, 25, 29, 32, 36, 39, 45, 46, 46, 46, 47, 50, 51, 52, 55, 56, 57, 61, 63, 63, 64, 66, 67, 70, 72, 75, 76, 80, 82, 83, 84, 84, 87, 89, 90, 92, 94, 96, 97], [3, 6, 10, 11, 14, 15, 19, 20, 21, 23, 28, 29, 30, 30, 32, 34, 34, 38, 39, 41, 41, 44, 45, 47, 50, 50, 50, 54, 57, 57, 58, 58, 63, 65, 66, 68, 68, 69, 73, 75, 76, 79, 83, 86, 89, 94, 95, 96], [4, 10, 13, 18, 18, 21, 21, 22, 22, 22, 24, 24, 25, 25, 26, 29, 29, 39, 50, 51, 51, 53, 55, 56, 56, 56, 57, 60, 61, 62, 67, 67, 69, 69, 73, 76, 76, 76, 77, 79, 79, 80, 82, 84, 89, 90, 95, 97], [1, 6, 8, 10, 10, 25, 35, 38, 39, 40, 40, 40, 41, 41, 43, 47, 51, 56, 56, 56, 57, 60, 60, 62, 63, 64, 65, 68, 69, 72, 73, 75, 76, 76, 76, 78, 79, 79, 79, 80, 82, 82, 84, 90, 91, 95, 96, 99], [2, 3, 7, 10, 11, 11, 17, 17, 19, 21, 21, 23, 24, 26, 28, 29, 31, 33, 44, 44, 44, 45, 48, 48, 50, 50, 52, 54, 56, 58, 61, 65, 66, 67, 69, 70, 72, 72, 74, 81, 84, 85, 86, 87, 92, 93, 98, 99], [1, 3, 3, 3, 6, 9, 13, 14, 14, 22, 25, 26, 28, 28, 33, 36, 38, 38, 41, 44, 45, 46, 46, 51, 55, 56, 57, 57, 59, 62, 64, 65, 65, 68, 77, 78, 79, 79, 84, 85, 87, 90, 94, 95, 95, 95, 97, 99], [7, 7, 8, 9, 14, 18, 24, 24, 25, 27, 28, 28, 30, 31, 31, 31, 33, 36, 36, 37, 37, 38, 40, 43, 45, 46, 46, 47, 50, 51, 51, 52, 52, 53, 53, 60, 62, 65, 65, 67, 73, 76, 79, 88, 91, 94, 95, 95], [4, 5, 7, 16, 17, 18, 18, 18, 21, 24, 25, 27, 28, 31, 33, 35, 36, 36, 38, 40, 42, 42, 42, 45, 46, 46, 47, 49, 50, 52, 53, 65, 68, 68, 69, 69, 71, 71, 71, 72, 75, 76, 76, 80, 80, 87, 90, 95], [9, 11, 12, 14, 15, 20, 22, 23, 29, 29, 29, 33, 35, 35, 37, 37, 41, 42, 44, 45, 45, 47, 50, 51, 51, 51, 55, 57, 62, 64, 66, 66, 67, 76, 80, 82, 82, 83, 83, 83, 83, 83, 85, 86, 90, 90, 92, 93], [1, 3, 3, 7, 8, 8, 11, 16, 19, 20, 25, 29, 32, 33, 39, 39, 42, 43, 43, 44, 47, 48, 49, 50, 51, 53, 54, 54, 58, 60, 60, 60, 62, 64, 65, 67, 71, 74, 75, 77, 83, 84, 85, 87, 87, 90, 91, 97], [2, 5, 5, 12, 13, 16, 17, 19, 20, 22, 26, 28, 28, 30, 30, 31, 36, 37, 41, 44, 44, 44, 46, 50, 51, 51, 51, 54, 54, 57, 58, 58, 59, 60, 62, 66, 66, 68, 68, 71, 75, 76, 84, 85, 89, 90, 91, 95]],45,), ([[36, 16, 60, 44, 14, -68, -28, -98, 14, -6, 24, 56, 54, 70, 70], [-14, 28, -16, -26, -54, 60, 2, 52, 28, -42, 36, 6, 14, 2, -30], [-26, 56, -60, -6, 24, -36, 76, -52, 20, -54, -22, 38, 90, -2, -70], [62, -70, -50, 18, 62, -34, -74, 66, 30, 64, 6, 94, -72, 58, -82], [30, 28, 6, -38, -40, -98, -14, -80, -84, -20, -8, 12, -90, -26, -48], [-2, 64, -38, -82, -82, -18, -14, -20, 28, 16, -94, -78, -80, -4, 32], [-82, -74, 68, 78, -56, 24, -58, 36, -10, 28, 98, 42, 26, -98, 92], [40, -82, 56, 98, 68, -8, 48, -78, -72, -40, 78, 22, -76, 68, 10], [88, 88, 80, 52, -66, -16, -24, -84, 56, -10, 70, -2, 42, 64, 62], [-76, -52, 70, -10, 24, -46, 62, -98, 28, -78, 58, -10, -76, 40, -98], [-82, -58, -12, -98, -54, -62, -32, 52, 48, 64, 28, 72, -84, 48, -14], [-72, 66, -84, 34, -96, 66, -90, 48, 86, -34, -4, -70, -88, -76, 46], [40, 70, 22, -40, 64, -32, -68, -6, -78, -56, -96, -98, -26, -38, -90], [98, 32, 20, 2, -56, 12, 72, -40, 24, 78, 98, 76, 98, -8, 70], [-30, -34, -34, 46, 18, -48, -96, -12, -60, -90, -50, -64, 12, 60, -94]],8,), ([[0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 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, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]],18,), ([[43, 44, 74, 24, 47, 58, 43, 11, 78, 61], [93, 7, 12, 81, 39, 13, 50, 62, 27, 87], [27, 9, 63, 68, 8, 83, 44, 22, 83, 2], [70, 73, 44, 15, 37, 38, 42, 21, 20, 75], [72, 43, 56, 93, 92, 73, 34, 9, 28, 38], [4, 83, 97, 56, 44, 89, 92, 51, 82, 68], [55, 51, 72, 78, 65, 66, 10, 13, 71, 85], [97, 15, 49, 86, 56, 56, 92, 84, 98, 73], [89, 44, 19, 45, 74, 7, 76, 60, 42, 34], [65, 47, 3, 34, 46, 97, 98, 78, 19, 57]],8,), ([[-88, -82, -70, -46, -44, -18, 12, 38, 66, 90, 96], [-98, -90, -84, -62, -42, -30, -16, 4, 14, 18, 26], [-94, -48, -32, -24, -22, -18, 42, 44, 64, 70, 74], [-94, -60, -58, -56, -40, -34, 2, 18, 32, 76, 96], [-94, -74, -62, -56, -50, -46, -2, 34, 34, 44, 68], [-74, -56, -50, -16, -14, 0, 14, 30, 30, 66, 82], [-80, -78, -60, -56, -46, -32, 4, 8, 14, 42, 54], [-68, -66, -58, -50, -50, -40, -16, -2, 4, 10, 80], [-70, -68, -24, -8, -4, 34, 36, 60, 82, 84, 92], [-90, -62, -60, -54, -6, -6, 10, 10, 14, 52, 66], [-88, -72, -70, -18, -6, 28, 38, 50, 56, 72, 90]],9,), ([[0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0], [1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0], [0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0], [0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1], [1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0], [1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1], [0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0], [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1], [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1], [1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1], [0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1], [0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1], [0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0], [1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0], [0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0]],18,), ([[8, 14, 19, 21, 33, 35, 37, 40, 44, 49, 52, 68, 68, 72, 77, 80, 86, 88, 88, 99], [10, 12, 18, 18, 25, 27, 30, 32, 32, 42, 46, 47, 48, 53, 67, 69, 70, 84, 85, 89], [12, 15, 18, 24, 26, 33, 41, 45, 55, 71, 73, 79, 82, 87, 88, 88, 89, 91, 92, 98], [1, 1, 11, 16, 24, 24, 27, 42, 49, 50, 69, 69, 72, 73, 75, 80, 80, 82, 95, 96], [1, 6, 12, 13, 14, 22, 28, 30, 39, 51, 53, 66, 68, 68, 69, 77, 86, 90, 96, 99], [2, 6, 24, 26, 28, 32, 32, 37, 38, 54, 56, 61, 64, 64, 68, 71, 71, 76, 79, 86], [22, 31, 32, 34, 39, 47, 54, 57, 59, 61, 62, 72, 72, 74, 79, 79, 80, 85, 91, 93], [3, 7, 12, 13, 15, 16, 21, 26, 26, 36, 56, 60, 62, 63, 64, 66, 67, 71, 76, 83], [3, 22, 29, 30, 34, 35, 36, 39, 41, 42, 43, 51, 57, 58, 72, 72, 80, 84, 88, 92], [9, 14, 17, 29, 34, 37, 38, 39, 40, 46, 46, 52, 62, 68, 77, 78, 79, 92, 93, 95], [1, 17, 17, 18, 19, 23, 26, 27, 36, 37, 48, 53, 56, 62, 62, 68, 69, 78, 78, 84], [20, 20, 22, 33, 33, 33, 43, 48, 60, 63, 64, 70, 77, 80, 80, 85, 87, 88, 91, 94], [7, 10, 10, 13, 14, 14, 23, 42, 64, 65, 65, 72, 73, 74, 75, 76, 77, 78, 79, 91], [1, 4, 9, 12, 13, 13, 23, 23, 27, 33, 34, 34, 37, 40, 43, 63, 67, 70, 87, 96], [1, 2, 8, 11, 12, 14, 14, 23, 24, 33, 44, 45, 47, 55, 78, 79, 83, 98, 98, 99], [3, 9, 18, 21, 24, 28, 34, 35, 45, 46, 59, 60, 60, 63, 64, 84, 95, 96, 97, 97], [4, 11, 17, 19, 20, 20, 20, 30, 31, 41, 45, 47, 64, 68, 76, 81, 83, 89, 93, 93], [2, 8, 10, 21, 38, 40, 43, 44, 47, 52, 55, 71, 75, 80, 85, 85, 89, 92, 94, 99], [3, 7, 13, 14, 27, 28, 29, 30, 44, 47, 50, 53, 55, 64, 64, 75, 79, 86, 98, 99], [10, 10, 10, 16, 17, 33, 44, 52, 53, 57, 59, 64, 65, 74, 75, 76, 80, 87, 90, 90]],15,), ([[-78, 34, -74, 16, -10, -10, -14, 28], [-22, -84, 48, -20, 2, 86, 88, -60], [32, 16, 98, 30, -10, 48, 82, 56], [48, -32, -76, -54, 36, 56, 6, 82], [6, -20, 64, 56, 6, -28, 30, -72], [-32, -48, 10, 26, 40, -8, -26, -54], [-68, -36, -86, -12, -6, 62, -90, 26], [-76, 80, 44, -82, 92, -12, -56, -8]],7,), ([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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], [0, 0, 0, 0, 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, 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, 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], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 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], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 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, 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, 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, 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, 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], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]],17,), ([[76, 57, 99, 99, 95, 61, 64, 17, 58, 47], [52, 18, 37, 70, 17, 3, 33, 84, 80, 7], [2, 34, 4, 49, 17, 71, 12, 76, 74, 44], [89, 49, 69, 17, 38, 56, 61, 75, 86, 84], [32, 56, 87, 23, 66, 67, 97, 5, 23, 51], [25, 24, 30, 51, 30, 72, 46, 57, 29, 85], [80, 62, 87, 29, 37, 90, 88, 40, 55, 26], [27, 75, 51, 91, 22, 65, 38, 91, 1, 15], [11, 56, 38, 93, 54, 94, 23, 90, 37, 51], [61, 82, 79, 22, 66, 55, 67, 26, 93, 93]],6,) ] 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_AVOID_OVERFLOW_IN_MODULAR_MULTIPLICATION
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class HOW_TO_AVOID_OVERFLOW_IN_MODULAR_MULTIPLICATION{ static long f_gold ( long a , long b , long mod ) { long res = 0 ; a = a % mod ; while ( b > 0 ) { if ( b % 2 == 1 ) { res = ( res + a ) % mod ; } a = ( a * 2 ) % mod ; b /= 2 ; } return res % mod ; }
def f_gold ( a , b , mod ) : res = 0 ; a = a % mod ; while ( b > 0 ) : if ( b % 2 == 1 ) : res = ( res + a ) % mod ; a = ( a * 2 ) % mod ; b //= 2 ; return res % mod ;
null
public static void main(String args[]) { int n_success = 0; List<Long> param0 = new ArrayList<>(); param0.add(99L); param0.add(11L); param0.add(51L); param0.add(49L); param0.add(9L); param0.add(90L); param0.add(19L); param0.add(17L); param0.add(54L); param0.add(5L); List<Long> param1 = new ArrayList<>(); param1.add(75L); param1.add(4L); param1.add(37L); param1.add(51L); param1.add(34L); param1.add(85L); param1.add(96L); param1.add(96L); param1.add(3L); param1.add(69L); List<Long> param2 = new ArrayList<>(); param2.add(40L); param2.add(41L); param2.add(23L); param2.add(88L); param2.add(30L); param2.add(55L); param2.add(41L); param2.add(37L); param2.add(51L); param2.add(60L); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (99,75,40,), (11,4,41,), (51,37,23,), (49,51,88,), (9,34,30,), (90,85,55,), (19,96,41,), (17,96,37,), (54,3,51,), (5,69,60,) ] 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
MINIMUM_COST_TO_FILL_GIVEN_WEIGHT_IN_A_BAG
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_COST_TO_FILL_GIVEN_WEIGHT_IN_A_BAG{ public static int f_gold ( int cost [ ] , int n , int W ) { Vector < Integer > val = new Vector < Integer > ( ) ; Vector < Integer > wt = new Vector < Integer > ( ) ; int size = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( cost [ i ] != - 1 ) { val . add ( cost [ i ] ) ; wt . add ( i + 1 ) ; size ++ ; } } n = size ; int min_cost [ ] [ ] = new int [ n + 1 ] [ W + 1 ] ; for ( int i = 0 ; i <= W ; i ++ ) min_cost [ 0 ] [ i ] = Integer . MAX_VALUE ; for ( int i = 1 ; i <= n ; i ++ ) min_cost [ i ] [ 0 ] = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= W ; j ++ ) { if ( wt . get ( i - 1 ) > j ) min_cost [ i ] [ j ] = min_cost [ i - 1 ] [ j ] ; else min_cost [ i ] [ j ] = Math . min ( min_cost [ i - 1 ] [ j ] , min_cost [ i ] [ j - wt . get ( i - 1 ) ] + val . get ( i - 1 ) ) ; } } return ( min_cost [ n ] [ W ] == Integer . MAX_VALUE ) ? - 1 : min_cost [ n ] [ W ] ; }
null
null
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{6,38,74}); param0.add(new int[]{-40,52,-54,-26,66,-28,22,-10,-28,-12,38,-92,28,76,-34,30,-16,-68,-20,56,-34,-68}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{77,50,40,94,43,9,36,29,39,69,7,45,91,97,94,89,76,86,96,1,12,94,92,39,4,22,49,31,34,84,61,11,39,8,59,9,27,66,33,37,25,18,36,78,8,45,91}); param0.add(new int[]{-94,-92,-84,-82,-74,-62,-56,-46,-46,-42,-32,-30,-28,-24,-20,-18,-12,-10,-6,0,4,12,18,38,42,48,66,78,84,90,92}); param0.add(new int[]{1,1,0,1,1,1,0,1,1,0,1,0}); param0.add(new int[]{1,6,10,10,14,15,16,19,22,25,28,31,36,37,37,39,41,43,45,48,49,50,54,54,57,60,66,70,71,71,72,72,75,75,76,79,81,83,83,83,85,87,87,88,89,90,94}); param0.add(new int[]{-30,-82,-14,-6,98,-22,54,-54,94,32,54,-6,60,30,62,-6,24}); param0.add(new int[]{0,0,1,1,1}); param0.add(new int[]{35,52,40,62,28,59,52,81,69,20,9,11,62,40,5,50,52,62,93,31,90,10,47,93,32,56,39,86}); List<Integer> param1 = new ArrayList<>(); param1.add(1); param1.add(21); param1.add(19); param1.add(34); param1.add(15); param1.add(7); param1.add(45); param1.add(10); param1.add(2); param1.add(16); List<Integer> param2 = new ArrayList<>(); param2.add(2); param2.add(20); param2.add(28); param2.add(40); param2.add(29); param2.add(9); param2.add(32); param2.add(12); param2.add(2); param2.add(23); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
null
PROGRAM_CENSOR_WORD_ASTERISKS_SENTENCE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_CENSOR_WORD_ASTERISKS_SENTENCE{ static String f_gold ( String text , String word ) { String [ ] word_list = text . split ( "\\s+" ) ; String result = "" ; String stars = "" ; for ( int i = 0 ; i < word . length ( ) ; i ++ ) stars += '*' ; int index = 0 ; for ( String i : word_list ) { if ( i . compareTo ( word ) == 0 ) word_list [ index ] = stars ; index ++ ; } for ( String i : word_list ) result += i + ' ' ; return result ; }
def f_gold ( text , word ) : word_list = text.split ( ) result = '' stars = '*' * len ( word ) count = 0 index = 0 ; for i in word_list : if i == word : word_list [ index ] = stars index += 1 result = ' '.join ( word_list ) return result
null
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("IggvAXtmJ"); param0.add("76711241128"); param0.add("010"); param0.add("HIKOn"); param0.add("3680369217"); param0.add("1111"); param0.add("zIi"); param0.add("06"); param0.add("111"); param0.add("NJNnrVU"); List<String> param1 = new ArrayList<>(); param1.add("kzHdEJuCaO"); param1.add("5"); param1.add("0101001"); param1.add("XlnBwpx"); param1.add("017523"); param1.add("1011"); param1.add("ONNXygON"); param1.add("54171617"); param1.add("0010001011001"); param1.add("AGwmS"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)).equals(f_gold(param0.get(i),param1.get(i)))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('IggvAXtmJ','kzHdEJuCaO',), ('76711241128','5',), ('010','0101001',), ('HIKOn','XlnBwpx',), ('3680369217','017523',), ('1111','1011',), ('zIi','ONNXygON',), ('06','54171617',), ('111','0010001011001',), ('NJNnrVU','AGwmS',) ] 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_EXPRESSION_DUPLICATE_PARENTHESIS_NOT
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_EXPRESSION_DUPLICATE_PARENTHESIS_NOT{ static boolean f_gold ( String s ) { Stack < Character > Stack = new Stack < > ( ) ; char [ ] str = s . toCharArray ( ) ; for ( char ch : str ) { if ( ch == ')' ) { char top = Stack . peek ( ) ; Stack . pop ( ) ; int elementsInside = 0 ; while ( top != '(' ) { elementsInside ++ ; top = Stack . peek ( ) ; Stack . pop ( ) ; } if ( elementsInside < 1 ) { return true ; } } else { Stack . push ( ch ) ; } } return false ; }
def f_gold ( string ) : Stack = [ ] for ch in string : if ch == ')' : top = Stack.pop ( ) elementsInside = 0 while top != '(' : elementsInside += 1 top = Stack.pop ( ) if elementsInside < 1 : return True else : Stack.append ( ch ) return False
using namespace std; bool f_gold ( string str ) { stack < char > Stack; for ( char ch : str ) { if ( ch == ')' ) { char top = Stack . top ( ); Stack . pop ( ); int elementsInside = 0; while ( top != '(' ) { elementsInside ++; top = Stack . top ( ); Stack . pop ( ); } if ( elementsInside < 1 ) { return 1; } } else Stack . push ( ch ); } return false; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("((a+b)+((c+d)))"); param0.add("(((a+(b)))+(c+d))"); param0.add("(((a+(b))+c+d))"); param0.add("((a+b)+(c+d))"); param0.add("(8582007)"); param0.add("((a+(b))+(c+d))"); param0.add("(PylsShEdKAE)"); param0.add("886980680541"); param0.add("001"); param0.add("jsVmFeOq"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ("((a+b)+((c+d)))",), ("(((a+(b)))+(c+d))",), ("(((a+(b))+c+d))",), ("((a+b)+(c+d))",), ("(8582007)",), ("((a+(b))+(c+d))",), ("(PylsShEdKAE)",), ('886980680541',), ('001',), ('jsVmFeOq',) ] 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 { "((a+b)+((c+d)))", "(((a+(b)))+(c+d))", "(((a+(b))+c+d))", "((a+b)+(c+d))", "(8582007)", "((a+(b))+(c+d))", "(PylsShEdKAE)", "886980680541", "001", "jsVmFeOq"}; 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_SLOPE_LINE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_FIND_SLOPE_LINE{ static float f_gold ( float x1 , float y1 , float x2 , float y2 ) { return ( y2 - y1 ) / ( x2 - x1 ) ; }
def f_gold ( x1 , y1 , x2 , y2 ) : return ( float ) ( y2 - y1 ) / ( x2 - x1 )
using namespace std; float f_gold ( float x1, float y1, float x2, float y2 ) { return ( y2 - y1 ) / ( x2 - x1 ); }
public static void main(String args[]) { int n_success = 0; List<Float> param0 = new ArrayList<>(); param0.add(236.27324548309292F); param0.add(-9201.144918204123F); param0.add(3480.4716834445326F); param0.add(-6915.538971485092F); param0.add(8887.97173657486F); param0.add(-3785.5177159369946F); param0.add(3037.6696554256832F); param0.add(-7925.458496016523F); param0.add(1404.2919985268031F); param0.add(-4748.744241168378F); List<Float> param1 = new ArrayList<>(); param1.add(5792.493225762838F); param1.add(-2716.3347716140406F); param1.add(3577.9608612055613F); param1.add(-4113.601103381095F); param1.add(1678.4080012662428F); param1.add(-3084.67461899163F); param1.add(4432.445827549F); param1.add(-3350.27411882042F); param1.add(8971.636233373416F); param1.add(-675.557388148954F); List<Float> param2 = new ArrayList<>(); param2.add(7177.837879115863F); param2.add(-5161.142121227645F); param2.add(8611.515262945342F); param2.add(-748.3462104020822F); param2.add(8709.574949883017F); param2.add(-7415.76208254121F); param2.add(8387.304165588026F); param2.add(-5619.767086756504F); param2.add(3039.112051378511F); param2.add(-5998.241086029875F); List<Float> param3 = new ArrayList<>(); param3.add(1289.5700425822731F); param3.add(-3205.784279961129F); param3.add(6744.864707668983F); param3.add(-9245.271700539257F); param3.add(8548.492675510739F); param3.add(-887.5389305564152F); param3.add(611.3373507518394F); param3.add(-1185.7423219907591F); param3.add(1947.6756252708972F); param3.add(-4236.658178504375F); for(int i = 0; i < param0.size(); ++i) { if(Math.abs(1 - (0.0000001 + Math.abs(f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) )/ (Math.abs(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) + 0.0000001)) < 0.001F) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (236.27324548309292,5792.493225762838,7177.837879115863,1289.5700425822731,), (-9201.144918204123,-2716.3347716140406,-5161.142121227645,-3205.784279961129,), (3480.4716834445326,3577.9608612055613,8611.515262945342,6744.864707668983,), (-6915.538971485092,-4113.601103381095,-748.3462104020822,-9245.271700539257,), (8887.97173657486,1678.4080012662428,8709.574949883017,8548.492675510739,), (-3785.5177159369946,-3084.67461899163,-7415.76208254121,-887.5389305564152,), (3037.6696554256832,4432.445827549,8387.304165588026,611.3373507518394,), (-7925.458496016523,-3350.27411882042,-5619.767086756504,-1185.7423219907591,), (1404.2919985268031,8971.636233373416,3039.112051378511,1947.6756252708972,), (-4748.744241168378,-675.557388148954,-5998.241086029875,-4236.658178504375,) ] 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<float> param0 {236.27324548309292F,-9201.144918204123F,3480.4716834445326F,-6915.538971485092F,8887.97173657486F,-3785.5177159369946F,3037.6696554256832F,-7925.458496016523F,1404.2919985268031F,-4748.744241168378F}; vector<float> param1 {5792.493225762838F,-2716.3347716140406F,3577.9608612055613F,-4113.601103381095F,1678.4080012662428F,-3084.67461899163F,4432.445827549F,-3350.27411882042F,8971.636233373416F,-675.557388148954F}; vector<float> param2 {7177.837879115863F,-5161.142121227645F,8611.515262945342F,-748.3462104020822F,8709.574949883017F,-7415.76208254121F,8387.304165588026F,-5619.767086756504F,3039.112051378511F,-5998.241086029875F}; vector<float> param3 {1289.5700425822731F,-3205.784279961129F,6744.864707668983F,-9245.271700539257F,8548.492675510739F,-887.5389305564152F,611.3373507518394F,-1185.7423219907591F,1947.6756252708972F,-4236.658178504375F}; for(int i = 0; i < param0.size(); ++i) { if(abs(1 - (0.0000001 + abs(f_gold(param0[i],param1[i],param2[i],param3[i])) )/ (abs(f_filled(param0[i],param1[i],param2[i],param3[i])) + 0.0000001)) < 0.001F) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
ZECKENDORFS_THEOREM_NON_NEIGHBOURING_FIBONACCI_REPRESENTATION
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class ZECKENDORFS_THEOREM_NON_NEIGHBOURING_FIBONACCI_REPRESENTATION{ public static int f_gold ( int n ) { if ( n == 0 || n == 1 ) return n ; int f1 = 0 , f2 = 1 , f3 = 1 ; while ( f3 <= n ) { f1 = f2 ; f2 = f3 ; f3 = f1 + f2 ; } return f2 ; }
def f_gold ( n ) : if ( n == 0 or n == 1 ) : return n f1 , f2 , f3 = 0 , 1 , 1 while ( f3 <= n ) : f1 = f2 ; f2 = f3 ; f3 = f1 + f2 ; return f2 ;
using namespace std; int f_gold ( int n ) { if ( n == 0 || n == 1 ) return n; int f1 = 0, f2 = 1, f3 = 1; while ( f3 <= n ) { f1 = f2; f2 = f3; f3 = f1 + f2; } return f2; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(54); param0.add(71); param0.add(64); param0.add(71); param0.add(96); param0.add(43); param0.add(70); param0.add(94); param0.add(95); param0.add(69); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (54,), (71,), (64,), (71,), (96,), (43,), (70,), (94,), (95,), (69,) ] 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 {54,71,64,71,96,43,70,94,95,69}; 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_OF_ALL_ELEMENTS_UP_TO_NTH_ROW_IN_A_PASCALS_TRIANGLE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SUM_OF_ALL_ELEMENTS_UP_TO_NTH_ROW_IN_A_PASCALS_TRIANGLE{ static long f_gold ( int n ) { long sum = 0 ; for ( int row = 0 ; row < n ; row ++ ) { sum = sum + ( 1 << row ) ; } return sum ; }
def f_gold ( n ) : sum = 0 for row in range ( n ) : sum = sum + ( 1 << row ) return sum
using namespace std; long long int f_gold ( int n ) { long long int sum = 0; for ( int row = 0; row < n; row ++ ) { sum = sum + ( 1 << row ); } return sum; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(21); param0.add(4); param0.add(31); param0.add(79); param0.add(38); param0.add(75); param0.add(36); param0.add(32); param0.add(23); param0.add(65); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (21,), (4,), (31,), (79,), (38,), (75,), (36,), (32,), (23,), (65,) ] 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,4,31,79,38,75,36,32,23,65}; 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_DIGITS_NON_DECREASING_INTEGERS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_N_DIGITS_NON_DECREASING_INTEGERS{ static int f_gold ( int n ) { int [ ] [ ] a = new int [ n + 1 ] [ 10 ] ; for ( int i = 0 ; i <= 9 ; i ++ ) a [ 0 ] [ i ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) a [ i ] [ 9 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) for ( int j = 8 ; j >= 0 ; j -- ) a [ i ] [ j ] = a [ i - 1 ] [ j ] + a [ i ] [ j + 1 ] ; return a [ n ] [ 0 ] ; }
null
using namespace std; int f_gold ( int n ) { int a [ n + 1 ] [ 10 ]; for ( int i = 0; i <= 9; i ++ ) a [ 0 ] [ i ] = 1; for ( int i = 1; i <= n; i ++ ) a [ i ] [ 9 ] = 1; for ( int i = 1; i <= n; i ++ ) for ( int j = 8; j >= 0; j -- ) a [ i ] [ j ] = a [ i - 1 ] [ j ] + a [ i ] [ j + 1 ]; return a [ n ] [ 0 ]; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(2); param0.add(19); param0.add(79); param0.add(62); param0.add(93); param0.add(39); param0.add(7); param0.add(31); param0.add(3); param0.add(21); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<int> param0 {2,19,79,62,93,39,7,31,3,21}; 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; }
ADD_1_TO_A_GIVEN_NUMBER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class ADD_1_TO_A_GIVEN_NUMBER{ static int f_gold ( int x ) { int m = 1 ; while ( ( int ) ( x & m ) >= 1 ) { x = x ^ m ; m <<= 1 ; } x = x ^ m ; return x ; }
def f_gold ( x ) : m = 1 while ( x & m ) : x = x ^ m m <<= 1 x = x ^ m return x
using namespace std; int f_gold ( int x ) { int m = 1; while ( x & m ) { x = x ^ m; m <<= 1; } x = x ^ m; return x; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(96); param0.add(66); param0.add(67); param0.add(13); param0.add(75); param0.add(78); param0.add(1); param0.add(83); param0.add(27); param0.add(65); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (96,), (66,), (67,), (13,), (75,), (78,), (1,), (83,), (27,), (65,) ] 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 {96,66,67,13,75,78,1,83,27,65}; 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; }
SEARCH_INSERT_AND_DELETE_IN_AN_UNSORTED_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SEARCH_INSERT_AND_DELETE_IN_AN_UNSORTED_ARRAY{ static int f_gold ( int arr [ ] , int n , int key ) { for ( int i = 0 ; i < n ; i ++ ) if ( arr [ i ] == key ) return i ; return - 1 ; }
def f_gold ( arr , n , key ) : for i in range ( n ) : if ( arr [ i ] == key ) : return i return - 1
using namespace std; int f_gold ( int arr [ ], int n, int key ) { int i; for ( i = 0; i < n; i ++ ) if ( arr [ i ] == key ) return i; return - 1; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,8,11,23,55,57,73,74,77,79,93}); param0.add(new int[]{-88,12,-62,-66,-24,18,12,22,94,30,-50,-42,-94,18,76,-6,-48,-68,48,36,-78,52,-82,76,2,-44,-10,88}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}); param0.add(new int[]{33,9,93,70,81,70,56,66,72,81,74,32,71,72,3,81,70,22,82,2,75,18,90,29,48}); param0.add(new int[]{-98,-70,-62,-60,-60,-54,-48,-48,-46,-44,-34,-26,-18,-6,4,18,28,32,34,40,50,54,56,62,64,64,98}); param0.add(new int[]{1,1,1,1,0,0,0,0,1,0,0,1,0,0,1,1,0,1,1,0,0,1}); param0.add(new int[]{4,6,7,10,10,12,13,18,23,29,29,34,46,54,60,61,63,67,69,70,72,76,79,79,81,82,88,90,99}); param0.add(new int[]{94,34,-60,-74,86,80,68,-48,78,-62,-98,-44,-44,92,-94,-86,-36,12,84,-90,52,42,-42,-66,88,76,66}); param0.add(new int[]{0,0,0,1}); param0.add(new int[]{76,59,38,83,38,93,27,11,17,80,26,28,35,53,88,10,9,75}); List<Integer> param1 = new ArrayList<>(); param1.add(8); param1.add(27); param1.add(11); param1.add(24); param1.add(18); param1.add(17); param1.add(15); param1.add(21); param1.add(2); param1.add(12); List<Integer> param2 = new ArrayList<>(); param2.add(11); param2.add(12); param2.add(0); param2.add(72); param2.add(23); param2.add(16); param2.add(28); param2.add(16); param2.add(3); param2.add(13); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } } 11 12 0 72
if __name__ == '__main__': param = [ ([4, 8, 11, 23, 55, 57, 73, 74, 77, 79, 93],8,11,), ([-88, 12, -62, -66, -24, 18, 12, 22, 94, 30, -50, -42, -94, 18, 76, -6, -48, -68, 48, 36, -78, 52, -82, 76, 2, -44, -10, 88],27,12,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],11,0,), ([33, 9, 93, 70, 81, 70, 56, 66, 72, 81, 74, 32, 71, 72, 3, 81, 70, 22, 82, 2, 75, 18, 90, 29, 48],24,72,), ([-98, -70, -62, -60, -60, -54, -48, -48, -46, -44, -34, -26, -18, -6, 4, 18, 28, 32, 34, 40, 50, 54, 56, 62, 64, 64, 98],18,23,), ([1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1],17,16,), ([4, 6, 7, 10, 10, 12, 13, 18, 23, 29, 29, 34, 46, 54, 60, 61, 63, 67, 69, 70, 72, 76, 79, 79, 81, 82, 88, 90, 99],15,28,), ([94, 34, -60, -74, 86, 80, 68, -48, 78, -62, -98, -44, -44, 92, -94, -86, -36, 12, 84, -90, 52, 42, -42, -66, 88, 76, 66],21,16,), ([0, 0, 0, 1],2,3,), ([76, 59, 38, 83, 38, 93, 27, 11, 17, 80, 26, 28, 35, 53, 88, 10, 9, 75],12,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 {{4,8,11,23,55,57,73,74,77,79,93},{-88,12,-62,-66,-24,18,12,22,94,30,-50,-42,-94,18,76,-6,-48,-68,48,36,-78,52,-82,76,2,-44,-10,88},{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1},{33,9,93,70,81,70,56,66,72,81,74,32,71,72,3,81,70,22,82,2,75,18,90,29,48},{-98,-70,-62,-60,-60,-54,-48,-48,-46,-44,-34,-26,-18,-6,4,18,28,32,34,40,50,54,56,62,64,64,98},{1,1,1,1,0,0,0,0,1,0,0,1,0,0,1,1,0,1,1,0,0,1},{4,6,7,10,10,12,13,18,23,29,29,34,46,54,60,61,63,67,69,70,72,76,79,79,81,82,88,90,99},{94,34,-60,-74,86,80,68,-48,78,-62,-98,-44,-44,92,-94,-86,-36,12,84,-90,52,42,-42,-66,88,76,66},{0,0,0,1},{76,59,38,83,38,93,27,11,17,80,26,28,35,53,88,10,9,75}}; vector<int> param1 {8,27,11,24,18,17,15,21,2,12}; vector<int> param2 {11,12,0,72,23,16,28,16,3,13}; 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; }
MAKE_LARGEST_PALINDROME_CHANGING_K_DIGITS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAKE_LARGEST_PALINDROME_CHANGING_K_DIGITS{ static String f_gold ( String str , int k ) { char palin [ ] = str . toCharArray ( ) ; String ans = "" ; int l = 0 ; int r = str . length ( ) - 1 ; while ( l < r ) { if ( str . charAt ( l ) != str . charAt ( r ) ) { palin [ l ] = palin [ r ] = ( char ) Math . max ( str . charAt ( l ) , str . charAt ( r ) ) ; k -- ; } l ++ ; r -- ; } if ( k < 0 ) { return "Not possible" ; } l = 0 ; r = str . length ( ) - 1 ; while ( l <= r ) { if ( l == r ) { if ( k > 0 ) { palin [ l ] = '9' ; } } if ( palin [ l ] < '9' ) { if ( k >= 2 && palin [ l ] == str . charAt ( l ) && palin [ r ] == str . charAt ( r ) ) { k -= 2 ; palin [ l ] = palin [ r ] = '9' ; } else if ( k >= 1 && ( palin [ l ] != str . charAt ( l ) || palin [ r ] != str . charAt ( r ) ) ) { k -- ; palin [ l ] = palin [ r ] = '9' ; } } l ++ ; r -- ; } for ( int i = 0 ; i < palin . length ; i ++ ) ans += palin [ i ] ; return ans ; }
null
using namespace std; string f_gold ( string str, int k ) { string palin = str; int l = 0; int r = str . length ( ) - 1; while ( l < r ) { if ( str [ l ] != str [ r ] ) { palin [ l ] = palin [ r ] = max ( str [ l ], str [ r ] ); k --; } l ++; r --; } if ( k < 0 ) return "Not possible"; l = 0; r = str . length ( ) - 1; while ( l <= r ) { if ( l == r ) { if ( k > 0 ) palin [ l ] = '9'; } if ( palin [ l ] < '9' ) { if ( k >= 2 && palin [ l ] == str [ l ] && palin [ r ] == str [ r ] ) { k -= 2; palin [ l ] = palin [ r ] = '9'; } else if ( k >= 1 && ( palin [ l ] != str [ l ] || palin [ r ] != str [ r ] ) ) { k --; palin [ l ] = palin [ r ] = '9'; } } l ++; r --; } return palin; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("wUJmbRlwogtFv"); param0.add("43435"); param0.add("43435"); param0.add("12345"); param0.add("5032"); param0.add("0100000001101"); param0.add("sBrbNQiRwQd"); param0.add("7549384614"); param0.add("10000001"); param0.add("VqrTsaoD"); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(3); param1.add(1); param1.add(1); param1.add(3); param1.add(5); param1.add(4); param1.add(3); param1.add(4); param1.add(4); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)).equals(f_gold(param0.get(i),param1.get(i)))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<string> param0 {"wUJmbRlwogtFv","43435","43435","12345","5032","0100000001101","sBrbNQiRwQd","7549384614","10000001","VqrTsaoD"}; vector<int> param1 {5,3,1,1,3,5,4,3,4,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; }
FIND_THE_MISSING_NUMBER_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_THE_MISSING_NUMBER_2{ static int f_gold ( int a [ ] , int n ) { int x1 = a [ 0 ] ; int x2 = 1 ; for ( int i = 1 ; i < n ; i ++ ) x1 = x1 ^ a [ i ] ; for ( int i = 2 ; i <= n + 1 ; i ++ ) x2 = x2 ^ i ; return ( x1 ^ x2 ) ; }
def f_gold ( a , n ) : x1 = a [ 0 ] x2 = 1 for i in range ( 1 , n ) : x1 = x1 ^ a [ i ] for i in range ( 2 , n + 2 ) : x2 = x2 ^ i return x1 ^ x2
using namespace std; int f_gold ( int a [ ], int n ) { int x1 = a [ 0 ]; int x2 = 1; for ( int i = 1; i < n; i ++ ) x1 = x1 ^ a [ i ]; for ( int i = 2; i <= n + 1; i ++ ) x2 = x2 ^ i; return ( x1 ^ x2 ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,5,7,8,10,14,27,32,51,52,57,58,65,68,68,72,73,73,83,92,98}); param0.add(new int[]{-60,-48,38,-78,88,86,-4,-94,16,-64,32,88,58,-78,-16,48,38,30,66,-60,20,40,-28,-64,-48,-86,-80,-8,-58,52,80,-32,46,-4,-70,76,-4,78,-64,38,-40}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{69,59,22,33,69,28,11,34,72,88,16,30,69,89,43,4,65,85,27}); param0.add(new int[]{-98,-98,-92,-88,-88,-82,-74,-70,-68,-60,-60,-48,-38,-34,-34,-24,14,38,50,58,62,64,64,68,76,78,78,86,88,90,92,98,98}); param0.add(new int[]{0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,1,0,0,0,0,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,0}); param0.add(new int[]{1,9,12,12,24,25,33,33,36,39,46,48,48,52,52,53,57,69,71,72,75,76,78,80,82,86,89,91,94,95,96,97,98,99}); param0.add(new int[]{62,-66,60,-92,46,6,-52,48,72,-64,34,20,50,70,-34,20,-70,14,-44,66,-70}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{33,10,6,71,18,22,15,57,56,63,35,93,31,43,98,99,62,39,44,86,78,95,6,76,71}); List<Integer> param1 = new ArrayList<>(); param1.add(12); param1.add(28); param1.add(38); param1.add(13); param1.add(23); param1.add(41); param1.add(30); param1.add(17); param1.add(30); param1.add(12); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([2, 5, 7, 8, 10, 14, 27, 32, 51, 52, 57, 58, 65, 68, 68, 72, 73, 73, 83, 92, 98],12,), ([-60, -48, 38, -78, 88, 86, -4, -94, 16, -64, 32, 88, 58, -78, -16, 48, 38, 30, 66, -60, 20, 40, -28, -64, -48, -86, -80, -8, -58, 52, 80, -32, 46, -4, -70, 76, -4, 78, -64, 38, -40],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],38,), ([69, 59, 22, 33, 69, 28, 11, 34, 72, 88, 16, 30, 69, 89, 43, 4, 65, 85, 27],13,), ([-98, -98, -92, -88, -88, -82, -74, -70, -68, -60, -60, -48, -38, -34, -34, -24, 14, 38, 50, 58, 62, 64, 64, 68, 76, 78, 78, 86, 88, 90, 92, 98, 98],23,), ([0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0],41,), ([1, 9, 12, 12, 24, 25, 33, 33, 36, 39, 46, 48, 48, 52, 52, 53, 57, 69, 71, 72, 75, 76, 78, 80, 82, 86, 89, 91, 94, 95, 96, 97, 98, 99],30,), ([62, -66, 60, -92, 46, 6, -52, 48, 72, -64, 34, 20, 50, 70, -34, 20, -70, 14, -44, 66, -70],17,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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],30,), ([33, 10, 6, 71, 18, 22, 15, 57, 56, 63, 35, 93, 31, 43, 98, 99, 62, 39, 44, 86, 78, 95, 6, 76, 71],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,5,7,8,10,14,27,32,51,52,57,58,65,68,68,72,73,73,83,92,98},{-60,-48,38,-78,88,86,-4,-94,16,-64,32,88,58,-78,-16,48,38,30,66,-60,20,40,-28,-64,-48,-86,-80,-8,-58,52,80,-32,46,-4,-70,76,-4,78,-64,38,-40},{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},{69,59,22,33,69,28,11,34,72,88,16,30,69,89,43,4,65,85,27},{-98,-98,-92,-88,-88,-82,-74,-70,-68,-60,-60,-48,-38,-34,-34,-24,14,38,50,58,62,64,64,68,76,78,78,86,88,90,92,98,98},{0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,1,0,0,0,0,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,0},{1,9,12,12,24,25,33,33,36,39,46,48,48,52,52,53,57,69,71,72,75,76,78,80,82,86,89,91,94,95,96,97,98,99},{62,-66,60,-92,46,6,-52,48,72,-64,34,20,50,70,-34,20,-70,14,-44,66,-70},{0,0,0,0,0,0,0,0,0,0,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,10,6,71,18,22,15,57,56,63,35,93,31,43,98,99,62,39,44,86,78,95,6,76,71}}; vector<int> param1 {12,28,38,13,23,41,30,17,30,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; }
REMOVE_BRACKETS_ALGEBRAIC_STRING_CONTAINING_OPERATORS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class REMOVE_BRACKETS_ALGEBRAIC_STRING_CONTAINING_OPERATORS{ static String f_gold ( String str ) { int len = str . length ( ) ; char res [ ] = new char [ len ] ; int index = 0 , i = 0 ; Stack < Integer > s = new Stack < Integer > ( ) ; s . push ( 0 ) ; while ( i < len ) { if ( str . charAt ( i ) == '+' ) { if ( s . peek ( ) == 1 ) res [ index ++ ] = '-' ; if ( s . peek ( ) == 0 ) res [ index ++ ] = '+' ; } else if ( str . charAt ( i ) == '-' ) { if ( s . peek ( ) == 1 ) res [ index ++ ] = '+' ; else if ( s . peek ( ) == 0 ) res [ index ++ ] = '-' ; } else if ( str . charAt ( i ) == '(' && i > 0 ) { if ( str . charAt ( i - 1 ) == '-' ) { int x = ( s . peek ( ) == 1 ) ? 0 : 1 ; s . push ( x ) ; } else if ( str . charAt ( i - 1 ) == '+' ) s . push ( s . peek ( ) ) ; } else if ( str . charAt ( i ) == ')' ) s . pop ( ) ; else res [ index ++ ] = str . charAt ( i ) ; i ++ ; } return new String ( res ) ; }
def f_gold ( Str ) : Len = len ( Str ) res = [ None ] * Len index = 0 i = 0 s = [ ] s.append ( 0 ) while ( i < Len ) : if ( Str [ i ] == '+' ) : if ( s [ - 1 ] == 1 ) : res [ index ] = '-' index += 1 if ( s [ - 1 ] == 0 ) : res [ index ] = '+' index += 1 elif ( Str [ i ] == '-' ) : if ( s [ - 1 ] == 1 ) : res [ index ] = '+' index += 1 elif ( s [ - 1 ] == 0 ) : res [ index ] = '-' index += 1 elif ( Str [ i ] == '(' and i > 0 ) : if ( Str [ i - 1 ] == '-' ) : x = 0 if ( s [ - 1 ] == 1 ) else 1 s.append ( x ) elif ( Str [ i - 1 ] == '+' ) : s.append ( s [ - 1 ] ) elif ( Str [ i ] == ')' ) : s.pop ( ) else : res [ index ] = Str [ i ] index += 1 i += 1 return res
null
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("ggbsMvMZcMOVd"); param0.add("384292670"); param0.add("10000100"); param0.add("fdHME"); param0.add("09198832"); param0.add("0011111011"); param0.add("SnXwRS"); param0.add("071"); param0.add("01101"); param0.add("xwmqxgBa"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)).equals(f_gold(param0.get(i)))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('ggbsMvMZcMOVd',), ('384292670',), ('10000100',), ('fdHME',), ('09198832',), ('0011111011',), ('SnXwRS',), ('071',), ('01101',), ('xwmqxgBa',) ] 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
FINDING_POWER_PRIME_NUMBER_P_N_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FINDING_POWER_PRIME_NUMBER_P_N_1{ static int f_gold ( int n , int p ) { int ans = 0 ; int temp = p ; while ( temp <= n ) { ans += n / temp ; temp = temp * p ; } return ans ; }
def f_gold ( n , p ) : ans = 0 temp = p while ( temp <= n ) : ans += n / temp temp = temp * p return int ( ans )
using namespace std; int f_gold ( int n, int p ) { int ans = 0; int temp = p; while ( temp <= n ) { ans += n / temp; temp = temp * p; } return ans; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(76); param0.add(77); param0.add(9); param0.add(59); param0.add(8); param0.add(97); param0.add(78); param0.add(41); param0.add(72); param0.add(71); List<Integer> param1 = new ArrayList<>(); param1.add(43); param1.add(91); param1.add(42); param1.add(67); param1.add(52); param1.add(8); param1.add(24); param1.add(88); param1.add(61); param1.add(28); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (76,43,), (77,91,), (9,42,), (59,67,), (8,52,), (97,8,), (78,24,), (41,88,), (72,61,), (71,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<int> param0 {76,77,9,59,8,97,78,41,72,71}; vector<int> param1 {43,91,42,67,52,8,24,88,61,28}; 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; }
DICE_THROW_PROBLEM_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DICE_THROW_PROBLEM_1{ public static long f_gold ( int f , int d , int s ) { long mem [ ] [ ] = new long [ d + 1 ] [ s + 1 ] ; mem [ 0 ] [ 0 ] = 1 ; for ( int i = 1 ; i <= d ; i ++ ) { for ( int j = i ; j <= s ; j ++ ) { mem [ i ] [ j ] = mem [ i ] [ j - 1 ] + mem [ i - 1 ] [ j - 1 ] ; if ( j - f - 1 >= 0 ) mem [ i ] [ j ] -= mem [ i - 1 ] [ j - f - 1 ] ; } } return mem [ d ] [ s ] ; }
def f_gold ( f , d , s ) : mem = [ [ 0 for i in range ( s + 1 ) ] for j in range ( d + 1 ) ] mem [ 0 ] [ 0 ] = 1 for i in range ( 1 , d + 1 ) : for j in range ( 1 , s + 1 ) : mem [ i ] [ j ] = mem [ i ] [ j - 1 ] + mem [ i - 1 ] [ j - 1 ] if j - f - 1 >= 0 : mem [ i ] [ j ] -= mem [ i - 1 ] [ j - f - 1 ] return mem [ d ] [ s ]
using namespace std; long f_gold ( int f, int d, int s ) { long mem [ d + 1 ] [ s + 1 ]; memset ( mem, 0, sizeof mem ); mem [ 0 ] [ 0 ] = 1; for ( int i = 1; i <= d; i ++ ) { for ( int j = i; j <= s; j ++ ) { mem [ i ] [ j ] = mem [ i ] [ j - 1 ] + mem [ i - 1 ] [ j - 1 ]; if ( j - f - 1 >= 0 ) mem [ i ] [ j ] -= mem [ i - 1 ] [ j - f - 1 ]; } } return mem [ d ] [ s ]; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(57); param0.add(58); param0.add(38); param0.add(5); param0.add(91); param0.add(76); param0.add(38); param0.add(97); param0.add(97); param0.add(99); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(45); param1.add(89); param1.add(39); param1.add(90); param1.add(56); param1.add(43); param1.add(26); param1.add(90); param1.add(2); List<Integer> param2 = new ArrayList<>(); param2.add(33); param2.add(4); param2.add(9); param2.add(30); param2.add(47); param2.add(46); param2.add(84); param2.add(52); param2.add(90); param2.add(26); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (57,5,33,), (58,45,4,), (38,89,9,), (5,39,30,), (91,90,47,), (76,56,46,), (38,43,84,), (97,26,52,), (97,90,90,), (99,2,26,) ] 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,58,38,5,91,76,38,97,97,99}; vector<int> param1 {5,45,89,39,90,56,43,26,90,2}; vector<int> param2 {33,4,9,30,47,46,84,52,90,26}; 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; }
FIND_REPEATING_ELEMENT_SORTED_ARRAY_SIZE_N
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_REPEATING_ELEMENT_SORTED_ARRAY_SIZE_N{ static int f_gold ( int arr [ ] , int low , int high ) { if ( low > high ) return - 1 ; int mid = ( low + high ) / 2 ; if ( arr [ mid ] != mid + 1 ) { if ( mid > 0 && arr [ mid ] == arr [ mid - 1 ] ) return mid ; return f_gold ( arr , low , mid - 1 ) ; } return f_gold ( arr , mid + 1 , high ) ; }
null
using namespace std; int f_gold ( int arr [ ], int low, int high ) { if ( low > high ) return - 1; int mid = ( low + high ) / 2; if ( arr [ mid ] != mid + 1 ) { if ( mid > 0 && arr [ mid ] == arr [ mid - 1 ] ) return mid; return f_gold ( arr, low, mid - 1 ); } return f_gold ( arr, mid + 1, high ); }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{15,21,32,42,42,44,57,68,75,80,83,84}); param0.add(new int[]{-60,-90,-88,-80,-86,18,54,56,84,42,-60,-90,52,-44,-62,-56,-16,28,22,-24,-36,-56,80,68,-16}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{87,43,74}); param0.add(new int[]{-82,-66,-66,-62,-56,-52,-44,-42,-28,-22,-12,-6,-4,-2,18,26,26,28,42,42,56,58,78,90,92,94,96,96}); param0.add(new int[]{0,1,1,1,1,1,0,1,1,1,1,0,0,1,0,0,1,0,1,1,1}); param0.add(new int[]{6,9,14,17,22,31,32,33,36,39,42,43,46,46,46,47,49,53,60,61,67,68,72,75,77,77,84,84,85,89,94,94,95}); param0.add(new int[]{-88,82,-10,-10,68,-86,70,92,-54,-10,-56}); param0.add(new int[]{0,0,0,0,0,0,1,1,1,1,1}); param0.add(new int[]{35,66,47,42,95,10,84,80,23,35,21,71,39,9,38,40,22,65}); List<Integer> param1 = new ArrayList<>(); param1.add(6); param1.add(23); param1.add(33); param1.add(2); param1.add(20); param1.add(19); param1.add(23); param1.add(7); param1.add(8); param1.add(14); List<Integer> param2 = new ArrayList<>(); param2.add(11); param2.add(12); param2.add(32); param2.add(2); param2.add(21); param2.add(19); param2.add(19); param2.add(10); param2.add(8); param2.add(16); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{15,21,32,42,42,44,57,68,75,80,83,84},{-60,-90,-88,-80,-86,18,54,56,84,42,-60,-90,52,-44,-62,-56,-16,28,22,-24,-36,-56,80,68,-16},{0,0,0,0,0,0,0,0,0,0,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},{87,43,74},{-82,-66,-66,-62,-56,-52,-44,-42,-28,-22,-12,-6,-4,-2,18,26,26,28,42,42,56,58,78,90,92,94,96,96},{0,1,1,1,1,1,0,1,1,1,1,0,0,1,0,0,1,0,1,1,1},{6,9,14,17,22,31,32,33,36,39,42,43,46,46,46,47,49,53,60,61,67,68,72,75,77,77,84,84,85,89,94,94,95},{-88,82,-10,-10,68,-86,70,92,-54,-10,-56},{0,0,0,0,0,0,1,1,1,1,1},{35,66,47,42,95,10,84,80,23,35,21,71,39,9,38,40,22,65}}; vector<int> param1 {6,23,33,2,20,19,23,7,8,14}; vector<int> param2 {11,12,32,2,21,19,19,10,8,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; }
CHANGE_ARRAY_PERMUTATION_NUMBERS_1_N
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; class CHANGE_ARRAY_PERMUTATION_NUMBERS_1_N{ static void f_gold ( int [ ] a , int n ) { HashMap < Integer , Integer > count = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( count . containsKey ( a [ i ] ) ) { count . put ( a [ i ] , count . get ( a [ i ] ) + 1 ) ; } else { count . put ( a [ i ] , 1 ) ; } } int next_missing = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( count . containsKey ( a [ i ] ) && count . get ( a [ i ] ) != 1 || a [ i ] > n || a [ i ] < 1 ) { count . put ( a [ i ] , count . get ( a [ i ] ) - 1 ) ; while ( count . containsKey ( next_missing ) ) next_missing ++ ; a [ i ] = next_missing ; count . put ( next_missing , 1 ) ; } } }
def f_gold ( a , n ) : count = dict ( ) for i in range ( n ) : if count.get ( a [ i ] ) : count [ a [ i ] ] += 1 else : count [ a [ i ] ] = 1 ; next_missing = 1 for i in range ( n ) : if count [ a [ i ] ] != 1 or a [ i ] > n or a [ i ] < 1 : count [ a [ i ] ] -= 1 while count.get ( next_missing ) : next_missing += 1 a [ i ] = next_missing count [ next_missing ] = 1
using namespace std; void f_gold ( int a [ ], int n ) { unordered_map < int, int > count; for ( int i = 0; i < n; i ++ ) count [ a [ i ] ] ++; int next_missing = 1; for ( int i = 0; i < n; i ++ ) { if ( count [ a [ i ] ] != 1 || a [ i ] > n || a [ i ] < 1 ) { count [ a [ i ] ] --; while ( count . find ( next_missing ) != count . end ( ) ) next_missing ++; a [ i ] = next_missing; count [ next_missing ] = 1; } } }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{19}); param0.add(new int[]{-47,72}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{93,3,20,59,36,19,90,67,19,20,96,71,52,33,40,39}); param0.add(new int[]{-98,-93,-91,-89,-63,-58,-52,-52,-46,-40,-25,-16,-10,-1,-1,4,12,12,13,13,16,20,29,29,31,40,44,47,48,51,52,52,59,60,61,64,66,78,85,97}); param0.add(new int[]{0,1,1,1,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,1,1,0,0,0}); param0.add(new int[]{4,6,8,17,19,21,22,24,27,27,28,30,30,30,32,33,35,37,38,44,46,46,48,49,51,53,54,59,60,61,63,64,64,69,76,85,86,87,92,93,93,95,97,97,97,98,99,99}); param0.add(new int[]{-75,-46,-42,-33,4,74,-76,14,-68,75,-14,51,94,27,55,30,-83,4}); param0.add(new int[]{0,0,0,0,0,1,1,1,1}); param0.add(new int[]{24,13,60,7,57,36,45,20,65,8,16,14,76,87,15,92,98,66,32,87,63,86,51,25,58}); List<Integer> param1 = new ArrayList<>(); param1.add(0); param1.add(1); param1.add(18); param1.add(9); param1.add(22); param1.add(12); param1.add(26); param1.add(9); param1.add(5); param1.add(24); List<int [ ]> filled_function_param0 = new ArrayList<>(); filled_function_param0.add(new int[]{19}); filled_function_param0.add(new int[]{-47,72}); filled_function_param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); filled_function_param0.add(new int[]{93,3,20,59,36,19,90,67,19,20,96,71,52,33,40,39}); filled_function_param0.add(new int[]{-98,-93,-91,-89,-63,-58,-52,-52,-46,-40,-25,-16,-10,-1,-1,4,12,12,13,13,16,20,29,29,31,40,44,47,48,51,52,52,59,60,61,64,66,78,85,97}); filled_function_param0.add(new int[]{0,1,1,1,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,1,1,0,0,0}); filled_function_param0.add(new int[]{4,6,8,17,19,21,22,24,27,27,28,30,30,30,32,33,35,37,38,44,46,46,48,49,51,53,54,59,60,61,63,64,64,69,76,85,86,87,92,93,93,95,97,97,97,98,99,99}); filled_function_param0.add(new int[]{-75,-46,-42,-33,4,74,-76,14,-68,75,-14,51,94,27,55,30,-83,4}); filled_function_param0.add(new int[]{0,0,0,0,0,1,1,1,1}); filled_function_param0.add(new int[]{24,13,60,7,57,36,45,20,65,8,16,14,76,87,15,92,98,66,32,87,63,86,51,25,58}); List<Integer> filled_function_param1 = new ArrayList<>(); filled_function_param1.add(0); filled_function_param1.add(1); filled_function_param1.add(18); filled_function_param1.add(9); filled_function_param1.add(22); filled_function_param1.add(12); filled_function_param1.add(26); filled_function_param1.add(9); filled_function_param1.add(5); filled_function_param1.add(24); for(int i = 0; i < param0.size(); ++i) { f_filled(filled_function_param0.get(i),filled_function_param1.get(i)); f_gold(param0.get(i),param1.get(i)); if(Arrays.equals(param0.get(i), filled_function_param0.get(i)) && param1.get(i) == filled_function_param1.get(i)) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([19],0,), ([-47, 72],1,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],18,), ([93, 3, 20, 59, 36, 19, 90, 67, 19, 20, 96, 71, 52, 33, 40, 39],9,), ([-98, -93, -91, -89, -63, -58, -52, -52, -46, -40, -25, -16, -10, -1, -1, 4, 12, 12, 13, 13, 16, 20, 29, 29, 31, 40, 44, 47, 48, 51, 52, 52, 59, 60, 61, 64, 66, 78, 85, 97],22,), ([0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0],12,), ([4, 6, 8, 17, 19, 21, 22, 24, 27, 27, 28, 30, 30, 30, 32, 33, 35, 37, 38, 44, 46, 46, 48, 49, 51, 53, 54, 59, 60, 61, 63, 64, 64, 69, 76, 85, 86, 87, 92, 93, 93, 95, 97, 97, 97, 98, 99, 99],26,), ([-75, -46, -42, -33, 4, 74, -76, 14, -68, 75, -14, 51, 94, 27, 55, 30, -83, 4],9,), ([0, 0, 0, 0, 0, 1, 1, 1, 1],5,), ([24, 13, 60, 7, 57, 36, 45, 20, 65, 8, 16, 14, 76, 87, 15, 92, 98, 66, 32, 87, 63, 86, 51, 25, 58],24,) ] filled_function_param = [ ([19],0,), ([-47, 72],1,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],18,), ([93, 3, 20, 59, 36, 19, 90, 67, 19, 20, 96, 71, 52, 33, 40, 39],9,), ([-98, -93, -91, -89, -63, -58, -52, -52, -46, -40, -25, -16, -10, -1, -1, 4, 12, 12, 13, 13, 16, 20, 29, 29, 31, 40, 44, 47, 48, 51, 52, 52, 59, 60, 61, 64, 66, 78, 85, 97],22,), ([0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0],12,), ([4, 6, 8, 17, 19, 21, 22, 24, 27, 27, 28, 30, 30, 30, 32, 33, 35, 37, 38, 44, 46, 46, 48, 49, 51, 53, 54, 59, 60, 61, 63, 64, 64, 69, 76, 85, 86, 87, 92, 93, 93, 95, 97, 97, 97, 98, 99, 99],26,), ([-75, -46, -42, -33, 4, 74, -76, 14, -68, 75, -14, 51, 94, 27, 55, 30, -83, 4],9,), ([0, 0, 0, 0, 0, 1, 1, 1, 1],5,), ([24, 13, 60, 7, 57, 36, 45, 20, 65, 8, 16, 14, 76, 87, 15, 92, 98, 66, 32, 87, 63, 86, 51, 25, 58],24,) ] 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 {{19},{-47,72},{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{93,3,20,59,36,19,90,67,19,20,96,71,52,33,40,39},{-98,-93,-91,-89,-63,-58,-52,-52,-46,-40,-25,-16,-10,-1,-1,4,12,12,13,13,16,20,29,29,31,40,44,47,48,51,52,52,59,60,61,64,66,78,85,97},{0,1,1,1,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,1,1,0,0,0},{4,6,8,17,19,21,22,24,27,27,28,30,30,30,32,33,35,37,38,44,46,46,48,49,51,53,54,59,60,61,63,64,64,69,76,85,86,87,92,93,93,95,97,97,97,98,99,99},{-75,-46,-42,-33,4,74,-76,14,-68,75,-14,51,94,27,55,30,-83,4},{0,0,0,0,0,1,1,1,1},{24,13,60,7,57,36,45,20,65,8,16,14,76,87,15,92,98,66,32,87,63,86,51,25,58}}; vector<int> param1 {0,1,18,9,22,12,26,9,5,24}; vector<vector<int>> filled_function_param0 {{19},{-47,72},{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{93,3,20,59,36,19,90,67,19,20,96,71,52,33,40,39},{-98,-93,-91,-89,-63,-58,-52,-52,-46,-40,-25,-16,-10,-1,-1,4,12,12,13,13,16,20,29,29,31,40,44,47,48,51,52,52,59,60,61,64,66,78,85,97},{0,1,1,1,1,1,1,0,1,0,0,1,0,1,0,1,0,1,1,1,1,1,0,0,0},{4,6,8,17,19,21,22,24,27,27,28,30,30,30,32,33,35,37,38,44,46,46,48,49,51,53,54,59,60,61,63,64,64,69,76,85,86,87,92,93,93,95,97,97,97,98,99,99},{-75,-46,-42,-33,4,74,-76,14,-68,75,-14,51,94,27,55,30,-83,4},{0,0,0,0,0,1,1,1,1},{24,13,60,7,57,36,45,20,65,8,16,14,76,87,15,92,98,66,32,87,63,86,51,25,58}}; vector<int> filled_function_param1 {0,1,18,9,22,12,26,9,5,24}; 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; }
DIAGONALLY_DOMINANT_MATRIX
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DIAGONALLY_DOMINANT_MATRIX{ static boolean f_gold ( int m [ ] [ ] , int n ) { for ( int i = 0 ; i < n ; i ++ ) { int sum = 0 ; for ( int j = 0 ; j < n ; j ++ ) sum += Math . abs ( m [ i ] [ j ] ) ; sum -= Math . abs ( m [ i ] [ i ] ) ; if ( Math . abs ( m [ i ] [ i ] ) < sum ) return false ; } return true ; }
def f_gold ( m , n ) : for i in range ( 0 , n ) : sum = 0 for j in range ( 0 , n ) : sum = sum + abs ( m [ i ] [ j ] ) sum = sum - abs ( m [ i ] [ i ] ) if ( abs ( m [ i ] [ i ] ) < sum ) : return False return True
null
public static void main(String args[]) { int n_success = 0; List<int [ ] [ ]> param0 = new ArrayList<>(); param0.add(new int[][]{ new int[] {3, -2, 1,}, new int[] {1 -3, 2}, new int[] {-1, 2, 4}}); param0.add(new int[][]{ new int[] {2, -2, 1,}, new int[] {1 -3, 2}, new int[] {-1, 2, 4}}); param0.add(new int[][]{new int[]{78,46,33,58,79,94,94,31,69},new int[]{83,48,11,74,33,61,88,15,29},new int[]{27,20,36,14,37,88,49,36,58},new int[]{93,15,39,5,97,45,1,47,34},new int[]{8,88,54,87,60,77,37,46,18},new int[]{10,68,71,86,76,24,47,37,72},new int[]{84,43,82,25,87,18,51,46,75},new int[]{59,39,78,86,38,55,79,5,5},new int[]{50,42,19,34,53,80,21,45,96}}); param0.add(new int[][]{new int[]{88,35,82,14,86,94,12,49,76,94,3,96,27,92,82,25,15,27,15},new int[]{30,75,59,45,53,78,45,92,72,61,11,78,51,86,89,74,39,24,6},new int[]{33,22,60,20,11,35,35,65,90,78,49,66,46,5,39,79,85,93,51},new int[]{21,38,36,14,33,23,72,84,38,47,64,47,1,42,68,78,86,76,25},new int[]{57,52,7,7,56,39,70,83,58,23,10,72,36,71,3,72,77,95,13},new int[]{90,48,66,3,63,15,2,61,59,17,11,5,70,67,23,96,63,4,29},new int[]{17,95,35,48,85,87,48,95,53,65,75,1,7,77,84,70,30,70,98},new int[]{99,84,38,30,97,54,88,95,16,16,27,22,15,46,1,28,33,15,95},new int[]{57,70,68,58,20,4,10,7,91,57,6,55,31,64,36,91,13,75,73},new int[]{72,61,10,66,24,99,34,50,75,1,5,27,7,1,32,17,18,68,49},new int[]{13,69,22,26,68,87,5,9,77,62,73,68,90,78,2,95,50,51,90},new int[]{2,41,64,44,52,37,66,92,56,23,71,39,86,60,56,36,1,98,4},new int[]{41,99,53,31,33,5,43,11,32,1,43,6,92,81,11,41,27,61,76},new int[]{13,95,35,25,94,36,21,55,36,28,27,12,74,26,93,45,6,89,8},new int[]{75,17,38,77,41,15,83,83,74,28,25,79,35,80,37,27,5,59,88},new int[]{66,99,57,61,97,96,60,64,32,16,44,87,90,69,61,71,34,74,86},new int[]{21,19,52,42,39,45,89,13,43,83,71,95,66,45,4,1,60,50,87},new int[]{47,17,86,35,8,56,60,55,7,65,25,24,97,75,96,93,65,47,8},new int[]{45,29,31,57,99,7,31,60,56,32,94,61,61,76,99,64,10,26,69}}); param0.add(new int[][]{new int[]{97,37,30,97,2,42,68,90,94},new int[]{35,10,31,79,85,6,65,74,2},new int[]{9,81,80,66,80,99,59,92,13},new int[]{6,25,63,59,90,46,15,66,86},new int[]{42,92,17,23,15,38,56,34,94},new int[]{65,80,89,87,97,34,73,16,50},new int[]{69,42,62,12,69,87,72,99,80},new int[]{84,28,30,75,50,17,10,88,95},new int[]{11,47,8,31,37,33,9,46,3}}); param0.add(new int[][]{new int[]{28,52,61,24,10,42,37,15,28,37,65,13,59},new int[]{68,56,30,64,67,20,99,27,12,41,80,96,51},new int[]{97,80,29,91,95,51,59,88,31,9,70,30,90},new int[]{40,7,72,59,11,3,4,97,20,5,34,14,13},new int[]{61,49,45,53,24,94,63,75,9,63,56,77,77},new int[]{96,71,75,42,1,64,92,72,15,69,22,20,68},new int[]{45,89,80,40,46,91,63,93,12,52,7,88,55},new int[]{5,47,97,38,43,70,8,86,50,78,9,13,50},new int[]{96,78,35,25,61,31,49,43,45,84,7,74,6},new int[]{89,50,70,45,54,17,86,87,29,64,71,99,20},new int[]{26,93,29,7,34,5,77,6,96,33,43,59,33},new int[]{83,61,18,14,21,39,34,31,81,7,85,71,1},new int[]{86,22,87,92,63,62,46,57,94,45,74,76,80}}); param0.add(new int[][]{new int[]{68,37,94,90,14,37,89,91,14,66,66,33,2},new int[]{98,53,89,55,45,37,27,90,52,86,47,58,7},new int[]{13,48,28,45,56,92,88,35,55,97,37,9,3},new int[]{2,58,22,85,24,78,54,97,17,58,58,21,77},new int[]{63,63,44,40,75,66,92,67,79,46,24,72,70},new int[]{96,51,99,77,92,4,31,65,30,72,40,14,44},new int[]{92,34,39,4,88,27,42,11,87,32,50,53,4},new int[]{19,71,33,78,77,70,83,55,9,62,99,62,48},new int[]{90,68,48,92,27,55,44,71,52,57,9,98,8},new int[]{56,10,65,72,45,39,46,17,82,98,99,67,76},new int[]{62,68,36,9,35,67,89,52,90,91,28,58,83},new int[]{24,59,37,38,25,98,15,16,55,4,26,39,57},new int[]{47,90,48,92,49,37,38,62,61,74,97,8,38}}); param0.add(new int[][]{new int[]{85,56,45,50,20,63,55,34,92,32,76,73,43,79,13,2,61,84,14,42,15,93,85,10,56,53,58,85,99,81,62,57,63,4,78,96},new int[]{82,34,32,78,34,70,40,35,15,51,20,92,37,38,21,88,10,54,9,86,42,16,24,4,44,23,42,86,66,92,19,20,28,24,91,2},new int[]{7,1,11,51,60,31,30,77,24,18,58,77,17,46,94,19,12,90,82,12,50,66,20,6,1,90,7,96,55,97,74,15,95,24,29,82},new int[]{71,34,78,84,93,37,42,64,95,19,23,71,6,99,93,55,77,39,25,98,83,4,88,33,66,2,14,50,11,34,38,92,39,22,42,97},new int[]{95,57,78,38,9,88,29,69,42,60,39,91,72,93,60,53,76,8,21,56,48,47,9,78,1,55,31,80,91,11,66,60,31,50,60,88},new int[]{62,39,3,58,68,30,67,68,58,77,53,14,10,78,81,22,63,61,46,37,21,89,3,19,32,79,24,73,74,48,96,58,40,7,46,91},new int[]{15,85,74,87,5,59,70,22,28,54,19,14,48,7,79,32,22,46,85,83,13,22,10,44,24,59,62,72,72,55,49,50,19,82,58,97},new int[]{48,93,96,72,96,12,86,20,45,26,81,98,31,82,59,3,18,84,21,57,99,42,62,30,61,36,55,4,15,71,96,97,57,63,77,64},new int[]{17,53,40,70,50,68,15,72,34,30,87,73,24,8,57,70,25,77,34,25,18,73,97,70,14,6,82,90,36,36,75,18,15,94,89,16},new int[]{76,14,47,54,58,77,30,46,16,1,41,93,27,77,62,81,28,20,55,51,69,88,73,97,34,27,97,38,29,35,20,19,5,25,93,26},new int[]{51,66,61,15,45,6,58,1,73,43,16,14,74,19,51,8,48,12,70,35,70,6,99,11,38,91,26,28,72,89,83,80,50,58,26,44},new int[]{15,76,24,77,59,57,17,77,81,1,11,20,31,99,39,63,6,99,28,51,53,44,65,80,12,28,79,72,68,95,30,35,6,85,30,80},new int[]{63,8,91,33,43,76,43,45,87,54,65,7,36,25,85,37,12,32,49,38,56,80,65,26,57,14,56,70,41,51,84,67,12,97,49,1},new int[]{19,66,58,87,72,98,4,8,27,26,97,43,40,50,67,73,74,29,85,42,18,81,21,67,62,27,96,93,47,93,26,9,91,12,16,47},new int[]{56,66,51,27,73,66,62,71,8,38,6,59,19,79,56,28,94,91,10,45,95,65,50,32,61,16,6,66,62,66,67,19,4,43,18,82},new int[]{46,46,85,21,30,64,41,17,5,5,73,75,48,78,38,6,58,14,72,94,59,65,89,13,27,25,56,68,59,95,49,18,81,75,76,3},new int[]{79,57,6,69,31,8,10,3,12,92,76,94,19,21,81,14,75,29,7,49,65,7,14,16,99,16,85,13,82,29,85,73,95,61,37,17},new int[]{31,59,88,47,6,32,31,18,9,3,71,26,13,34,43,93,33,69,36,79,74,68,47,61,45,96,88,84,48,41,38,68,75,11,16,65},new int[]{97,71,67,71,1,97,71,4,82,37,14,79,25,82,4,66,43,26,84,15,6,37,43,42,13,16,42,38,66,65,5,30,95,43,32,67},new int[]{67,42,5,99,86,96,59,23,8,68,70,91,19,44,93,38,44,6,3,96,80,33,66,58,26,99,28,43,75,88,16,89,23,59,35,89},new int[]{41,97,22,74,1,46,22,32,87,30,87,43,12,83,71,27,26,18,92,75,66,81,61,46,29,32,15,60,82,28,27,41,47,33,44,50},new int[]{10,24,34,91,20,25,55,90,43,53,85,50,55,13,49,97,10,92,97,11,78,84,20,72,79,97,83,48,76,17,33,20,46,31,51,83},new int[]{19,62,44,77,38,49,65,11,27,58,64,65,15,82,89,1,19,56,64,34,64,10,76,60,39,66,32,51,26,57,84,60,55,6,7,66},new int[]{81,26,95,98,82,78,5,87,1,84,2,65,10,50,51,69,41,58,77,68,24,91,56,36,2,96,56,81,12,12,85,72,22,74,84,62},new int[]{64,28,89,28,4,45,90,13,83,98,80,4,61,84,26,94,6,77,56,81,27,35,97,82,58,84,63,33,95,83,97,81,33,69,40,47},new int[]{45,27,7,58,14,4,82,34,80,91,38,20,46,19,1,23,62,73,28,84,80,77,33,3,79,16,30,25,78,1,33,37,29,37,61,8},new int[]{1,63,88,65,46,43,10,82,85,10,62,86,51,45,73,73,45,85,58,95,66,24,97,75,65,55,51,72,73,21,47,22,29,40,3,49},new int[]{25,82,11,94,89,75,98,88,48,32,3,45,89,20,20,51,81,20,82,14,98,80,32,72,42,80,39,38,64,4,99,92,63,61,78,5},new int[]{66,45,50,88,3,23,11,38,56,35,65,6,70,40,90,35,13,25,86,81,78,67,68,99,47,55,92,43,2,45,48,62,38,47,4,60},new int[]{49,76,34,44,94,85,56,92,42,50,69,33,98,96,91,67,42,44,68,57,36,41,56,3,56,56,65,39,40,39,27,67,94,65,74,3},new int[]{3,37,98,20,11,83,91,24,70,65,83,74,32,62,55,36,66,37,14,46,77,56,50,61,17,27,54,29,13,49,25,88,23,26,48,36},new int[]{6,80,74,39,57,91,66,10,72,9,77,72,27,46,63,42,85,41,34,93,30,44,80,1,45,47,93,30,22,15,84,38,23,31,57,81},new int[]{35,66,53,31,26,31,72,80,12,53,56,83,62,44,58,77,65,13,61,68,51,62,48,95,63,72,91,72,51,24,86,40,29,73,17,1},new int[]{96,84,1,25,41,91,23,18,95,28,85,12,88,49,97,81,97,16,27,53,92,36,7,34,65,4,26,20,51,77,99,10,8,18,17,69},new int[]{30,95,39,61,24,81,98,35,79,61,75,98,72,15,36,55,37,87,62,64,39,90,98,75,12,72,8,41,69,74,3,43,37,86,57,25},new int[]{4,58,37,8,94,9,79,1,13,68,16,44,65,14,91,26,32,2,16,92,49,90,75,23,94,60,95,66,20,93,74,18,59,31,4,27}}); param0.add(new int[][]{new int[]{95,71,19,39,66,78,46,92,38,67,29,91,57,48,52,48,61,67,48,94,82,8,74,86,88,67,14,47,24,91,62,58,34,31,48,91,45,29,29,63,48,12,78,27},new int[]{47,66,37,45,57,18,13,73,29,56,74,20,29,6,26,61,86,43,47,26,81,1,95,73,26,64,62,6,62,66,42,27,65,30,82,98,85,65,47,32,34,47,14,5},new int[]{36,96,9,35,25,75,46,13,61,30,98,32,30,82,56,67,71,55,98,8,43,48,58,32,78,69,7,74,20,62,21,92,29,70,38,42,3,37,17,33,10,37,33,28},new int[]{87,42,58,48,51,10,8,16,96,62,49,89,15,16,81,27,47,26,72,41,11,91,9,54,11,7,28,94,62,55,36,73,99,63,51,77,48,68,10,26,67,53,43,17},new int[]{27,22,36,72,33,90,95,53,11,93,29,38,58,15,54,62,57,79,71,58,49,53,29,33,46,54,80,98,85,7,29,9,49,71,78,94,88,51,98,8,55,65,98,84},new int[]{95,79,15,51,34,69,86,12,45,31,54,93,22,72,64,60,28,21,75,75,87,77,43,27,23,97,90,36,97,38,16,74,43,41,44,52,17,52,43,23,1,93,25,6},new int[]{74,54,78,23,19,56,53,31,38,19,1,77,50,98,58,81,32,49,98,97,92,44,29,88,48,80,77,26,7,44,14,52,32,75,32,75,84,57,52,34,61,62,86,87},new int[]{93,76,31,29,31,12,35,57,41,27,15,94,71,36,24,82,24,96,76,28,75,3,3,29,32,54,38,95,56,65,21,41,20,60,75,59,74,55,3,14,45,95,99,60},new int[]{49,9,54,70,93,52,63,52,22,55,3,2,59,28,37,69,9,62,32,81,75,35,47,18,36,19,25,46,60,95,23,78,27,35,77,55,36,88,97,71,9,21,32,66},new int[]{44,89,65,75,80,87,15,27,16,46,97,72,48,65,19,90,37,58,55,53,47,3,88,86,62,1,39,73,33,23,34,49,49,99,49,10,96,66,71,88,67,76,39,42},new int[]{91,1,46,36,96,91,44,31,97,58,96,4,53,89,93,57,73,78,50,5,52,17,32,6,69,93,92,61,10,23,53,61,19,4,46,32,84,46,62,92,54,87,67,24},new int[]{66,18,96,48,46,48,62,94,27,62,78,65,52,1,50,40,72,17,1,78,77,30,77,67,22,35,56,14,45,86,33,12,24,69,57,9,2,59,95,29,93,55,94,22},new int[]{85,49,12,71,89,8,97,16,40,45,64,63,51,10,76,86,71,45,85,56,86,73,84,13,64,88,30,52,54,57,18,25,53,20,11,40,98,23,90,87,42,47,56,33},new int[]{89,98,26,69,29,94,60,91,37,25,74,44,34,12,93,39,19,19,29,66,90,98,94,76,20,57,97,9,2,28,34,21,83,78,81,56,5,85,22,59,40,84,92,63},new int[]{32,45,83,92,87,33,82,35,46,36,62,83,90,26,7,87,5,87,32,79,91,81,84,57,80,62,28,95,80,78,74,66,97,41,86,66,64,7,41,45,44,30,38,39},new int[]{19,47,38,17,74,79,69,99,4,35,1,81,85,58,22,5,60,36,9,84,57,78,84,90,4,51,39,84,52,75,71,55,31,50,8,87,15,65,10,41,88,79,48,21},new int[]{86,24,74,23,80,69,33,36,25,58,90,66,98,31,44,63,45,83,82,50,67,71,87,1,71,86,67,83,94,9,99,35,13,26,45,51,92,25,56,39,3,75,94,53},new int[]{33,62,98,67,69,95,4,72,59,17,22,38,88,31,49,52,89,38,96,49,90,27,23,84,27,81,14,3,27,62,14,92,44,25,61,75,52,12,97,84,34,23,19,1},new int[]{74,65,5,57,22,43,2,73,7,21,71,59,9,40,73,49,12,73,10,74,17,4,64,16,49,27,6,9,58,32,38,30,78,45,29,92,22,31,81,17,54,79,47,32},new int[]{28,11,39,17,76,39,73,25,26,68,62,19,13,29,54,73,42,62,71,71,21,9,45,27,48,85,69,5,72,15,77,97,44,47,32,36,49,53,23,34,18,12,87,2},new int[]{27,50,31,48,86,69,17,43,71,18,66,31,63,28,67,9,97,28,92,18,15,75,89,5,41,91,76,74,73,66,73,51,16,65,85,57,37,39,65,49,47,40,14,40},new int[]{48,32,88,39,33,30,26,43,55,44,78,76,3,7,85,58,91,10,10,81,42,34,82,26,60,2,73,45,5,26,79,25,26,92,87,85,22,19,10,42,31,31,99,75},new int[]{81,97,86,90,36,66,32,67,63,23,50,65,69,44,58,57,37,65,18,5,82,99,96,26,33,42,88,27,54,83,82,79,91,75,24,3,39,71,12,33,22,35,14,26},new int[]{83,85,54,41,45,31,69,99,17,60,96,4,10,94,9,61,90,22,21,23,61,12,95,17,55,21,54,47,41,97,15,96,59,99,15,29,11,29,86,90,82,89,85,88},new int[]{56,92,53,3,13,38,70,11,23,73,56,17,9,83,99,96,92,28,79,19,97,87,92,4,47,47,31,99,5,33,48,32,79,59,98,64,47,9,35,47,88,82,17,1},new int[]{55,11,33,70,56,64,93,58,20,18,78,45,43,20,57,82,27,18,17,60,89,5,6,97,15,39,80,39,88,21,13,29,98,5,67,21,9,67,44,62,94,67,62,62},new int[]{60,49,39,41,50,98,17,53,55,78,75,56,1,65,64,52,15,2,12,45,57,42,2,87,62,34,17,41,78,75,84,71,65,15,38,98,73,65,9,42,66,86,89,51},new int[]{78,99,80,19,31,66,32,75,8,69,98,32,47,70,8,34,4,36,44,25,26,33,9,47,72,17,15,42,54,13,50,44,3,53,56,54,57,12,93,59,65,96,37,20},new int[]{72,37,31,95,25,50,49,8,94,94,91,35,13,21,73,24,48,33,1,72,3,14,14,49,33,4,38,25,47,13,39,25,73,43,38,35,93,55,50,78,34,25,42,92},new int[]{51,94,37,66,85,34,83,38,31,26,76,94,26,63,48,95,79,10,36,40,26,9,53,81,70,86,80,86,53,39,61,52,68,68,73,78,42,90,67,96,75,51,3,13},new int[]{13,61,24,20,74,87,97,55,35,78,80,30,83,33,41,66,49,8,84,3,85,65,85,72,2,87,41,53,75,16,9,96,39,64,36,23,47,49,55,94,10,63,95,26},new int[]{48,30,2,29,54,32,38,21,27,88,34,23,78,39,69,73,45,63,8,7,30,12,20,64,29,55,12,84,22,23,48,45,26,28,55,73,69,2,28,77,79,53,14,46},new int[]{78,67,74,70,20,35,48,43,20,56,3,68,11,62,61,95,58,29,38,84,88,87,22,86,41,84,63,38,50,7,24,46,25,78,29,67,93,80,85,22,85,86,9,87},new int[]{49,73,96,36,5,90,4,24,41,14,91,12,82,44,9,66,38,96,77,57,47,55,88,2,83,18,66,90,57,64,88,27,53,59,29,72,95,98,14,68,43,29,57,33},new int[]{21,41,1,27,2,64,51,54,74,74,30,1,95,99,29,13,73,43,41,75,88,89,58,77,14,41,67,54,6,46,77,1,29,78,76,26,58,87,3,60,14,98,23,62},new int[]{10,4,39,74,88,34,88,25,52,15,12,1,9,59,14,31,88,53,63,10,43,18,67,59,76,99,23,86,75,46,49,23,12,29,89,88,59,53,68,63,29,3,95,89},new int[]{37,63,23,49,86,93,77,3,22,36,10,9,56,55,19,72,33,20,94,35,31,83,50,46,78,10,67,34,51,92,83,39,90,68,12,26,71,67,90,2,12,59,32,51},new int[]{11,32,64,45,79,54,6,26,8,8,38,8,17,83,3,41,73,53,97,96,96,70,62,53,59,93,81,83,95,83,23,47,35,14,65,97,49,36,1,84,22,35,3,12},new int[]{37,58,77,12,2,84,65,58,60,41,35,88,90,11,52,52,62,63,15,70,40,9,70,17,23,58,95,80,51,57,86,16,45,61,12,73,6,4,81,74,35,47,85,19},new int[]{27,11,70,59,41,43,28,63,67,45,24,77,64,79,73,39,99,45,61,82,43,67,92,80,42,41,47,43,23,32,74,57,38,77,15,28,13,35,2,61,65,41,96,94},new int[]{86,4,53,88,14,17,14,41,62,52,27,85,40,35,90,95,59,97,49,63,11,80,6,98,41,32,21,93,75,57,5,91,28,95,75,77,70,27,94,53,48,83,78,58},new int[]{9,55,45,28,28,46,25,26,62,68,67,34,21,81,34,44,76,89,21,18,36,70,84,53,20,96,95,84,94,3,84,8,85,48,23,1,2,74,37,94,51,44,24,32},new int[]{56,50,64,30,38,78,55,3,25,45,62,7,81,27,23,32,2,75,34,52,61,34,7,10,89,2,30,81,29,82,60,99,17,56,86,51,25,84,16,25,15,79,57,15},new int[]{56,82,37,65,33,3,49,22,54,21,27,4,99,1,4,55,24,29,22,23,85,78,8,58,80,99,88,59,90,7,25,45,90,26,30,66,53,73,39,11,79,12,99,50}}); param0.add(new int[][]{new int[]{16,49,32,82,45,85,80,71,5,44,41,97,95,85,67,74,75,22,17,89,92,50,84,94,31,13,74,51,33,20,48,78,72,72,92,74,14,62,51,78,70,98,81,21,92,38,15},new int[]{36,9,99,59,82,54,17,82,4,84,13,75,43,97,92,8,20,82,71,61,44,97,51,58,75,30,99,84,10,94,18,25,96,34,44,39,95,92,90,68,43,20,72,2,27,34,55},new int[]{36,85,72,87,72,69,65,85,44,43,74,66,21,61,13,28,30,82,2,58,83,21,90,46,89,83,25,57,20,6,18,49,82,20,34,10,33,55,19,66,47,49,67,30,83,85,59},new int[]{78,31,21,17,53,51,24,40,98,47,20,16,58,49,42,12,41,58,60,24,13,34,61,27,85,67,14,41,57,30,45,74,1,92,83,94,84,52,20,23,95,96,90,78,6,33,8},new int[]{63,4,13,35,93,89,34,56,11,38,93,45,86,58,34,75,92,72,24,74,79,63,39,21,36,48,84,13,2,27,7,90,94,19,40,21,58,26,74,36,44,64,27,8,90,1,23},new int[]{73,31,7,9,71,92,98,53,16,74,24,74,46,29,89,30,51,83,31,30,34,92,19,75,28,6,17,91,36,1,16,68,47,23,96,67,62,85,88,15,75,67,83,43,8,98,98},new int[]{44,26,67,32,64,43,74,74,62,11,78,95,9,48,6,54,62,54,99,98,56,82,87,30,3,61,15,3,15,67,29,31,71,71,55,75,92,43,25,81,55,50,38,60,85,52,84},new int[]{74,70,76,81,45,97,19,5,42,93,30,65,76,79,5,38,11,84,29,14,90,98,74,91,89,10,39,60,96,98,23,97,96,22,86,87,83,23,22,62,94,19,22,1,34,26,4},new int[]{48,45,12,92,37,3,28,93,84,2,56,65,46,44,18,73,37,54,25,83,62,25,52,63,15,46,56,26,64,20,67,25,21,34,88,25,65,29,32,1,35,56,16,32,79,5,10},new int[]{86,72,79,20,89,12,90,68,63,26,60,74,61,15,5,32,96,22,22,12,64,75,88,80,16,65,51,87,92,32,53,3,13,92,92,58,45,24,51,13,24,5,81,50,76,49,18},new int[]{33,58,31,34,94,96,74,31,99,79,27,59,27,1,76,68,23,98,52,57,87,51,83,84,63,84,93,77,28,24,22,86,40,75,8,96,88,12,49,21,67,39,62,82,58,62,70},new int[]{36,45,79,15,62,38,64,88,71,9,75,80,71,25,78,65,20,28,49,34,73,20,95,85,22,77,44,47,25,22,61,52,20,96,80,20,86,45,37,15,76,9,44,15,44,86,12},new int[]{27,19,25,74,99,64,12,50,72,11,83,23,88,15,63,20,89,78,10,61,93,47,49,49,76,33,87,78,23,53,37,22,93,2,20,5,91,3,82,77,86,77,12,32,58,71,70},new int[]{40,6,63,25,91,69,83,73,50,40,1,46,73,39,10,49,14,46,40,89,19,17,82,46,73,65,70,38,17,73,11,53,18,7,35,44,71,39,11,10,98,88,76,9,86,96,8},new int[]{48,21,80,97,89,6,59,68,23,73,75,35,12,99,71,57,29,85,67,61,61,88,30,27,93,30,55,23,37,26,36,92,63,37,51,68,93,78,63,37,97,31,78,25,73,25,46},new int[]{89,30,20,23,1,15,21,30,11,90,52,30,9,69,47,34,33,98,65,51,79,31,56,76,71,45,33,96,51,5,38,5,56,81,71,89,25,67,52,36,92,23,8,31,63,21,99},new int[]{50,29,60,67,44,89,2,98,15,39,40,47,76,52,88,6,70,48,58,90,3,96,46,18,56,92,33,17,32,76,85,2,26,39,63,17,34,19,62,32,50,86,45,54,82,88,1},new int[]{66,40,24,52,2,61,27,66,87,33,34,62,32,3,55,27,76,8,20,52,17,33,55,75,73,98,71,16,91,79,64,88,40,58,83,23,95,94,7,59,59,3,30,10,98,13,39},new int[]{77,64,25,41,98,40,62,40,34,79,3,52,46,86,98,69,41,86,60,29,8,98,4,25,50,23,25,98,70,98,21,94,56,3,79,21,83,83,49,46,98,78,68,31,46,75,44},new int[]{45,75,49,4,80,57,56,38,6,82,89,24,52,39,73,37,98,34,40,40,37,92,50,11,78,59,26,60,8,28,84,60,89,10,63,61,75,26,23,63,19,18,50,19,15,16,20},new int[]{19,75,71,19,88,31,52,48,8,50,61,88,8,13,74,19,50,23,57,97,30,94,29,61,35,9,72,25,64,37,38,8,90,75,40,23,96,45,1,49,9,40,28,97,96,8,37},new int[]{82,71,18,76,68,77,75,80,44,78,16,52,53,86,18,40,61,25,35,71,84,27,93,10,75,20,33,77,80,11,69,67,59,66,53,38,10,6,85,95,34,49,32,29,65,33,17},new int[]{98,49,16,7,13,84,4,63,69,80,73,76,78,15,5,42,18,72,8,89,68,26,75,70,33,22,93,69,1,86,35,56,95,67,3,71,1,42,58,88,94,96,96,85,64,80,4},new int[]{17,77,99,40,34,56,11,89,40,94,13,24,34,8,82,7,62,46,86,71,13,2,2,29,91,82,58,2,59,53,68,61,49,46,72,59,48,9,18,50,86,75,27,32,66,66,94},new int[]{22,86,24,91,75,13,91,15,49,17,39,73,87,4,57,15,43,31,6,90,59,65,86,30,58,86,97,56,69,36,46,74,1,12,67,10,1,19,82,95,55,49,55,86,68,41,55},new int[]{74,74,79,69,43,81,82,57,48,50,69,8,56,91,89,26,23,41,87,93,97,59,18,71,96,71,8,58,85,17,51,33,30,66,60,46,22,32,25,8,97,63,29,81,40,45,2},new int[]{49,31,68,90,9,95,10,51,70,44,26,75,79,84,78,21,91,30,71,15,80,59,84,84,86,70,20,69,53,75,2,30,8,40,8,17,99,30,1,69,64,80,36,79,49,81,77},new int[]{24,4,77,62,9,26,47,16,37,70,11,2,94,83,23,47,62,76,39,6,36,62,60,79,36,77,72,89,88,31,40,60,13,93,96,37,61,18,90,18,34,54,31,79,37,84,92},new int[]{68,72,58,82,96,53,87,62,79,7,31,96,40,78,83,50,80,9,65,25,8,39,32,8,13,67,66,28,4,23,34,55,71,94,58,73,19,9,23,75,13,93,31,72,19,5,91},new int[]{39,14,22,22,5,62,52,80,39,26,80,56,12,80,49,12,96,5,92,51,4,93,83,25,99,24,56,19,23,95,83,96,77,46,18,61,71,45,88,46,17,15,73,34,99,8,50},new int[]{11,88,42,94,85,43,35,59,12,73,12,28,93,46,40,99,29,70,16,46,92,65,29,52,40,6,27,37,22,7,1,77,48,51,14,79,12,49,41,68,85,2,85,62,57,14,44},new int[]{66,75,37,78,47,61,84,99,27,49,60,70,71,45,1,13,38,17,38,1,1,83,30,77,7,20,44,73,13,39,20,89,5,52,25,12,90,56,86,1,72,49,67,22,85,85,31},new int[]{1,27,2,93,1,42,8,35,35,7,23,23,46,19,79,72,97,99,13,50,31,71,84,38,57,8,14,94,51,9,13,76,66,38,21,29,84,50,64,9,15,53,97,53,71,3,87},new int[]{22,39,77,9,34,12,34,45,97,50,99,28,39,3,47,12,43,77,67,18,90,10,4,12,53,51,16,17,95,26,2,29,94,47,11,34,71,29,97,49,91,16,81,75,14,13,35},new int[]{90,52,25,59,76,68,42,48,91,45,72,72,29,3,21,31,13,95,81,48,96,24,2,3,26,2,33,34,90,98,38,78,95,20,10,84,33,45,60,66,61,51,12,80,9,11,21},new int[]{76,68,26,63,19,17,44,61,1,72,58,94,41,24,43,81,94,9,66,90,32,91,41,11,65,18,8,27,82,9,2,81,75,46,70,5,12,44,42,99,88,30,52,81,47,36,70},new int[]{32,98,44,16,71,96,17,32,14,26,73,13,89,12,45,16,94,52,21,24,43,5,33,31,9,35,8,75,17,80,20,91,78,22,54,71,75,81,77,81,75,68,80,31,85,97,13},new int[]{29,79,10,33,15,77,35,54,21,30,46,42,71,49,24,80,69,6,2,3,53,10,24,33,84,22,61,96,94,67,4,51,4,39,31,57,73,30,93,89,39,99,25,58,36,11,90},new int[]{46,89,21,2,74,39,99,33,31,4,67,69,81,13,65,45,39,87,89,53,31,13,1,98,29,61,95,72,2,12,56,97,94,41,27,89,38,97,52,80,32,88,2,66,20,57,62},new int[]{91,86,48,83,7,67,50,34,87,69,67,88,91,34,43,21,12,32,47,86,98,87,55,65,68,17,26,95,33,64,92,10,46,73,90,51,34,14,41,90,95,38,48,43,28,41,56},new int[]{81,76,91,65,60,97,13,69,52,43,92,88,84,40,42,37,84,23,67,69,79,69,98,58,46,87,47,17,9,68,94,78,30,95,61,65,58,27,66,45,40,61,41,74,88,84,42},new int[]{62,80,38,60,49,18,99,94,5,11,4,61,75,12,49,28,90,34,56,65,6,33,47,24,34,72,16,80,16,98,84,14,59,62,90,66,19,61,66,26,89,49,19,49,81,30,76},new int[]{57,85,36,40,28,97,46,73,82,88,32,87,58,76,98,26,70,69,87,50,79,32,58,64,77,28,97,72,80,39,96,80,45,13,20,58,19,75,91,80,9,77,19,94,55,39,17},new int[]{62,94,93,60,42,2,50,67,20,1,5,97,39,87,18,68,97,90,22,30,90,1,70,81,95,51,68,74,61,48,53,34,86,86,7,39,37,63,55,15,83,74,62,68,50,41,61},new int[]{25,28,82,35,83,53,84,39,97,59,65,1,45,19,48,49,73,14,67,30,65,69,87,6,84,46,42,72,61,31,79,26,58,33,52,32,54,1,5,22,95,5,8,70,63,10,62},new int[]{40,47,80,56,28,56,1,52,82,62,42,47,37,11,67,29,4,95,11,30,79,79,58,32,29,43,92,85,39,11,96,27,24,37,65,32,53,1,56,34,82,29,6,57,95,14,75},new int[]{69,62,86,51,13,76,4,38,4,30,54,65,61,49,31,42,50,23,78,99,81,60,32,56,56,87,34,41,39,86,42,66,20,14,38,37,37,12,92,56,8,93,21,39,48,18,63}}); List<Integer> param1 = new ArrayList<>(); param1.add(2); param1.add(3); param1.add(1); param1.add(2); param1.add(4); param1.add(10); param1.add(7); param1.add(35); param1.add(29); param1.add(41); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([[ 3, -2, 1 ], [ 1, -3, 2 ], [ -1, 2, 4 ]],2,), ([[ 2, -2, 1 ], [ 1, -3, 2 ], [ -1, 2, 4 ]],3,), ([[78, 46, 33, 58, 79, 94, 94, 31, 69], [83, 48, 11, 74, 33, 61, 88, 15, 29], [27, 20, 36, 14, 37, 88, 49, 36, 58], [93, 15, 39, 5, 97, 45, 1, 47, 34], [8, 88, 54, 87, 60, 77, 37, 46, 18], [10, 68, 71, 86, 76, 24, 47, 37, 72], [84, 43, 82, 25, 87, 18, 51, 46, 75], [59, 39, 78, 86, 38, 55, 79, 5, 5], [50, 42, 19, 34, 53, 80, 21, 45, 96]],1,), ([[88, 35, 82, 14, 86, 94, 12, 49, 76, 94, 3, 96, 27, 92, 82, 25, 15, 27, 15], [30, 75, 59, 45, 53, 78, 45, 92, 72, 61, 11, 78, 51, 86, 89, 74, 39, 24, 6], [33, 22, 60, 20, 11, 35, 35, 65, 90, 78, 49, 66, 46, 5, 39, 79, 85, 93, 51], [21, 38, 36, 14, 33, 23, 72, 84, 38, 47, 64, 47, 1, 42, 68, 78, 86, 76, 25], [57, 52, 7, 7, 56, 39, 70, 83, 58, 23, 10, 72, 36, 71, 3, 72, 77, 95, 13], [90, 48, 66, 3, 63, 15, 2, 61, 59, 17, 11, 5, 70, 67, 23, 96, 63, 4, 29], [17, 95, 35, 48, 85, 87, 48, 95, 53, 65, 75, 1, 7, 77, 84, 70, 30, 70, 98], [99, 84, 38, 30, 97, 54, 88, 95, 16, 16, 27, 22, 15, 46, 1, 28, 33, 15, 95], [57, 70, 68, 58, 20, 4, 10, 7, 91, 57, 6, 55, 31, 64, 36, 91, 13, 75, 73], [72, 61, 10, 66, 24, 99, 34, 50, 75, 1, 5, 27, 7, 1, 32, 17, 18, 68, 49], [13, 69, 22, 26, 68, 87, 5, 9, 77, 62, 73, 68, 90, 78, 2, 95, 50, 51, 90], [2, 41, 64, 44, 52, 37, 66, 92, 56, 23, 71, 39, 86, 60, 56, 36, 1, 98, 4], [41, 99, 53, 31, 33, 5, 43, 11, 32, 1, 43, 6, 92, 81, 11, 41, 27, 61, 76], [13, 95, 35, 25, 94, 36, 21, 55, 36, 28, 27, 12, 74, 26, 93, 45, 6, 89, 8], [75, 17, 38, 77, 41, 15, 83, 83, 74, 28, 25, 79, 35, 80, 37, 27, 5, 59, 88], [66, 99, 57, 61, 97, 96, 60, 64, 32, 16, 44, 87, 90, 69, 61, 71, 34, 74, 86], [21, 19, 52, 42, 39, 45, 89, 13, 43, 83, 71, 95, 66, 45, 4, 1, 60, 50, 87], [47, 17, 86, 35, 8, 56, 60, 55, 7, 65, 25, 24, 97, 75, 96, 93, 65, 47, 8], [45, 29, 31, 57, 99, 7, 31, 60, 56, 32, 94, 61, 61, 76, 99, 64, 10, 26, 69]],2,), ([[97, 37, 30, 97, 2, 42, 68, 90, 94], [35, 10, 31, 79, 85, 6, 65, 74, 2], [9, 81, 80, 66, 80, 99, 59, 92, 13], [6, 25, 63, 59, 90, 46, 15, 66, 86], [42, 92, 17, 23, 15, 38, 56, 34, 94], [65, 80, 89, 87, 97, 34, 73, 16, 50], [69, 42, 62, 12, 69, 87, 72, 99, 80], [84, 28, 30, 75, 50, 17, 10, 88, 95], [11, 47, 8, 31, 37, 33, 9, 46, 3]],4,), ([[28, 52, 61, 24, 10, 42, 37, 15, 28, 37, 65, 13, 59], [68, 56, 30, 64, 67, 20, 99, 27, 12, 41, 80, 96, 51], [97, 80, 29, 91, 95, 51, 59, 88, 31, 9, 70, 30, 90], [40, 7, 72, 59, 11, 3, 4, 97, 20, 5, 34, 14, 13], [61, 49, 45, 53, 24, 94, 63, 75, 9, 63, 56, 77, 77], [96, 71, 75, 42, 1, 64, 92, 72, 15, 69, 22, 20, 68], [45, 89, 80, 40, 46, 91, 63, 93, 12, 52, 7, 88, 55], [5, 47, 97, 38, 43, 70, 8, 86, 50, 78, 9, 13, 50], [96, 78, 35, 25, 61, 31, 49, 43, 45, 84, 7, 74, 6], [89, 50, 70, 45, 54, 17, 86, 87, 29, 64, 71, 99, 20], [26, 93, 29, 7, 34, 5, 77, 6, 96, 33, 43, 59, 33], [83, 61, 18, 14, 21, 39, 34, 31, 81, 7, 85, 71, 1], [86, 22, 87, 92, 63, 62, 46, 57, 94, 45, 74, 76, 80]],10,), ([[68, 37, 94, 90, 14, 37, 89, 91, 14, 66, 66, 33, 2], [98, 53, 89, 55, 45, 37, 27, 90, 52, 86, 47, 58, 7], [13, 48, 28, 45, 56, 92, 88, 35, 55, 97, 37, 9, 3], [2, 58, 22, 85, 24, 78, 54, 97, 17, 58, 58, 21, 77], [63, 63, 44, 40, 75, 66, 92, 67, 79, 46, 24, 72, 70], [96, 51, 99, 77, 92, 4, 31, 65, 30, 72, 40, 14, 44], [92, 34, 39, 4, 88, 27, 42, 11, 87, 32, 50, 53, 4], [19, 71, 33, 78, 77, 70, 83, 55, 9, 62, 99, 62, 48], [90, 68, 48, 92, 27, 55, 44, 71, 52, 57, 9, 98, 8], [56, 10, 65, 72, 45, 39, 46, 17, 82, 98, 99, 67, 76], [62, 68, 36, 9, 35, 67, 89, 52, 90, 91, 28, 58, 83], [24, 59, 37, 38, 25, 98, 15, 16, 55, 4, 26, 39, 57], [47, 90, 48, 92, 49, 37, 38, 62, 61, 74, 97, 8, 38]],7,), ([[85, 56, 45, 50, 20, 63, 55, 34, 92, 32, 76, 73, 43, 79, 13, 2, 61, 84, 14, 42, 15, 93, 85, 10, 56, 53, 58, 85, 99, 81, 62, 57, 63, 4, 78, 96], [82, 34, 32, 78, 34, 70, 40, 35, 15, 51, 20, 92, 37, 38, 21, 88, 10, 54, 9, 86, 42, 16, 24, 4, 44, 23, 42, 86, 66, 92, 19, 20, 28, 24, 91, 2], [7, 1, 11, 51, 60, 31, 30, 77, 24, 18, 58, 77, 17, 46, 94, 19, 12, 90, 82, 12, 50, 66, 20, 6, 1, 90, 7, 96, 55, 97, 74, 15, 95, 24, 29, 82], [71, 34, 78, 84, 93, 37, 42, 64, 95, 19, 23, 71, 6, 99, 93, 55, 77, 39, 25, 98, 83, 4, 88, 33, 66, 2, 14, 50, 11, 34, 38, 92, 39, 22, 42, 97], [95, 57, 78, 38, 9, 88, 29, 69, 42, 60, 39, 91, 72, 93, 60, 53, 76, 8, 21, 56, 48, 47, 9, 78, 1, 55, 31, 80, 91, 11, 66, 60, 31, 50, 60, 88], [62, 39, 3, 58, 68, 30, 67, 68, 58, 77, 53, 14, 10, 78, 81, 22, 63, 61, 46, 37, 21, 89, 3, 19, 32, 79, 24, 73, 74, 48, 96, 58, 40, 7, 46, 91], [15, 85, 74, 87, 5, 59, 70, 22, 28, 54, 19, 14, 48, 7, 79, 32, 22, 46, 85, 83, 13, 22, 10, 44, 24, 59, 62, 72, 72, 55, 49, 50, 19, 82, 58, 97], [48, 93, 96, 72, 96, 12, 86, 20, 45, 26, 81, 98, 31, 82, 59, 3, 18, 84, 21, 57, 99, 42, 62, 30, 61, 36, 55, 4, 15, 71, 96, 97, 57, 63, 77, 64], [17, 53, 40, 70, 50, 68, 15, 72, 34, 30, 87, 73, 24, 8, 57, 70, 25, 77, 34, 25, 18, 73, 97, 70, 14, 6, 82, 90, 36, 36, 75, 18, 15, 94, 89, 16], [76, 14, 47, 54, 58, 77, 30, 46, 16, 1, 41, 93, 27, 77, 62, 81, 28, 20, 55, 51, 69, 88, 73, 97, 34, 27, 97, 38, 29, 35, 20, 19, 5, 25, 93, 26], [51, 66, 61, 15, 45, 6, 58, 1, 73, 43, 16, 14, 74, 19, 51, 8, 48, 12, 70, 35, 70, 6, 99, 11, 38, 91, 26, 28, 72, 89, 83, 80, 50, 58, 26, 44], [15, 76, 24, 77, 59, 57, 17, 77, 81, 1, 11, 20, 31, 99, 39, 63, 6, 99, 28, 51, 53, 44, 65, 80, 12, 28, 79, 72, 68, 95, 30, 35, 6, 85, 30, 80], [63, 8, 91, 33, 43, 76, 43, 45, 87, 54, 65, 7, 36, 25, 85, 37, 12, 32, 49, 38, 56, 80, 65, 26, 57, 14, 56, 70, 41, 51, 84, 67, 12, 97, 49, 1], [19, 66, 58, 87, 72, 98, 4, 8, 27, 26, 97, 43, 40, 50, 67, 73, 74, 29, 85, 42, 18, 81, 21, 67, 62, 27, 96, 93, 47, 93, 26, 9, 91, 12, 16, 47], [56, 66, 51, 27, 73, 66, 62, 71, 8, 38, 6, 59, 19, 79, 56, 28, 94, 91, 10, 45, 95, 65, 50, 32, 61, 16, 6, 66, 62, 66, 67, 19, 4, 43, 18, 82], [46, 46, 85, 21, 30, 64, 41, 17, 5, 5, 73, 75, 48, 78, 38, 6, 58, 14, 72, 94, 59, 65, 89, 13, 27, 25, 56, 68, 59, 95, 49, 18, 81, 75, 76, 3], [79, 57, 6, 69, 31, 8, 10, 3, 12, 92, 76, 94, 19, 21, 81, 14, 75, 29, 7, 49, 65, 7, 14, 16, 99, 16, 85, 13, 82, 29, 85, 73, 95, 61, 37, 17], [31, 59, 88, 47, 6, 32, 31, 18, 9, 3, 71, 26, 13, 34, 43, 93, 33, 69, 36, 79, 74, 68, 47, 61, 45, 96, 88, 84, 48, 41, 38, 68, 75, 11, 16, 65], [97, 71, 67, 71, 1, 97, 71, 4, 82, 37, 14, 79, 25, 82, 4, 66, 43, 26, 84, 15, 6, 37, 43, 42, 13, 16, 42, 38, 66, 65, 5, 30, 95, 43, 32, 67], [67, 42, 5, 99, 86, 96, 59, 23, 8, 68, 70, 91, 19, 44, 93, 38, 44, 6, 3, 96, 80, 33, 66, 58, 26, 99, 28, 43, 75, 88, 16, 89, 23, 59, 35, 89], [41, 97, 22, 74, 1, 46, 22, 32, 87, 30, 87, 43, 12, 83, 71, 27, 26, 18, 92, 75, 66, 81, 61, 46, 29, 32, 15, 60, 82, 28, 27, 41, 47, 33, 44, 50], [10, 24, 34, 91, 20, 25, 55, 90, 43, 53, 85, 50, 55, 13, 49, 97, 10, 92, 97, 11, 78, 84, 20, 72, 79, 97, 83, 48, 76, 17, 33, 20, 46, 31, 51, 83], [19, 62, 44, 77, 38, 49, 65, 11, 27, 58, 64, 65, 15, 82, 89, 1, 19, 56, 64, 34, 64, 10, 76, 60, 39, 66, 32, 51, 26, 57, 84, 60, 55, 6, 7, 66], [81, 26, 95, 98, 82, 78, 5, 87, 1, 84, 2, 65, 10, 50, 51, 69, 41, 58, 77, 68, 24, 91, 56, 36, 2, 96, 56, 81, 12, 12, 85, 72, 22, 74, 84, 62], [64, 28, 89, 28, 4, 45, 90, 13, 83, 98, 80, 4, 61, 84, 26, 94, 6, 77, 56, 81, 27, 35, 97, 82, 58, 84, 63, 33, 95, 83, 97, 81, 33, 69, 40, 47], [45, 27, 7, 58, 14, 4, 82, 34, 80, 91, 38, 20, 46, 19, 1, 23, 62, 73, 28, 84, 80, 77, 33, 3, 79, 16, 30, 25, 78, 1, 33, 37, 29, 37, 61, 8], [1, 63, 88, 65, 46, 43, 10, 82, 85, 10, 62, 86, 51, 45, 73, 73, 45, 85, 58, 95, 66, 24, 97, 75, 65, 55, 51, 72, 73, 21, 47, 22, 29, 40, 3, 49], [25, 82, 11, 94, 89, 75, 98, 88, 48, 32, 3, 45, 89, 20, 20, 51, 81, 20, 82, 14, 98, 80, 32, 72, 42, 80, 39, 38, 64, 4, 99, 92, 63, 61, 78, 5], [66, 45, 50, 88, 3, 23, 11, 38, 56, 35, 65, 6, 70, 40, 90, 35, 13, 25, 86, 81, 78, 67, 68, 99, 47, 55, 92, 43, 2, 45, 48, 62, 38, 47, 4, 60], [49, 76, 34, 44, 94, 85, 56, 92, 42, 50, 69, 33, 98, 96, 91, 67, 42, 44, 68, 57, 36, 41, 56, 3, 56, 56, 65, 39, 40, 39, 27, 67, 94, 65, 74, 3], [3, 37, 98, 20, 11, 83, 91, 24, 70, 65, 83, 74, 32, 62, 55, 36, 66, 37, 14, 46, 77, 56, 50, 61, 17, 27, 54, 29, 13, 49, 25, 88, 23, 26, 48, 36], [6, 80, 74, 39, 57, 91, 66, 10, 72, 9, 77, 72, 27, 46, 63, 42, 85, 41, 34, 93, 30, 44, 80, 1, 45, 47, 93, 30, 22, 15, 84, 38, 23, 31, 57, 81], [35, 66, 53, 31, 26, 31, 72, 80, 12, 53, 56, 83, 62, 44, 58, 77, 65, 13, 61, 68, 51, 62, 48, 95, 63, 72, 91, 72, 51, 24, 86, 40, 29, 73, 17, 1], [96, 84, 1, 25, 41, 91, 23, 18, 95, 28, 85, 12, 88, 49, 97, 81, 97, 16, 27, 53, 92, 36, 7, 34, 65, 4, 26, 20, 51, 77, 99, 10, 8, 18, 17, 69], [30, 95, 39, 61, 24, 81, 98, 35, 79, 61, 75, 98, 72, 15, 36, 55, 37, 87, 62, 64, 39, 90, 98, 75, 12, 72, 8, 41, 69, 74, 3, 43, 37, 86, 57, 25], [4, 58, 37, 8, 94, 9, 79, 1, 13, 68, 16, 44, 65, 14, 91, 26, 32, 2, 16, 92, 49, 90, 75, 23, 94, 60, 95, 66, 20, 93, 74, 18, 59, 31, 4, 27]],35,), ([[95, 71, 19, 39, 66, 78, 46, 92, 38, 67, 29, 91, 57, 48, 52, 48, 61, 67, 48, 94, 82, 8, 74, 86, 88, 67, 14, 47, 24, 91, 62, 58, 34, 31, 48, 91, 45, 29, 29, 63, 48, 12, 78, 27], [47, 66, 37, 45, 57, 18, 13, 73, 29, 56, 74, 20, 29, 6, 26, 61, 86, 43, 47, 26, 81, 1, 95, 73, 26, 64, 62, 6, 62, 66, 42, 27, 65, 30, 82, 98, 85, 65, 47, 32, 34, 47, 14, 5], [36, 96, 9, 35, 25, 75, 46, 13, 61, 30, 98, 32, 30, 82, 56, 67, 71, 55, 98, 8, 43, 48, 58, 32, 78, 69, 7, 74, 20, 62, 21, 92, 29, 70, 38, 42, 3, 37, 17, 33, 10, 37, 33, 28], [87, 42, 58, 48, 51, 10, 8, 16, 96, 62, 49, 89, 15, 16, 81, 27, 47, 26, 72, 41, 11, 91, 9, 54, 11, 7, 28, 94, 62, 55, 36, 73, 99, 63, 51, 77, 48, 68, 10, 26, 67, 53, 43, 17], [27, 22, 36, 72, 33, 90, 95, 53, 11, 93, 29, 38, 58, 15, 54, 62, 57, 79, 71, 58, 49, 53, 29, 33, 46, 54, 80, 98, 85, 7, 29, 9, 49, 71, 78, 94, 88, 51, 98, 8, 55, 65, 98, 84], [95, 79, 15, 51, 34, 69, 86, 12, 45, 31, 54, 93, 22, 72, 64, 60, 28, 21, 75, 75, 87, 77, 43, 27, 23, 97, 90, 36, 97, 38, 16, 74, 43, 41, 44, 52, 17, 52, 43, 23, 1, 93, 25, 6], [74, 54, 78, 23, 19, 56, 53, 31, 38, 19, 1, 77, 50, 98, 58, 81, 32, 49, 98, 97, 92, 44, 29, 88, 48, 80, 77, 26, 7, 44, 14, 52, 32, 75, 32, 75, 84, 57, 52, 34, 61, 62, 86, 87], [93, 76, 31, 29, 31, 12, 35, 57, 41, 27, 15, 94, 71, 36, 24, 82, 24, 96, 76, 28, 75, 3, 3, 29, 32, 54, 38, 95, 56, 65, 21, 41, 20, 60, 75, 59, 74, 55, 3, 14, 45, 95, 99, 60], [49, 9, 54, 70, 93, 52, 63, 52, 22, 55, 3, 2, 59, 28, 37, 69, 9, 62, 32, 81, 75, 35, 47, 18, 36, 19, 25, 46, 60, 95, 23, 78, 27, 35, 77, 55, 36, 88, 97, 71, 9, 21, 32, 66], [44, 89, 65, 75, 80, 87, 15, 27, 16, 46, 97, 72, 48, 65, 19, 90, 37, 58, 55, 53, 47, 3, 88, 86, 62, 1, 39, 73, 33, 23, 34, 49, 49, 99, 49, 10, 96, 66, 71, 88, 67, 76, 39, 42], [91, 1, 46, 36, 96, 91, 44, 31, 97, 58, 96, 4, 53, 89, 93, 57, 73, 78, 50, 5, 52, 17, 32, 6, 69, 93, 92, 61, 10, 23, 53, 61, 19, 4, 46, 32, 84, 46, 62, 92, 54, 87, 67, 24], [66, 18, 96, 48, 46, 48, 62, 94, 27, 62, 78, 65, 52, 1, 50, 40, 72, 17, 1, 78, 77, 30, 77, 67, 22, 35, 56, 14, 45, 86, 33, 12, 24, 69, 57, 9, 2, 59, 95, 29, 93, 55, 94, 22], [85, 49, 12, 71, 89, 8, 97, 16, 40, 45, 64, 63, 51, 10, 76, 86, 71, 45, 85, 56, 86, 73, 84, 13, 64, 88, 30, 52, 54, 57, 18, 25, 53, 20, 11, 40, 98, 23, 90, 87, 42, 47, 56, 33], [89, 98, 26, 69, 29, 94, 60, 91, 37, 25, 74, 44, 34, 12, 93, 39, 19, 19, 29, 66, 90, 98, 94, 76, 20, 57, 97, 9, 2, 28, 34, 21, 83, 78, 81, 56, 5, 85, 22, 59, 40, 84, 92, 63], [32, 45, 83, 92, 87, 33, 82, 35, 46, 36, 62, 83, 90, 26, 7, 87, 5, 87, 32, 79, 91, 81, 84, 57, 80, 62, 28, 95, 80, 78, 74, 66, 97, 41, 86, 66, 64, 7, 41, 45, 44, 30, 38, 39], [19, 47, 38, 17, 74, 79, 69, 99, 4, 35, 1, 81, 85, 58, 22, 5, 60, 36, 9, 84, 57, 78, 84, 90, 4, 51, 39, 84, 52, 75, 71, 55, 31, 50, 8, 87, 15, 65, 10, 41, 88, 79, 48, 21], [86, 24, 74, 23, 80, 69, 33, 36, 25, 58, 90, 66, 98, 31, 44, 63, 45, 83, 82, 50, 67, 71, 87, 1, 71, 86, 67, 83, 94, 9, 99, 35, 13, 26, 45, 51, 92, 25, 56, 39, 3, 75, 94, 53], [33, 62, 98, 67, 69, 95, 4, 72, 59, 17, 22, 38, 88, 31, 49, 52, 89, 38, 96, 49, 90, 27, 23, 84, 27, 81, 14, 3, 27, 62, 14, 92, 44, 25, 61, 75, 52, 12, 97, 84, 34, 23, 19, 1], [74, 65, 5, 57, 22, 43, 2, 73, 7, 21, 71, 59, 9, 40, 73, 49, 12, 73, 10, 74, 17, 4, 64, 16, 49, 27, 6, 9, 58, 32, 38, 30, 78, 45, 29, 92, 22, 31, 81, 17, 54, 79, 47, 32], [28, 11, 39, 17, 76, 39, 73, 25, 26, 68, 62, 19, 13, 29, 54, 73, 42, 62, 71, 71, 21, 9, 45, 27, 48, 85, 69, 5, 72, 15, 77, 97, 44, 47, 32, 36, 49, 53, 23, 34, 18, 12, 87, 2], [27, 50, 31, 48, 86, 69, 17, 43, 71, 18, 66, 31, 63, 28, 67, 9, 97, 28, 92, 18, 15, 75, 89, 5, 41, 91, 76, 74, 73, 66, 73, 51, 16, 65, 85, 57, 37, 39, 65, 49, 47, 40, 14, 40], [48, 32, 88, 39, 33, 30, 26, 43, 55, 44, 78, 76, 3, 7, 85, 58, 91, 10, 10, 81, 42, 34, 82, 26, 60, 2, 73, 45, 5, 26, 79, 25, 26, 92, 87, 85, 22, 19, 10, 42, 31, 31, 99, 75], [81, 97, 86, 90, 36, 66, 32, 67, 63, 23, 50, 65, 69, 44, 58, 57, 37, 65, 18, 5, 82, 99, 96, 26, 33, 42, 88, 27, 54, 83, 82, 79, 91, 75, 24, 3, 39, 71, 12, 33, 22, 35, 14, 26], [83, 85, 54, 41, 45, 31, 69, 99, 17, 60, 96, 4, 10, 94, 9, 61, 90, 22, 21, 23, 61, 12, 95, 17, 55, 21, 54, 47, 41, 97, 15, 96, 59, 99, 15, 29, 11, 29, 86, 90, 82, 89, 85, 88], [56, 92, 53, 3, 13, 38, 70, 11, 23, 73, 56, 17, 9, 83, 99, 96, 92, 28, 79, 19, 97, 87, 92, 4, 47, 47, 31, 99, 5, 33, 48, 32, 79, 59, 98, 64, 47, 9, 35, 47, 88, 82, 17, 1], [55, 11, 33, 70, 56, 64, 93, 58, 20, 18, 78, 45, 43, 20, 57, 82, 27, 18, 17, 60, 89, 5, 6, 97, 15, 39, 80, 39, 88, 21, 13, 29, 98, 5, 67, 21, 9, 67, 44, 62, 94, 67, 62, 62], [60, 49, 39, 41, 50, 98, 17, 53, 55, 78, 75, 56, 1, 65, 64, 52, 15, 2, 12, 45, 57, 42, 2, 87, 62, 34, 17, 41, 78, 75, 84, 71, 65, 15, 38, 98, 73, 65, 9, 42, 66, 86, 89, 51], [78, 99, 80, 19, 31, 66, 32, 75, 8, 69, 98, 32, 47, 70, 8, 34, 4, 36, 44, 25, 26, 33, 9, 47, 72, 17, 15, 42, 54, 13, 50, 44, 3, 53, 56, 54, 57, 12, 93, 59, 65, 96, 37, 20], [72, 37, 31, 95, 25, 50, 49, 8, 94, 94, 91, 35, 13, 21, 73, 24, 48, 33, 1, 72, 3, 14, 14, 49, 33, 4, 38, 25, 47, 13, 39, 25, 73, 43, 38, 35, 93, 55, 50, 78, 34, 25, 42, 92], [51, 94, 37, 66, 85, 34, 83, 38, 31, 26, 76, 94, 26, 63, 48, 95, 79, 10, 36, 40, 26, 9, 53, 81, 70, 86, 80, 86, 53, 39, 61, 52, 68, 68, 73, 78, 42, 90, 67, 96, 75, 51, 3, 13], [13, 61, 24, 20, 74, 87, 97, 55, 35, 78, 80, 30, 83, 33, 41, 66, 49, 8, 84, 3, 85, 65, 85, 72, 2, 87, 41, 53, 75, 16, 9, 96, 39, 64, 36, 23, 47, 49, 55, 94, 10, 63, 95, 26], [48, 30, 2, 29, 54, 32, 38, 21, 27, 88, 34, 23, 78, 39, 69, 73, 45, 63, 8, 7, 30, 12, 20, 64, 29, 55, 12, 84, 22, 23, 48, 45, 26, 28, 55, 73, 69, 2, 28, 77, 79, 53, 14, 46], [78, 67, 74, 70, 20, 35, 48, 43, 20, 56, 3, 68, 11, 62, 61, 95, 58, 29, 38, 84, 88, 87, 22, 86, 41, 84, 63, 38, 50, 7, 24, 46, 25, 78, 29, 67, 93, 80, 85, 22, 85, 86, 9, 87], [49, 73, 96, 36, 5, 90, 4, 24, 41, 14, 91, 12, 82, 44, 9, 66, 38, 96, 77, 57, 47, 55, 88, 2, 83, 18, 66, 90, 57, 64, 88, 27, 53, 59, 29, 72, 95, 98, 14, 68, 43, 29, 57, 33], [21, 41, 1, 27, 2, 64, 51, 54, 74, 74, 30, 1, 95, 99, 29, 13, 73, 43, 41, 75, 88, 89, 58, 77, 14, 41, 67, 54, 6, 46, 77, 1, 29, 78, 76, 26, 58, 87, 3, 60, 14, 98, 23, 62], [10, 4, 39, 74, 88, 34, 88, 25, 52, 15, 12, 1, 9, 59, 14, 31, 88, 53, 63, 10, 43, 18, 67, 59, 76, 99, 23, 86, 75, 46, 49, 23, 12, 29, 89, 88, 59, 53, 68, 63, 29, 3, 95, 89], [37, 63, 23, 49, 86, 93, 77, 3, 22, 36, 10, 9, 56, 55, 19, 72, 33, 20, 94, 35, 31, 83, 50, 46, 78, 10, 67, 34, 51, 92, 83, 39, 90, 68, 12, 26, 71, 67, 90, 2, 12, 59, 32, 51], [11, 32, 64, 45, 79, 54, 6, 26, 8, 8, 38, 8, 17, 83, 3, 41, 73, 53, 97, 96, 96, 70, 62, 53, 59, 93, 81, 83, 95, 83, 23, 47, 35, 14, 65, 97, 49, 36, 1, 84, 22, 35, 3, 12], [37, 58, 77, 12, 2, 84, 65, 58, 60, 41, 35, 88, 90, 11, 52, 52, 62, 63, 15, 70, 40, 9, 70, 17, 23, 58, 95, 80, 51, 57, 86, 16, 45, 61, 12, 73, 6, 4, 81, 74, 35, 47, 85, 19], [27, 11, 70, 59, 41, 43, 28, 63, 67, 45, 24, 77, 64, 79, 73, 39, 99, 45, 61, 82, 43, 67, 92, 80, 42, 41, 47, 43, 23, 32, 74, 57, 38, 77, 15, 28, 13, 35, 2, 61, 65, 41, 96, 94], [86, 4, 53, 88, 14, 17, 14, 41, 62, 52, 27, 85, 40, 35, 90, 95, 59, 97, 49, 63, 11, 80, 6, 98, 41, 32, 21, 93, 75, 57, 5, 91, 28, 95, 75, 77, 70, 27, 94, 53, 48, 83, 78, 58], [9, 55, 45, 28, 28, 46, 25, 26, 62, 68, 67, 34, 21, 81, 34, 44, 76, 89, 21, 18, 36, 70, 84, 53, 20, 96, 95, 84, 94, 3, 84, 8, 85, 48, 23, 1, 2, 74, 37, 94, 51, 44, 24, 32], [56, 50, 64, 30, 38, 78, 55, 3, 25, 45, 62, 7, 81, 27, 23, 32, 2, 75, 34, 52, 61, 34, 7, 10, 89, 2, 30, 81, 29, 82, 60, 99, 17, 56, 86, 51, 25, 84, 16, 25, 15, 79, 57, 15], [56, 82, 37, 65, 33, 3, 49, 22, 54, 21, 27, 4, 99, 1, 4, 55, 24, 29, 22, 23, 85, 78, 8, 58, 80, 99, 88, 59, 90, 7, 25, 45, 90, 26, 30, 66, 53, 73, 39, 11, 79, 12, 99, 50]],29,), ([[16, 49, 32, 82, 45, 85, 80, 71, 5, 44, 41, 97, 95, 85, 67, 74, 75, 22, 17, 89, 92, 50, 84, 94, 31, 13, 74, 51, 33, 20, 48, 78, 72, 72, 92, 74, 14, 62, 51, 78, 70, 98, 81, 21, 92, 38, 15], [36, 9, 99, 59, 82, 54, 17, 82, 4, 84, 13, 75, 43, 97, 92, 8, 20, 82, 71, 61, 44, 97, 51, 58, 75, 30, 99, 84, 10, 94, 18, 25, 96, 34, 44, 39, 95, 92, 90, 68, 43, 20, 72, 2, 27, 34, 55], [36, 85, 72, 87, 72, 69, 65, 85, 44, 43, 74, 66, 21, 61, 13, 28, 30, 82, 2, 58, 83, 21, 90, 46, 89, 83, 25, 57, 20, 6, 18, 49, 82, 20, 34, 10, 33, 55, 19, 66, 47, 49, 67, 30, 83, 85, 59], [78, 31, 21, 17, 53, 51, 24, 40, 98, 47, 20, 16, 58, 49, 42, 12, 41, 58, 60, 24, 13, 34, 61, 27, 85, 67, 14, 41, 57, 30, 45, 74, 1, 92, 83, 94, 84, 52, 20, 23, 95, 96, 90, 78, 6, 33, 8], [63, 4, 13, 35, 93, 89, 34, 56, 11, 38, 93, 45, 86, 58, 34, 75, 92, 72, 24, 74, 79, 63, 39, 21, 36, 48, 84, 13, 2, 27, 7, 90, 94, 19, 40, 21, 58, 26, 74, 36, 44, 64, 27, 8, 90, 1, 23], [73, 31, 7, 9, 71, 92, 98, 53, 16, 74, 24, 74, 46, 29, 89, 30, 51, 83, 31, 30, 34, 92, 19, 75, 28, 6, 17, 91, 36, 1, 16, 68, 47, 23, 96, 67, 62, 85, 88, 15, 75, 67, 83, 43, 8, 98, 98], [44, 26, 67, 32, 64, 43, 74, 74, 62, 11, 78, 95, 9, 48, 6, 54, 62, 54, 99, 98, 56, 82, 87, 30, 3, 61, 15, 3, 15, 67, 29, 31, 71, 71, 55, 75, 92, 43, 25, 81, 55, 50, 38, 60, 85, 52, 84], [74, 70, 76, 81, 45, 97, 19, 5, 42, 93, 30, 65, 76, 79, 5, 38, 11, 84, 29, 14, 90, 98, 74, 91, 89, 10, 39, 60, 96, 98, 23, 97, 96, 22, 86, 87, 83, 23, 22, 62, 94, 19, 22, 1, 34, 26, 4], [48, 45, 12, 92, 37, 3, 28, 93, 84, 2, 56, 65, 46, 44, 18, 73, 37, 54, 25, 83, 62, 25, 52, 63, 15, 46, 56, 26, 64, 20, 67, 25, 21, 34, 88, 25, 65, 29, 32, 1, 35, 56, 16, 32, 79, 5, 10], [86, 72, 79, 20, 89, 12, 90, 68, 63, 26, 60, 74, 61, 15, 5, 32, 96, 22, 22, 12, 64, 75, 88, 80, 16, 65, 51, 87, 92, 32, 53, 3, 13, 92, 92, 58, 45, 24, 51, 13, 24, 5, 81, 50, 76, 49, 18], [33, 58, 31, 34, 94, 96, 74, 31, 99, 79, 27, 59, 27, 1, 76, 68, 23, 98, 52, 57, 87, 51, 83, 84, 63, 84, 93, 77, 28, 24, 22, 86, 40, 75, 8, 96, 88, 12, 49, 21, 67, 39, 62, 82, 58, 62, 70], [36, 45, 79, 15, 62, 38, 64, 88, 71, 9, 75, 80, 71, 25, 78, 65, 20, 28, 49, 34, 73, 20, 95, 85, 22, 77, 44, 47, 25, 22, 61, 52, 20, 96, 80, 20, 86, 45, 37, 15, 76, 9, 44, 15, 44, 86, 12], [27, 19, 25, 74, 99, 64, 12, 50, 72, 11, 83, 23, 88, 15, 63, 20, 89, 78, 10, 61, 93, 47, 49, 49, 76, 33, 87, 78, 23, 53, 37, 22, 93, 2, 20, 5, 91, 3, 82, 77, 86, 77, 12, 32, 58, 71, 70], [40, 6, 63, 25, 91, 69, 83, 73, 50, 40, 1, 46, 73, 39, 10, 49, 14, 46, 40, 89, 19, 17, 82, 46, 73, 65, 70, 38, 17, 73, 11, 53, 18, 7, 35, 44, 71, 39, 11, 10, 98, 88, 76, 9, 86, 96, 8], [48, 21, 80, 97, 89, 6, 59, 68, 23, 73, 75, 35, 12, 99, 71, 57, 29, 85, 67, 61, 61, 88, 30, 27, 93, 30, 55, 23, 37, 26, 36, 92, 63, 37, 51, 68, 93, 78, 63, 37, 97, 31, 78, 25, 73, 25, 46], [89, 30, 20, 23, 1, 15, 21, 30, 11, 90, 52, 30, 9, 69, 47, 34, 33, 98, 65, 51, 79, 31, 56, 76, 71, 45, 33, 96, 51, 5, 38, 5, 56, 81, 71, 89, 25, 67, 52, 36, 92, 23, 8, 31, 63, 21, 99], [50, 29, 60, 67, 44, 89, 2, 98, 15, 39, 40, 47, 76, 52, 88, 6, 70, 48, 58, 90, 3, 96, 46, 18, 56, 92, 33, 17, 32, 76, 85, 2, 26, 39, 63, 17, 34, 19, 62, 32, 50, 86, 45, 54, 82, 88, 1], [66, 40, 24, 52, 2, 61, 27, 66, 87, 33, 34, 62, 32, 3, 55, 27, 76, 8, 20, 52, 17, 33, 55, 75, 73, 98, 71, 16, 91, 79, 64, 88, 40, 58, 83, 23, 95, 94, 7, 59, 59, 3, 30, 10, 98, 13, 39], [77, 64, 25, 41, 98, 40, 62, 40, 34, 79, 3, 52, 46, 86, 98, 69, 41, 86, 60, 29, 8, 98, 4, 25, 50, 23, 25, 98, 70, 98, 21, 94, 56, 3, 79, 21, 83, 83, 49, 46, 98, 78, 68, 31, 46, 75, 44], [45, 75, 49, 4, 80, 57, 56, 38, 6, 82, 89, 24, 52, 39, 73, 37, 98, 34, 40, 40, 37, 92, 50, 11, 78, 59, 26, 60, 8, 28, 84, 60, 89, 10, 63, 61, 75, 26, 23, 63, 19, 18, 50, 19, 15, 16, 20], [19, 75, 71, 19, 88, 31, 52, 48, 8, 50, 61, 88, 8, 13, 74, 19, 50, 23, 57, 97, 30, 94, 29, 61, 35, 9, 72, 25, 64, 37, 38, 8, 90, 75, 40, 23, 96, 45, 1, 49, 9, 40, 28, 97, 96, 8, 37], [82, 71, 18, 76, 68, 77, 75, 80, 44, 78, 16, 52, 53, 86, 18, 40, 61, 25, 35, 71, 84, 27, 93, 10, 75, 20, 33, 77, 80, 11, 69, 67, 59, 66, 53, 38, 10, 6, 85, 95, 34, 49, 32, 29, 65, 33, 17], [98, 49, 16, 7, 13, 84, 4, 63, 69, 80, 73, 76, 78, 15, 5, 42, 18, 72, 8, 89, 68, 26, 75, 70, 33, 22, 93, 69, 1, 86, 35, 56, 95, 67, 3, 71, 1, 42, 58, 88, 94, 96, 96, 85, 64, 80, 4], [17, 77, 99, 40, 34, 56, 11, 89, 40, 94, 13, 24, 34, 8, 82, 7, 62, 46, 86, 71, 13, 2, 2, 29, 91, 82, 58, 2, 59, 53, 68, 61, 49, 46, 72, 59, 48, 9, 18, 50, 86, 75, 27, 32, 66, 66, 94], [22, 86, 24, 91, 75, 13, 91, 15, 49, 17, 39, 73, 87, 4, 57, 15, 43, 31, 6, 90, 59, 65, 86, 30, 58, 86, 97, 56, 69, 36, 46, 74, 1, 12, 67, 10, 1, 19, 82, 95, 55, 49, 55, 86, 68, 41, 55], [74, 74, 79, 69, 43, 81, 82, 57, 48, 50, 69, 8, 56, 91, 89, 26, 23, 41, 87, 93, 97, 59, 18, 71, 96, 71, 8, 58, 85, 17, 51, 33, 30, 66, 60, 46, 22, 32, 25, 8, 97, 63, 29, 81, 40, 45, 2], [49, 31, 68, 90, 9, 95, 10, 51, 70, 44, 26, 75, 79, 84, 78, 21, 91, 30, 71, 15, 80, 59, 84, 84, 86, 70, 20, 69, 53, 75, 2, 30, 8, 40, 8, 17, 99, 30, 1, 69, 64, 80, 36, 79, 49, 81, 77], [24, 4, 77, 62, 9, 26, 47, 16, 37, 70, 11, 2, 94, 83, 23, 47, 62, 76, 39, 6, 36, 62, 60, 79, 36, 77, 72, 89, 88, 31, 40, 60, 13, 93, 96, 37, 61, 18, 90, 18, 34, 54, 31, 79, 37, 84, 92], [68, 72, 58, 82, 96, 53, 87, 62, 79, 7, 31, 96, 40, 78, 83, 50, 80, 9, 65, 25, 8, 39, 32, 8, 13, 67, 66, 28, 4, 23, 34, 55, 71, 94, 58, 73, 19, 9, 23, 75, 13, 93, 31, 72, 19, 5, 91], [39, 14, 22, 22, 5, 62, 52, 80, 39, 26, 80, 56, 12, 80, 49, 12, 96, 5, 92, 51, 4, 93, 83, 25, 99, 24, 56, 19, 23, 95, 83, 96, 77, 46, 18, 61, 71, 45, 88, 46, 17, 15, 73, 34, 99, 8, 50], [11, 88, 42, 94, 85, 43, 35, 59, 12, 73, 12, 28, 93, 46, 40, 99, 29, 70, 16, 46, 92, 65, 29, 52, 40, 6, 27, 37, 22, 7, 1, 77, 48, 51, 14, 79, 12, 49, 41, 68, 85, 2, 85, 62, 57, 14, 44], [66, 75, 37, 78, 47, 61, 84, 99, 27, 49, 60, 70, 71, 45, 1, 13, 38, 17, 38, 1, 1, 83, 30, 77, 7, 20, 44, 73, 13, 39, 20, 89, 5, 52, 25, 12, 90, 56, 86, 1, 72, 49, 67, 22, 85, 85, 31], [1, 27, 2, 93, 1, 42, 8, 35, 35, 7, 23, 23, 46, 19, 79, 72, 97, 99, 13, 50, 31, 71, 84, 38, 57, 8, 14, 94, 51, 9, 13, 76, 66, 38, 21, 29, 84, 50, 64, 9, 15, 53, 97, 53, 71, 3, 87], [22, 39, 77, 9, 34, 12, 34, 45, 97, 50, 99, 28, 39, 3, 47, 12, 43, 77, 67, 18, 90, 10, 4, 12, 53, 51, 16, 17, 95, 26, 2, 29, 94, 47, 11, 34, 71, 29, 97, 49, 91, 16, 81, 75, 14, 13, 35], [90, 52, 25, 59, 76, 68, 42, 48, 91, 45, 72, 72, 29, 3, 21, 31, 13, 95, 81, 48, 96, 24, 2, 3, 26, 2, 33, 34, 90, 98, 38, 78, 95, 20, 10, 84, 33, 45, 60, 66, 61, 51, 12, 80, 9, 11, 21], [76, 68, 26, 63, 19, 17, 44, 61, 1, 72, 58, 94, 41, 24, 43, 81, 94, 9, 66, 90, 32, 91, 41, 11, 65, 18, 8, 27, 82, 9, 2, 81, 75, 46, 70, 5, 12, 44, 42, 99, 88, 30, 52, 81, 47, 36, 70], [32, 98, 44, 16, 71, 96, 17, 32, 14, 26, 73, 13, 89, 12, 45, 16, 94, 52, 21, 24, 43, 5, 33, 31, 9, 35, 8, 75, 17, 80, 20, 91, 78, 22, 54, 71, 75, 81, 77, 81, 75, 68, 80, 31, 85, 97, 13], [29, 79, 10, 33, 15, 77, 35, 54, 21, 30, 46, 42, 71, 49, 24, 80, 69, 6, 2, 3, 53, 10, 24, 33, 84, 22, 61, 96, 94, 67, 4, 51, 4, 39, 31, 57, 73, 30, 93, 89, 39, 99, 25, 58, 36, 11, 90], [46, 89, 21, 2, 74, 39, 99, 33, 31, 4, 67, 69, 81, 13, 65, 45, 39, 87, 89, 53, 31, 13, 1, 98, 29, 61, 95, 72, 2, 12, 56, 97, 94, 41, 27, 89, 38, 97, 52, 80, 32, 88, 2, 66, 20, 57, 62], [91, 86, 48, 83, 7, 67, 50, 34, 87, 69, 67, 88, 91, 34, 43, 21, 12, 32, 47, 86, 98, 87, 55, 65, 68, 17, 26, 95, 33, 64, 92, 10, 46, 73, 90, 51, 34, 14, 41, 90, 95, 38, 48, 43, 28, 41, 56], [81, 76, 91, 65, 60, 97, 13, 69, 52, 43, 92, 88, 84, 40, 42, 37, 84, 23, 67, 69, 79, 69, 98, 58, 46, 87, 47, 17, 9, 68, 94, 78, 30, 95, 61, 65, 58, 27, 66, 45, 40, 61, 41, 74, 88, 84, 42], [62, 80, 38, 60, 49, 18, 99, 94, 5, 11, 4, 61, 75, 12, 49, 28, 90, 34, 56, 65, 6, 33, 47, 24, 34, 72, 16, 80, 16, 98, 84, 14, 59, 62, 90, 66, 19, 61, 66, 26, 89, 49, 19, 49, 81, 30, 76], [57, 85, 36, 40, 28, 97, 46, 73, 82, 88, 32, 87, 58, 76, 98, 26, 70, 69, 87, 50, 79, 32, 58, 64, 77, 28, 97, 72, 80, 39, 96, 80, 45, 13, 20, 58, 19, 75, 91, 80, 9, 77, 19, 94, 55, 39, 17], [62, 94, 93, 60, 42, 2, 50, 67, 20, 1, 5, 97, 39, 87, 18, 68, 97, 90, 22, 30, 90, 1, 70, 81, 95, 51, 68, 74, 61, 48, 53, 34, 86, 86, 7, 39, 37, 63, 55, 15, 83, 74, 62, 68, 50, 41, 61], [25, 28, 82, 35, 83, 53, 84, 39, 97, 59, 65, 1, 45, 19, 48, 49, 73, 14, 67, 30, 65, 69, 87, 6, 84, 46, 42, 72, 61, 31, 79, 26, 58, 33, 52, 32, 54, 1, 5, 22, 95, 5, 8, 70, 63, 10, 62], [40, 47, 80, 56, 28, 56, 1, 52, 82, 62, 42, 47, 37, 11, 67, 29, 4, 95, 11, 30, 79, 79, 58, 32, 29, 43, 92, 85, 39, 11, 96, 27, 24, 37, 65, 32, 53, 1, 56, 34, 82, 29, 6, 57, 95, 14, 75], [69, 62, 86, 51, 13, 76, 4, 38, 4, 30, 54, 65, 61, 49, 31, 42, 50, 23, 78, 99, 81, 60, 32, 56, 56, 87, 34, 41, 39, 86, 42, 66, 20, 14, 38, 37, 37, 12, 92, 56, 8, 93, 21, 39, 48, 18, 63]],41,) ] 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
SMALLEST_OF_THREE_INTEGERS_WITHOUT_COMPARISON_OPERATORS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SMALLEST_OF_THREE_INTEGERS_WITHOUT_COMPARISON_OPERATORS{ static int f_gold ( int x , int y , int z ) { int c = 0 ; while ( x != 0 && y != 0 && z != 0 ) { x -- ; y -- ; z -- ; c ++ ; } return c ; }
def f_gold ( x , y , z ) : c = 0 while ( x and y and z ) : x = x - 1 y = y - 1 z = z - 1 c = c + 1 return c
using namespace std; int f_gold ( int x, int y, int z ) { int c = 0; while ( x && y && z ) { x --; y --; z --; c ++; } return c; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(23); param0.add(87); param0.add(35); param0.add(25); param0.add(93); param0.add(52); param0.add(95); param0.add(91); param0.add(75); param0.add(96); List<Integer> param1 = new ArrayList<>(); param1.add(98); param1.add(55); param1.add(90); param1.add(9); param1.add(22); param1.add(42); param1.add(88); param1.add(64); param1.add(1); param1.add(44); List<Integer> param2 = new ArrayList<>(); param2.add(25); param2.add(94); param2.add(29); param2.add(41); param2.add(39); param2.add(96); param2.add(26); param2.add(51); param2.add(6); param2.add(76); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (23,98,25,), (87,55,94,), (35,90,29,), (25,9,41,), (93,22,39,), (52,42,96,), (95,88,26,), (91,64,51,), (75,1,6,), (96,44,76,) ] 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 {23,87,35,25,93,52,95,91,75,96}; vector<int> param1 {98,55,90,9,22,42,88,64,1,44}; vector<int> param2 {25,94,29,41,39,96,26,51,6,76}; 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; }
SMALLEST_SUM_CONTIGUOUS_SUBARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class SMALLEST_SUM_CONTIGUOUS_SUBARRAY{ static int f_gold ( int arr [ ] , int n ) { int min_ending_here = 2147483647 ; int min_so_far = 2147483647 ; for ( int i = 0 ; i < n ; i ++ ) { if ( min_ending_here > 0 ) min_ending_here = arr [ i ] ; else min_ending_here += arr [ i ] ; min_so_far = Math . min ( min_so_far , min_ending_here ) ; } return min_so_far ; }
import sys def f_gold ( arr , n ) : min_ending_here = sys.maxsize min_so_far = sys.maxsize for i in range ( n ) : if ( min_ending_here > 0 ) : min_ending_here = arr [ i ] else : min_ending_here += arr [ i ] min_so_far = min ( min_so_far , min_ending_here ) return min_so_far
using namespace std; int f_gold ( int arr [ ], int n ) { int min_ending_here = INT_MAX; int min_so_far = INT_MAX; for ( int i = 0; i < n; i ++ ) { if ( min_ending_here > 0 ) min_ending_here = arr [ i ]; else min_ending_here += arr [ i ]; min_so_far = min ( min_so_far, min_ending_here ); } return min_so_far; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,9,13,14,15,18,19,19,25,26,29,29,29,30,31,36,37,37,38,39,39,40,40,42,42,46,50,53,58,60,62,64,65,67,68,69,72,77,78,83,85,89,90,93,95,95,97}); param0.add(new int[]{14,-58,8,78,-26,-20,-60,42,-64,-12}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{44,88,20,47,69,42,26,49,71,91,18,95,9,66,60,37,47,29,98,63,15,9,80,66,1,9,57,56,20,2,1}); param0.add(new int[]{-78,-64,-62,-60,-52,4,8,46,72,74}); param0.add(new int[]{0,0,1,0,0,0,0,1,1,0,0,1,1,0,1,1}); param0.add(new int[]{3,7,16,17,23,23,23,28,29,30,34,38,40,41,43,43,44,46,51,51,51,55,57,58,61,62,66,66,67,69,70,73,75,77,79,80,85,85,87,87,93,96}); param0.add(new int[]{80,22,38,26,62,-48,-48,46,-54,4,76,46,48,40,-92,-98,-88,12,-42,-94,76,-16,-82,62,18,-24}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{85,44,1,97,50,74,62,90,3,78,8,48,96,41,36,91,57,97,85,90,78,43,28,92,85,59,29,38,34,65,20,26,27,23,71,22,47,99,68,93,67,66,69,82,98,15,44,51,65}); List<Integer> param1 = new ArrayList<>(); param1.add(24); param1.add(6); param1.add(8); param1.add(26); param1.add(8); param1.add(11); param1.add(38); param1.add(22); param1.add(13); param1.add(45); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([2, 9, 13, 14, 15, 18, 19, 19, 25, 26, 29, 29, 29, 30, 31, 36, 37, 37, 38, 39, 39, 40, 40, 42, 42, 46, 50, 53, 58, 60, 62, 64, 65, 67, 68, 69, 72, 77, 78, 83, 85, 89, 90, 93, 95, 95, 97],24,), ([14, -58, 8, 78, -26, -20, -60, 42, -64, -12],6,), ([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1],8,), ([44, 88, 20, 47, 69, 42, 26, 49, 71, 91, 18, 95, 9, 66, 60, 37, 47, 29, 98, 63, 15, 9, 80, 66, 1, 9, 57, 56, 20, 2, 1],26,), ([-78, -64, -62, -60, -52, 4, 8, 46, 72, 74],8,), ([0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1],11,), ([3, 7, 16, 17, 23, 23, 23, 28, 29, 30, 34, 38, 40, 41, 43, 43, 44, 46, 51, 51, 51, 55, 57, 58, 61, 62, 66, 66, 67, 69, 70, 73, 75, 77, 79, 80, 85, 85, 87, 87, 93, 96],38,), ([80, 22, 38, 26, 62, -48, -48, 46, -54, 4, 76, 46, 48, 40, -92, -98, -88, 12, -42, -94, 76, -16, -82, 62, 18, -24],22,), ([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],13,), ([85, 44, 1, 97, 50, 74, 62, 90, 3, 78, 8, 48, 96, 41, 36, 91, 57, 97, 85, 90, 78, 43, 28, 92, 85, 59, 29, 38, 34, 65, 20, 26, 27, 23, 71, 22, 47, 99, 68, 93, 67, 66, 69, 82, 98, 15, 44, 51, 65],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<vector<int>> param0 {{2,9,13,14,15,18,19,19,25,26,29,29,29,30,31,36,37,37,38,39,39,40,40,42,42,46,50,53,58,60,62,64,65,67,68,69,72,77,78,83,85,89,90,93,95,95,97},{14,-58,8,78,-26,-20,-60,42,-64,-12},{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},{44,88,20,47,69,42,26,49,71,91,18,95,9,66,60,37,47,29,98,63,15,9,80,66,1,9,57,56,20,2,1},{-78,-64,-62,-60,-52,4,8,46,72,74},{0,0,1,0,0,0,0,1,1,0,0,1,1,0,1,1},{3,7,16,17,23,23,23,28,29,30,34,38,40,41,43,43,44,46,51,51,51,55,57,58,61,62,66,66,67,69,70,73,75,77,79,80,85,85,87,87,93,96},{80,22,38,26,62,-48,-48,46,-54,4,76,46,48,40,-92,-98,-88,12,-42,-94,76,-16,-82,62,18,-24},{0,0,0,0,0,0,0,0,1,1,1,1,1,1},{85,44,1,97,50,74,62,90,3,78,8,48,96,41,36,91,57,97,85,90,78,43,28,92,85,59,29,38,34,65,20,26,27,23,71,22,47,99,68,93,67,66,69,82,98,15,44,51,65}}; vector<int> param1 {24,6,8,26,8,11,38,22,13,45}; 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; }
TRIANGULAR_NUMBERS_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class TRIANGULAR_NUMBERS_1{ static boolean f_gold ( int num ) { if ( num < 0 ) return false ; int c = ( - 2 * num ) ; int b = 1 , a = 1 ; int d = ( b * b ) - ( 4 * a * c ) ; if ( d < 0 ) return false ; float root1 = ( - b + ( float ) Math . sqrt ( d ) ) / ( 2 * a ) ; float root2 = ( - b - ( float ) Math . sqrt ( d ) ) / ( 2 * a ) ; if ( root1 > 0 && Math . floor ( root1 ) == root1 ) return true ; if ( root2 > 0 && Math . floor ( root2 ) == root2 ) return true ; return false ; }
import math def f_gold ( num ) : if ( num < 0 ) : return False c = ( - 2 * num ) b , a = 1 , 1 d = ( b * b ) - ( 4 * a * c ) if ( d < 0 ) : return False root1 = ( - b + math.sqrt ( d ) ) / ( 2 * a ) root2 = ( - b - math.sqrt ( d ) ) / ( 2 * a ) if ( root1 > 0 and math.floor ( root1 ) == root1 ) : return True if ( root2 > 0 and math.floor ( root2 ) == root2 ) : return True return False
using namespace std; bool f_gold ( int num ) { if ( num < 0 ) return false; int c = ( - 2 * num ); int b = 1, a = 1; int d = ( b * b ) - ( 4 * a * c ); if ( d < 0 ) return false; float root1 = ( - b + sqrt ( d ) ) / ( 2 * a ); float root2 = ( - b - sqrt ( d ) ) / ( 2 * a ); if ( root1 > 0 && floor ( root1 ) == root1 ) return true; if ( root2 > 0 && floor ( root2 ) == root2 ) return true; return false; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(1); param0.add(3); param0.add(6); param0.add(10); param0.add(55); param0.add(48); param0.add(63); param0.add(72); param0.add(16); param0.add(85); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (1,), (3,), (6,), (10,), (55,), (48,), (63,), (72,), (16,), (85,) ] 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 {1,3,6,10,55,48,63,72,16,85}; 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; }
CONVERTING_ONE_STRING_USING_APPEND_DELETE_LAST_OPERATIONS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CONVERTING_ONE_STRING_USING_APPEND_DELETE_LAST_OPERATIONS{ static boolean f_gold ( String str1 , String str2 , int k ) { if ( ( str1 . length ( ) + str2 . length ( ) ) < k ) return true ; int commonLength = 0 ; for ( int i = 0 ; i < Math . min ( str1 . length ( ) , str2 . length ( ) ) ; i ++ ) { if ( str1 == str2 ) commonLength ++ ; else break ; } if ( ( k - str1 . length ( ) - str2 . length ( ) + 2 * commonLength ) % 2 == 0 ) return true ; return false ; }
def f_gold(str1, str2, k): if ((len(str1) + len(str2)) < k): return True commonLength = 0 for i in range(0, min(len(str1), len(str2)), 1): if (str1[i] == str2[i]): commonLength += 1 else: break if ((k - len(str1) - len(str2) + 2 * commonLength) % 2 == 0): return True return False
using namespace std; bool f_gold ( string str1, string str2, int k ) { if ( ( str1 . length ( ) + str2 . length ( ) ) < k ) return true; int commonLength = 0; for ( int i = 0; i < min ( str1 . length ( ), str2 . length ( ) ); i ++ ) { if ( str1 [ i ] == str2 [ i ] ) commonLength ++; else break; } if ( ( k - str1 . length ( ) - str2 . length ( ) + 2 * commonLength ) % 2 == 0 ) return true; return false; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("ZNHGro"); param0.add("382880806774"); param0.add("0"); param0.add("lxHTRFCTSQ"); param0.add("6399914758"); param0.add("01100011100000"); param0.add("WkGqlob"); param0.add("46974006151"); param0.add("1001001"); param0.add("IJQ"); List<String> param1 = new ArrayList<>(); param1.add("jAdbtDUYQu"); param1.add("65565"); param1.add("00100010100"); param1.add("sViXYE"); param1.add("780990121"); param1.add("0100"); param1.add("NpQVdXzEtUZy"); param1.add("74438"); param1.add("1000010"); param1.add("nFOHAeYEAp"); List<Integer> param2 = new ArrayList<>(); param2.add(3); param2.add(10); param2.add(2); param2.add(89); param2.add(9); param2.add(0); param2.add(6); param2.add(11); param2.add(15); param2.add(42); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('ZNHGro', 'jAdbtDUYQu', 3,), ('382880806774', '65565', 10,), ('0', '00100010100', 2,), ('lxHTRFCTSQ', 'sViXYE', 89,), ('6399914758', '780990121', 9,), ('01100011100000', '0100', 0,), ('WkGqlob', 'NpQVdXzEtUZy', 6,), ('46974006151', '74438', 11,), ('1001001', '1000010', 15,), ('IJQ', 'nFOHAeYEAp', 42,) ] 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 {"ZNHGro","382880806774","0","lxHTRFCTSQ","6399914758","01100011100000","WkGqlob","46974006151","1001001","IJQ"}; vector<string> param1 {"jAdbtDUYQu","65565","00100010100","sViXYE","780990121","0100","NpQVdXzEtUZy","74438","1000010","nFOHAeYEAp"}; vector<int> param2 {3,10,2,89,9,0,6,11,15,42}; 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; }
FIND_THREE_ELEMENT_FROM_DIFFERENT_THREE_ARRAYS_SUCH_THAT_THAT_A_B_C_K_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_THREE_ELEMENT_FROM_DIFFERENT_THREE_ARRAYS_SUCH_THAT_THAT_A_B_C_K_1{ static boolean f_gold ( int a1 [ ] , int a2 [ ] , int a3 [ ] , int n1 , int n2 , int n3 , int sum ) { HashSet < Integer > s = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < n1 ; i ++ ) { s . add ( a1 [ i ] ) ; } ArrayList < Integer > al = new ArrayList < > ( s ) ; for ( int i = 0 ; i < n2 ; i ++ ) { for ( int j = 0 ; j < n3 ; j ++ ) { if ( al . contains ( sum - a2 [ i ] - a3 [ j ] ) & al . indexOf ( sum - a2 [ i ] - a3 [ j ] ) != al . get ( al . size ( ) - 1 ) ) { return true ; } } } return false ; }
def f_gold ( a1 , a2 , a3 , n1 , n2 , n3 , sum ) : s = set ( ) for i in range ( n1 ) : s.add ( a1 [ i ] ) for i in range ( n2 ) : for j in range ( n3 ) : if sum - a2 [ i ] - a3 [ j ] in s : return True return False
using namespace std; bool f_gold ( int a1 [ ], int a2 [ ], int a3 [ ], int n1, int n2, int n3, int sum ) { unordered_set < int > s; for ( int i = 0; i < n1; i ++ ) s . insert ( a1 [ i ] ); for ( int i = 0; i < n2; i ++ ) { for ( int j = 0; j < n3; j ++ ) { if ( s . find ( sum - a2 [ i ] - a3 [ j ] ) != s . end ( ) ) return true; } } return false; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{6,7,10,15,28,30,30,35,38,43,44,44,54,55,64,68,69,73,75,75,86,87,92,93,94}); param0.add(new int[]{-72,-90,-92,4,22,14,-50,16,-56,-66,62,-32,82,8,12,-24,92,-98,-94,56,-74,-66,26,-98,10,-74,-14,2,60,-88,-84,34,82,28,-86,-90,-92,52,72,90,92,-20,-86,74,-96,-46,28}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{85,34,78,64,22,94,52,71,44,48,46,88,59,95,4,55,21,83,56,19,85,6,87,13}); param0.add(new int[]{-98,-98,-96,-94,-90,-90,-84,-36,-34,-34,-32,16,26,26,56,74,80}); param0.add(new int[]{1,1,1,0,0,0,1,1,1,1}); param0.add(new int[]{4,4,25,27,35,39,50,60,60,63,67,73,75,81,84,85,91,98}); param0.add(new int[]{54,-64,76,78,24,40,44,-56,80,-10,-12,-8,-18,42,70,14,-70,48,-68,-98,-74,-40,-16,-90,48,92,-64,58,-98,60,-10,-10}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{28,88,75,86,51,82,2,20,22,18,96,11}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{11,17,18,24,26,26,33,35,38,41,55,60,63,63,69,73,78,81,82,87,90,91,93,94,99}); param1.add(new int[]{50,-20,26,32,-46,38,36,0,-96,60,-70,-36,-12,50,64,-70,22,-22,32,60,-94,98,-58,-86,-16,40,-68,2,-50,6,-36,-28,-68,44,-98,-38,-46,68,4,60,-36,28,-38,4,50,-84,-12}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{58,45,14,13,73,82,34,78,83,84,39,34,65,84,84,61,26,67,48,51,41,46,89,10}); param1.add(new int[]{-92,-70,-70,-56,-54,-48,-38,-14,-10,0,4,30,34,70,72,76,78}); param1.add(new int[]{0,0,1,0,0,1,0,1,0,1}); param1.add(new int[]{20,21,23,25,37,41,51,57,62,66,74,77,77,79,80,87,88,95}); param1.add(new int[]{88,-66,-50,74,-44,-32,-58,-24,-40,62,52,88,-48,-2,-46,38,30,-56,76,56,60,52,-32,36,90,92,-74,88,-36,-14,-16,-14}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{62,54,79,88,27,13,48,94,86,28,86,60}); List<int [ ]> param2 = new ArrayList<>(); param2.add(new int[]{3,3,8,22,24,24,28,30,32,32,34,39,40,45,46,50,54,59,75,78,79,90,95,95,97}); param2.add(new int[]{-28,20,-62,-84,14,10,28,-10,94,-2,52,66,38,-50,48,-88,-28,92,-48,86,4,-16,26,26,-82,44,70,72,-6,-98,80,56,38,42,-20,64,36,80,12,4,-50,54,22,98,-30,-52,4}); param2.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param2.add(new int[]{46,1,2,90,31,49,62,10,28,4,48,84,87,51,88,74,99,15,35,24,32,66,10,66}); param2.add(new int[]{-92,-88,-70,-56,-50,-50,-48,-36,-20,-10,-8,2,16,22,48,70,78}); param2.add(new int[]{1,1,1,1,0,1,1,1,0,1}); param2.add(new int[]{2,3,9,10,10,18,24,40,41,47,68,69,70,86,90,95,96,98}); param2.add(new int[]{38,-96,16,38,-48,-22,-52,-78,42,94,-26,-20,12,-10,72,16,-8,-2,-36,-76,-6,-92,10,34,-76,-54,-20,20,-76,-46,24,44}); param2.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param2.add(new int[]{49,14,18,61,94,54,12,56,97,59,85,44}); List<Integer> param3 = new ArrayList<>(); param3.add(21); param3.add(41); param3.add(26); param3.add(15); param3.add(15); param3.add(5); param3.add(12); param3.add(23); param3.add(38); param3.add(6); List<Integer> param4 = new ArrayList<>(); param4.add(16); param4.add(42); param4.add(20); param4.add(16); param4.add(10); param4.add(7); param4.add(17); param4.add(18); param4.add(22); param4.add(6); List<Integer> param5 = new ArrayList<>(); param5.add(17); param5.add(34); param5.add(30); param5.add(23); param5.add(15); param5.add(9); param5.add(13); param5.add(29); param5.add(40); param5.add(8); List<Integer> param6 = new ArrayList<>(); param6.add(18); param6.add(32); param6.add(16); param6.add(15); param6.add(15); param6.add(6); param6.add(9); param6.add(19); param6.add(32); param6.add(9); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i),param4.get(i),param5.get(i),param6.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i),param4.get(i),param5.get(i),param6.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([6, 7, 10, 15, 28, 30, 30, 35, 38, 43, 44, 44, 54, 55, 64, 68, 69, 73, 75, 75, 86, 87, 92, 93, 94],[11, 17, 18, 24, 26, 26, 33, 35, 38, 41, 55, 60, 63, 63, 69, 73, 78, 81, 82, 87, 90, 91, 93, 94, 99],[3, 3, 8, 22, 24, 24, 28, 30, 32, 32, 34, 39, 40, 45, 46, 50, 54, 59, 75, 78, 79, 90, 95, 95, 97],21,16,17,18,), ([-72, -90, -92, 4, 22, 14, -50, 16, -56, -66, 62, -32, 82, 8, 12, -24, 92, -98, -94, 56, -74, -66, 26, -98, 10, -74, -14, 2, 60, -88, -84, 34, 82, 28, -86, -90, -92, 52, 72, 90, 92, -20, -86, 74, -96, -46, 28],[50, -20, 26, 32, -46, 38, 36, 0, -96, 60, -70, -36, -12, 50, 64, -70, 22, -22, 32, 60, -94, 98, -58, -86, -16, 40, -68, 2, -50, 6, -36, -28, -68, 44, -98, -38, -46, 68, 4, 60, -36, 28, -38, 4, 50, -84, -12],[-28, 20, -62, -84, 14, 10, 28, -10, 94, -2, 52, 66, 38, -50, 48, -88, -28, 92, -48, 86, 4, -16, 26, 26, -82, 44, 70, 72, -6, -98, 80, 56, 38, 42, -20, 64, 36, 80, 12, 4, -50, 54, 22, 98, -30, -52, 4],41,42,34,32,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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],[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],26,20,30,16,), ([85, 34, 78, 64, 22, 94, 52, 71, 44, 48, 46, 88, 59, 95, 4, 55, 21, 83, 56, 19, 85, 6, 87, 13],[58, 45, 14, 13, 73, 82, 34, 78, 83, 84, 39, 34, 65, 84, 84, 61, 26, 67, 48, 51, 41, 46, 89, 10],[46, 1, 2, 90, 31, 49, 62, 10, 28, 4, 48, 84, 87, 51, 88, 74, 99, 15, 35, 24, 32, 66, 10, 66],15,16,23,15,), ([-98, -98, -96, -94, -90, -90, -84, -36, -34, -34, -32, 16, 26, 26, 56, 74, 80],[-92, -70, -70, -56, -54, -48, -38, -14, -10, 0, 4, 30, 34, 70, 72, 76, 78],[-92, -88, -70, -56, -50, -50, -48, -36, -20, -10, -8, 2, 16, 22, 48, 70, 78],15,10,15,15,), ([1, 1, 1, 0, 0, 0, 1, 1, 1, 1],[0, 0, 1, 0, 0, 1, 0, 1, 0, 1],[1, 1, 1, 1, 0, 1, 1, 1, 0, 1],5,7,9,6,), ([4, 4, 25, 27, 35, 39, 50, 60, 60, 63, 67, 73, 75, 81, 84, 85, 91, 98],[20, 21, 23, 25, 37, 41, 51, 57, 62, 66, 74, 77, 77, 79, 80, 87, 88, 95],[2, 3, 9, 10, 10, 18, 24, 40, 41, 47, 68, 69, 70, 86, 90, 95, 96, 98],12,17,13,9,), ([54, -64, 76, 78, 24, 40, 44, -56, 80, -10, -12, -8, -18, 42, 70, 14, -70, 48, -68, -98, -74, -40, -16, -90, 48, 92, -64, 58, -98, 60, -10, -10],[88, -66, -50, 74, -44, -32, -58, -24, -40, 62, 52, 88, -48, -2, -46, 38, 30, -56, 76, 56, 60, 52, -32, 36, 90, 92, -74, 88, -36, -14, -16, -14],[38, -96, 16, 38, -48, -22, -52, -78, 42, 94, -26, -20, 12, -10, 72, 16, -8, -2, -36, -76, -6, -92, 10, 34, -76, -54, -20, 20, -76, -46, 24, 44],23,18,29,19,), ([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],[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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],38,22,40,32,), ([28, 88, 75, 86, 51, 82, 2, 20, 22, 18, 96, 11],[62, 54, 79, 88, 27, 13, 48, 94, 86, 28, 86, 60],[49, 14, 18, 61, 94, 54, 12, 56, 97, 59, 85, 44],6,6,8,9,) ] 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 {{6,7,10,15,28,30,30,35,38,43,44,44,54,55,64,68,69,73,75,75,86,87,92,93,94},{-72,-90,-92,4,22,14,-50,16,-56,-66,62,-32,82,8,12,-24,92,-98,-94,56,-74,-66,26,-98,10,-74,-14,2,60,-88,-84,34,82,28,-86,-90,-92,52,72,90,92,-20,-86,74,-96,-46,28},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1},{85,34,78,64,22,94,52,71,44,48,46,88,59,95,4,55,21,83,56,19,85,6,87,13},{-98,-98,-96,-94,-90,-90,-84,-36,-34,-34,-32,16,26,26,56,74,80},{1,1,1,0,0,0,1,1,1,1},{4,4,25,27,35,39,50,60,60,63,67,73,75,81,84,85,91,98},{54,-64,76,78,24,40,44,-56,80,-10,-12,-8,-18,42,70,14,-70,48,-68,-98,-74,-40,-16,-90,48,92,-64,58,-98,60,-10,-10},{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},{28,88,75,86,51,82,2,20,22,18,96,11}}; vector<vector<int>> param1 {{11,17,18,24,26,26,33,35,38,41,55,60,63,63,69,73,78,81,82,87,90,91,93,94,99},{50,-20,26,32,-46,38,36,0,-96,60,-70,-36,-12,50,64,-70,22,-22,32,60,-94,98,-58,-86,-16,40,-68,2,-50,6,-36,-28,-68,44,-98,-38,-46,68,4,60,-36,28,-38,4,50,-84,-12},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{58,45,14,13,73,82,34,78,83,84,39,34,65,84,84,61,26,67,48,51,41,46,89,10},{-92,-70,-70,-56,-54,-48,-38,-14,-10,0,4,30,34,70,72,76,78},{0,0,1,0,0,1,0,1,0,1},{20,21,23,25,37,41,51,57,62,66,74,77,77,79,80,87,88,95},{88,-66,-50,74,-44,-32,-58,-24,-40,62,52,88,-48,-2,-46,38,30,-56,76,56,60,52,-32,36,90,92,-74,88,-36,-14,-16,-14},{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},{62,54,79,88,27,13,48,94,86,28,86,60}}; vector<vector<int>> param2 {{3,3,8,22,24,24,28,30,32,32,34,39,40,45,46,50,54,59,75,78,79,90,95,95,97},{-28,20,-62,-84,14,10,28,-10,94,-2,52,66,38,-50,48,-88,-28,92,-48,86,4,-16,26,26,-82,44,70,72,-6,-98,80,56,38,42,-20,64,36,80,12,4,-50,54,22,98,-30,-52,4},{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},{46,1,2,90,31,49,62,10,28,4,48,84,87,51,88,74,99,15,35,24,32,66,10,66},{-92,-88,-70,-56,-50,-50,-48,-36,-20,-10,-8,2,16,22,48,70,78},{1,1,1,1,0,1,1,1,0,1},{2,3,9,10,10,18,24,40,41,47,68,69,70,86,90,95,96,98},{38,-96,16,38,-48,-22,-52,-78,42,94,-26,-20,12,-10,72,16,-8,-2,-36,-76,-6,-92,10,34,-76,-54,-20,20,-76,-46,24,44},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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},{49,14,18,61,94,54,12,56,97,59,85,44}}; vector<int> param3 {21,41,26,15,15,5,12,23,38,6}; vector<int> param4 {16,42,20,16,10,7,17,18,22,6}; vector<int> param5 {17,34,30,23,15,9,13,29,40,8}; vector<int> param6 {18,32,16,15,15,6,9,19,32,9}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(&param0[i].front(),&param1[i].front(),&param2[i].front(),param3[i],param4[i],param5[i],param6[i]) == f_gold(&param0[i].front(),&param1[i].front(),&param2[i].front(),param3[i],param4[i],param5[i],param6[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
HOW_TO_PRINT_MAXIMUM_NUMBER_OF_A_USING_GIVEN_FOUR_KEYS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class HOW_TO_PRINT_MAXIMUM_NUMBER_OF_A_USING_GIVEN_FOUR_KEYS{ static int f_gold ( int N ) { if ( N <= 6 ) return N ; int [ ] screen = new int [ N ] ; int b ; int n ; for ( n = 1 ; n <= 6 ; n ++ ) screen [ n - 1 ] = n ; for ( n = 7 ; n <= N ; n ++ ) { screen [ n - 1 ] = Math . max ( 2 * screen [ n - 4 ] , Math . max ( 3 * screen [ n - 5 ] , 4 * screen [ n - 6 ] ) ) ; } return screen [ N - 1 ] ; }
def f_gold ( N ) : if ( N <= 6 ) : return N screen = [ 0 ] * N for n in range ( 1 , 7 ) : screen [ n - 1 ] = n for n in range ( 7 , N + 1 ) : screen [ n - 1 ] = max ( 2 * screen [ n - 4 ] , max ( 3 * screen [ n - 5 ] , 4 * screen [ n - 6 ] ) ) ; return screen [ N - 1 ]
using namespace std; int f_gold ( int N ) { if ( N <= 6 ) return N; int screen [ N ]; int b; int n; for ( n = 1; n <= 6; n ++ ) screen [ n - 1 ] = n; for ( n = 7; n <= N; n ++ ) { screen [ n - 1 ] = max ( 2 * screen [ n - 4 ], max ( 3 * screen [ n - 5 ], 4 * screen [ n - 6 ] ) ); } return screen [ N - 1 ]; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(41); param0.add(94); param0.add(80); param0.add(40); param0.add(76); param0.add(5); param0.add(43); param0.add(67); param0.add(24); param0.add(90); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (41,), (94,), (80,), (40,), (76,), (5,), (43,), (67,), (24,), (90,) ] 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 {41,94,80,40,76,5,43,67,24,90}; 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_DISTINCT_NON_NEGATIVE_PAIRS_X_Y_SATISFY_INEQUALITY_XX_YY_N_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_DISTINCT_NON_NEGATIVE_PAIRS_X_Y_SATISFY_INEQUALITY_XX_YY_N_2{ static int f_gold ( int n ) { int res = 0 ; for ( int x = 0 ; x * x < n ; x ++ ) for ( int y = 0 ; x * x + y * y < n ; y ++ ) res ++ ; return res ; }
def f_gold ( n ) : res = 0 x = 0 while ( x * x < n ) : y = 0 while ( x * x + y * y < n ) : res = res + 1 y = y + 1 x = x + 1 return res
using namespace std; int f_gold ( int n ) { int res = 0; for ( int x = 0; x * x < n; x ++ ) for ( int y = 0; x * x + y * y < n; y ++ ) res ++; return res; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(61); param0.add(45); param0.add(53); param0.add(4); param0.add(82); param0.add(86); param0.add(37); param0.add(48); param0.add(81); param0.add(50); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (61,), (45,), (53,), (4,), (82,), (86,), (37,), (48,), (81,), (50,) ] 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 {61,45,53,4,82,86,37,48,81,50}; 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; }
HIGHWAY_BILLBOARD_PROBLEM
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class HIGHWAY_BILLBOARD_PROBLEM{ static int f_gold ( int m , int [ ] x , int [ ] revenue , int n , int t ) { int [ ] maxRev = new int [ m + 1 ] ; for ( int i = 0 ; i < m + 1 ; i ++ ) maxRev [ i ] = 0 ; int nxtbb = 0 ; for ( int i = 1 ; i <= m ; i ++ ) { if ( nxtbb < n ) { if ( x [ nxtbb ] != i ) maxRev [ i ] = maxRev [ i - 1 ] ; else { if ( i <= t ) maxRev [ i ] = Math . max ( maxRev [ i - 1 ] , revenue [ nxtbb ] ) ; else maxRev [ i ] = Math . max ( maxRev [ i - t - 1 ] + revenue [ nxtbb ] , maxRev [ i - 1 ] ) ; nxtbb ++ ; } } else maxRev [ i ] = maxRev [ i - 1 ] ; } return maxRev [ m ] ; }
def f_gold ( m , x , revenue , n , t ) : maxRev = [ 0 ] * ( m + 1 ) nxtbb = 0 ; for i in range ( 1 , m + 1 ) : if ( nxtbb < n ) : if ( x [ nxtbb ] != i ) : maxRev [ i ] = maxRev [ i - 1 ] else : if ( i <= t ) : maxRev [ i ] = max ( maxRev [ i - 1 ] , revenue [ nxtbb ] ) else : maxRev [ i ] = max ( maxRev [ i - t - 1 ] + revenue [ nxtbb ] , maxRev [ i - 1 ] ) ; nxtbb += 1 else : maxRev [ i ] = maxRev [ i - 1 ] return maxRev [ m ]
using namespace std; int f_gold ( int m, int x [ ], int revenue [ ], int n, int t ) { int maxRev [ m + 1 ]; memset ( maxRev, 0, sizeof ( maxRev ) ); int nxtbb = 0; for ( int i = 1; i <= m; i ++ ) { if ( nxtbb < n ) { if ( x [ nxtbb ] != i ) maxRev [ i ] = maxRev [ i - 1 ]; else { if ( i <= t ) maxRev [ i ] = max ( maxRev [ i - 1 ], revenue [ nxtbb ] ); else maxRev [ i ] = max ( maxRev [ i - t - 1 ] + revenue [ nxtbb ], maxRev [ i - 1 ] ); nxtbb ++; } } else maxRev [ i ] = maxRev [ i - 1 ]; } return maxRev [ m ]; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(16); param0.add(39); param0.add(5); param0.add(10); param0.add(14); param0.add(32); param0.add(2); param0.add(22); param0.add(15); param0.add(8); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{6,15,15,18,23,29,32,36,37,39,40,41,44,49,51,52,53,57,66,68,82,89,96}); param1.add(new int[]{76,60,88,46,-20,-78,-22,54,-18,92,-42,-66,-90,-72,-48,22,-72,-42,-46,94,82,-78,14,86,10,-64,-78,66,78,-36,50,-20,-40,-12,10,-46,56,-18,4,-76,-64,74,22,34,4,-2}); param1.add(new int[]{0,0,0,1,1,1,1,1,1,1}); param1.add(new int[]{21,69,30,10,71,72,71,78,30,9,72,10,7,87,30,46,56,74,73,60,86}); param1.add(new int[]{-76,-76,-66,-64,-62,-60,-52,-48,-42,-28,-14,-6,-6,16,20,20,38,46,58,60,70,72,86,98}); param1.add(new int[]{1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,0,1,1,1,0,1,0,1,1,0,1,0,1}); param1.add(new int[]{16,38,72,82}); param1.add(new int[]{28,-76,42,-2,30,-10,52,66,26,96,96,-72,26,-86,-30,-78,32,-32,58,12,-72,8,34,-68,-28,-66}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{95,12,65,97,92,49,94,32,37,97,9,35}); List<int [ ]> param2 = new ArrayList<>(); param2.add(new int[]{1,2,5,5,24,26,31,32,33,41,57,59,71,75,79,87,87,88,92,94,96,96,99}); param2.add(new int[]{28,8,-60,84,68,-54,-56,0,-68,-84,-6,92,-80,-24,86,-6,-44,82,74,90,-46,40,62,50,-42,38,78,94,46,-14,-48,66,70,52,10,-88,54,-10,98,34,16,-2,-62,-56,-40,86}); param2.add(new int[]{0,0,0,0,0,0,0,1,1,1}); param2.add(new int[]{72,45,7,30,76,35,75,72,4,7,55,56,7,52,48,27,11,76,66,48,33}); param2.add(new int[]{-90,-82,-78,-76,-74,-52,-48,-44,-44,-40,-38,-14,-6,10,20,38,38,40,44,48,52,54,76,78}); param2.add(new int[]{0,1,0,1,0,0,0,1,0,0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1}); param2.add(new int[]{15,34,56,74}); param2.add(new int[]{68,-38,34,20,40,78,52,80,58,-12,-18,10,40,34,20,-32,-8,-46,8,62,94,-30,-94,26,-40,64}); param2.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param2.add(new int[]{25,32,14,49,90,37,92,1,8,75,50,9}); List<Integer> param3 = new ArrayList<>(); param3.add(12); param3.add(25); param3.add(9); param3.add(18); param3.add(15); param3.add(28); param3.add(2); param3.add(13); param3.add(25); param3.add(9); List<Integer> param4 = new ArrayList<>(); param4.add(12); param4.add(27); param4.add(6); param4.add(20); param4.add(17); param4.add(36); param4.add(3); param4.add(16); param4.add(15); param4.add(8); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i),param4.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i),param4.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (16,[6, 15, 15, 18, 23, 29, 32, 36, 37, 39, 40, 41, 44, 49, 51, 52, 53, 57, 66, 68, 82, 89, 96],[1, 2, 5, 5, 24, 26, 31, 32, 33, 41, 57, 59, 71, 75, 79, 87, 87, 88, 92, 94, 96, 96, 99],12,12,), (39,[76, 60, 88, 46, -20, -78, -22, 54, -18, 92, -42, -66, -90, -72, -48, 22, -72, -42, -46, 94, 82, -78, 14, 86, 10, -64, -78, 66, 78, -36, 50, -20, -40, -12, 10, -46, 56, -18, 4, -76, -64, 74, 22, 34, 4, -2],[28, 8, -60, 84, 68, -54, -56, 0, -68, -84, -6, 92, -80, -24, 86, -6, -44, 82, 74, 90, -46, 40, 62, 50, -42, 38, 78, 94, 46, -14, -48, 66, 70, 52, 10, -88, 54, -10, 98, 34, 16, -2, -62, -56, -40, 86],25,27,), (5,[0, 0, 0, 1, 1, 1, 1, 1, 1, 1],[0, 0, 0, 0, 0, 0, 0, 1, 1, 1],9,6,), (10,[21, 69, 30, 10, 71, 72, 71, 78, 30, 9, 72, 10, 7, 87, 30, 46, 56, 74, 73, 60, 86],[72, 45, 7, 30, 76, 35, 75, 72, 4, 7, 55, 56, 7, 52, 48, 27, 11, 76, 66, 48, 33],18,20,), (14,[-76, -76, -66, -64, -62, -60, -52, -48, -42, -28, -14, -6, -6, 16, 20, 20, 38, 46, 58, 60, 70, 72, 86, 98],[-90, -82, -78, -76, -74, -52, -48, -44, -44, -40, -38, -14, -6, 10, 20, 38, 38, 40, 44, 48, 52, 54, 76, 78],15,17,), (32,[1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],[0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1],28,36,), (2,[16, 38, 72, 82],[15, 34, 56, 74],2,3,), (22,[28, -76, 42, -2, 30, -10, 52, 66, 26, 96, 96, -72, 26, -86, -30, -78, 32, -32, 58, 12, -72, 8, 34, -68, -28, -66],[68, -38, 34, 20, 40, 78, 52, 80, 58, -12, -18, 10, 40, 34, 20, -32, -8, -46, 8, 62, 94, -30, -94, 26, -40, 64],13,16,), (15,[0, 0, 0, 0, 0, 0, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],25,15,), (8,[95, 12, 65, 97, 92, 49, 94, 32, 37, 97, 9, 35],[25, 32, 14, 49, 90, 37, 92, 1, 8, 75, 50, 9],9,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<int> param0 {16,39,5,10,14,32,2,22,15,8}; vector<vector<int>> param1 {{6,15,15,18,23,29,32,36,37,39,40,41,44,49,51,52,53,57,66,68,82,89,96},{76,60,88,46,-20,-78,-22,54,-18,92,-42,-66,-90,-72,-48,22,-72,-42,-46,94,82,-78,14,86,10,-64,-78,66,78,-36,50,-20,-40,-12,10,-46,56,-18,4,-76,-64,74,22,34,4,-2},{0,0,0,1,1,1,1,1,1,1},{21,69,30,10,71,72,71,78,30,9,72,10,7,87,30,46,56,74,73,60,86},{-76,-76,-66,-64,-62,-60,-52,-48,-42,-28,-14,-6,-6,16,20,20,38,46,58,60,70,72,86,98},{1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,0,1,1,1,0,1,0,1,1,0,1,0,1},{16,38,72,82},{28,-76,42,-2,30,-10,52,66,26,96,96,-72,26,-86,-30,-78,32,-32,58,12,-72,8,34,-68,-28,-66},{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{95,12,65,97,92,49,94,32,37,97,9,35}}; vector<vector<int>> param2 {{1,2,5,5,24,26,31,32,33,41,57,59,71,75,79,87,87,88,92,94,96,96,99},{28,8,-60,84,68,-54,-56,0,-68,-84,-6,92,-80,-24,86,-6,-44,82,74,90,-46,40,62,50,-42,38,78,94,46,-14,-48,66,70,52,10,-88,54,-10,98,34,16,-2,-62,-56,-40,86},{0,0,0,0,0,0,0,1,1,1},{72,45,7,30,76,35,75,72,4,7,55,56,7,52,48,27,11,76,66,48,33},{-90,-82,-78,-76,-74,-52,-48,-44,-44,-40,-38,-14,-6,10,20,38,38,40,44,48,52,54,76,78},{0,1,0,1,0,0,0,1,0,0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1},{15,34,56,74},{68,-38,34,20,40,78,52,80,58,-12,-18,10,40,34,20,-32,-8,-46,8,62,94,-30,-94,26,-40,64},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{25,32,14,49,90,37,92,1,8,75,50,9}}; vector<int> param3 {12,25,9,18,15,28,2,13,25,9}; vector<int> param4 {12,27,6,20,17,36,3,16,15,8}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],&param1[i].front(),&param2[i].front(),param3[i],param4[i]) == f_gold(param0[i],&param1[i].front(),&param2[i].front(),param3[i],param4[i])) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
COUNT_OF_OCCURRENCES_OF_A_101_PATTERN_IN_A_STRING
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_OF_OCCURRENCES_OF_A_101_PATTERN_IN_A_STRING{ static int f_gold ( String str ) { int len = str . length ( ) ; boolean oneSeen = false ; int count = 0 ; for ( int i = 0 ; i < len ; i ++ ) { char getChar = str . charAt ( i ) ; if ( getChar == '1' && oneSeen == true ) { if ( str . charAt ( i - 1 ) == '0' ) count ++ ; } if ( getChar == '1' && oneSeen == false ) oneSeen = true ; if ( getChar != '0' && str . charAt ( i ) != '1' ) oneSeen = false ; } return count ; }
def f_gold ( s ) : length = len ( s ) oneSeen = False count = 0 for i in range ( length ) : if ( s [ i ] == '1' and oneSeen ) : if ( s [ i - 1 ] == '0' ) : count += 1 if ( s [ i ] == '1' and oneSeen == 0 ) : oneSeen = True if ( s [ i ] != '0' and s [ i ] != '1' ) : oneSeen = False return count
using namespace std; int f_gold ( string str ) { int len = str . size ( ); bool oneSeen = 0; int count = 0; for ( int i = 0; i < len; i ++ ) { if ( str [ i ] == '1' && oneSeen == 1 ) if ( str [ i - 1 ] == '0' ) count ++; if ( str [ i ] == '1' && oneSeen == 0 ) { oneSeen = 1; continue; } if ( str [ i ] != '0' && str [ i ] != '1' ) oneSeen = 0; } return count; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("1001ab010abc01001"); param0.add("1001010001"); param0.add("010100010100"); param0.add("DLCu"); param0.add("7072430592"); param0.add("011"); param0.add("pnJpypYOza"); param0.add("1037"); param0.add("111"); param0.add("HxK"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('1001ab010abc01001',), ('1001010001',), ('010100010100',), ('DLCu',), ('7072430592',), ('011',), ('pnJpypYOza',), ('1037',), ('111',), ('HxK',) ] 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 {"1001ab010abc01001","1001010001","010100010100","DLCu","7072430592","011","pnJpypYOza","1037","111","HxK"}; 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_INTEGER_OVERFLOW_MULTIPLICATION
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_INTEGER_OVERFLOW_MULTIPLICATION{ static Boolean f_gold ( long a , long b ) { if ( a == 0 || b == 0 ) return false ; long result = a * b ; if ( a == result / b ) return false ; else return true ; }
def f_gold ( a , b ) : if ( a == 0 or b == 0 ) : return False result = a * b if ( result >= 9223372036854775807 or result <= - 9223372036854775808 ) : result = 0 if ( a == ( result // b ) ) : print ( result // b ) return False else : return True
using namespace std; bool f_gold ( long long a, long long b ) { if ( a == 0 || b == 0 ) return false; long long result = a * b; if ( a == result / b ) return false; else return true; }
public static void main(String args[]) { int n_success = 0; List<Long> param0 = new ArrayList<>(); param0.add(37L); param0.add(Long.parseLong("10000000000")); param0.add(Long.parseLong("10000000000")); param0.add(Long.parseLong("999999999")); param0.add(39L); param0.add(92L); param0.add(14L); param0.add(19L); param0.add(14L); param0.add(88L); List<Long> param1 = new ArrayList<>(); param1.add(80L); param1.add(Long.parseLong("-10000000000")); param1.add(Long.parseLong("10000000000")); param1.add(Long.parseLong("999999999")); param1.add(36L); param1.add(56L); param1.add(21L); param1.add(38L); param1.add(82L); param1.add(41L); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)).equals(f_gold(param0.get(i),param1.get(i)))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (37,80,), (10000000000,-10000000000,), (10000000000,10000000000,), (999999999,999999999,), (39,36,), (92,56,), (14,21,), (19,38,), (14,82,), (88,41,) ] 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 {37,10000000000,10000000000,999999999,39,92,14,19,14,88}; vector<long> param1 {80,-10000000000,10000000000,999999999,36,56,21,38,82,41}; 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; }
CHANGE_BITS_CAN_MADE_ONE_FLIP_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHANGE_BITS_CAN_MADE_ONE_FLIP_1{ static boolean f_gold ( String str ) { int sum = 0 ; int n = str . length ( ) ; for ( int i = 0 ; i < n ; i ++ ) sum += str . charAt ( i ) - '0' ; return ( sum == n - 1 || sum == 1 ) ; }
null
using namespace std; bool f_gold ( string str ) { int sum = 0; int n = str . length ( ); for ( int i = 0; i < n; i ++ ) sum += str [ i ] - '0'; return ( sum == n - 1 || sum == 1 ); }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("00001"); param0.add("0000"); param0.add("11"); param0.add("111110"); param0.add("1"); param0.add("111010111010"); param0.add("hUInqJXNdbfP"); param0.add("5191"); param0.add("1110101101"); param0.add("NupSrU xz"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<string> param0 {"00001","0000","11","111110","1","111010111010","hUInqJXNdbfP","5191","1110101101","NupSrU xz"}; 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; }
CENTER_ELEMENT_OF_MATRIX_EQUALS_SUMS_OF_HALF_DIAGONALS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CENTER_ELEMENT_OF_MATRIX_EQUALS_SUMS_OF_HALF_DIAGONALS{ static boolean f_gold ( int mat [ ] [ ] , int n ) { int diag1_left = 0 , diag1_right = 0 ; int diag2_left = 0 , diag2_right = 0 ; for ( int i = 0 , j = n - 1 ; i < n ; i ++ , j -- ) { if ( i < n / 2 ) { diag1_left += mat [ i ] [ i ] ; diag2_left += mat [ j ] [ i ] ; } else if ( i > n / 2 ) { diag1_right += mat [ i ] [ i ] ; diag2_right += mat [ j ] [ i ] ; } } return ( diag1_left == diag2_right && diag2_right == diag2_left && diag1_right == diag2_left && diag2_right == mat [ n / 2 ] [ n / 2 ] ) ; }
def f_gold ( mat , n ) : diag1_left = 0 diag1_right = 0 diag2_left = 0 diag2_right = 0 i = 0 j = n - 1 while i < n : if ( i < n // 2 ) : diag1_left += mat [ i ] [ i ] diag2_left += mat [ j ] [ i ] elif ( i > n // 2 ) : diag1_right += mat [ i ] [ i ] diag2_right += mat [ j ] [ i ] i += 1 j -= 1 return ( diag1_left == diag2_right and diag2_right == diag2_left and diag1_right == diag2_left and diag2_right == mat [ n // 2 ] [ n // 2 ] )
null
public static void main(String args[]) { int n_success = 0; List<int [ ] [ ]> param0 = new ArrayList<>(); param0.add(new int[][]{ new int[]{ 2, 9, 1, 4, -2}, new int[]{ 6, 7, 2, 11, 4}, new int[]{ 4, 2, 9, 2, 4}, new int[]{ 1, 9, 2, 4, 4}, new int[]{ 0, 2, 4, 2, 5} }); param0.add(new int[][]{ new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82}}); param0.add(new int[][]{new int[]{52,88,22,69,1,83,30,39,79,35,69,70,89,11,51,63,86,34,55,78,73,20,80,58,81,17,34,75,99,62,34,72,19,97,87,66,72,93,42,51,71,49,29,95},new int[]{30,99,25,68,62,38,17,74,1,18,63,46,19,50,96,54,31,97,86,65,46,35,49,81,34,29,6,1,55,27,12,4,80,52,11,52,84,26,28,72,66,90,27,97},new int[]{55,71,54,46,36,21,49,34,87,34,40,7,90,52,49,81,95,89,37,62,15,2,11,96,94,17,88,45,68,61,46,32,19,67,4,25,73,21,87,93,94,89,93,98},new int[]{14,22,48,51,80,11,59,14,7,69,58,40,93,81,94,25,78,42,86,44,5,28,76,60,77,21,96,49,56,57,85,61,38,73,2,3,43,74,35,73,40,96,85,58},new int[]{34,25,56,32,22,89,65,21,80,96,21,28,19,14,87,24,20,32,74,52,65,95,52,58,79,95,92,10,70,15,47,91,10,21,19,68,22,63,38,15,70,75,44,30},new int[]{24,86,94,46,4,6,38,26,19,2,68,69,47,99,29,64,80,12,85,73,11,8,60,26,32,39,4,98,92,89,44,99,83,35,51,51,29,78,85,36,78,60,15,51},new int[]{50,94,55,12,50,62,5,27,79,90,9,35,13,44,46,97,98,68,77,74,53,1,11,50,9,38,87,13,5,25,10,5,22,42,89,20,28,21,11,93,69,37,49,69},new int[]{33,45,8,6,15,15,9,61,56,5,26,87,80,57,35,10,91,80,21,12,9,16,73,93,54,23,39,88,22,55,31,74,47,27,98,48,39,88,21,15,81,45,19,53},new int[]{89,55,86,49,78,61,60,92,76,91,24,86,39,61,23,72,92,93,79,39,72,92,97,11,42,25,34,22,2,51,16,11,78,96,86,69,87,62,19,29,42,23,60,73},new int[]{18,95,81,55,18,27,85,1,96,14,59,78,33,36,39,76,45,25,15,20,34,58,60,78,30,13,78,93,90,67,89,91,45,40,80,38,75,93,47,88,29,34,11,20},new int[]{20,73,56,23,91,88,25,89,33,31,74,79,1,54,16,85,59,66,3,15,32,50,91,99,60,88,8,7,4,94,10,60,25,42,47,96,96,32,74,73,25,89,16,49},new int[]{16,94,38,5,7,77,8,33,62,74,84,32,93,1,91,20,55,63,78,79,6,52,2,93,39,32,51,69,86,92,32,93,3,62,95,13,70,21,61,14,89,71,22,32},new int[]{41,32,42,52,94,81,54,62,85,90,43,3,38,81,39,70,85,45,46,13,52,9,57,69,43,7,44,44,95,68,77,44,79,40,77,43,62,43,90,19,49,65,77,25},new int[]{84,41,23,58,88,43,40,30,34,10,60,1,12,46,93,75,17,84,58,38,6,62,84,74,10,95,26,58,17,53,78,5,67,20,51,46,79,67,3,23,9,11,47,49},new int[]{44,13,8,63,22,38,27,26,23,95,93,65,74,47,61,46,4,31,4,29,73,79,44,3,59,79,53,11,6,47,7,68,85,1,56,87,77,43,28,29,18,87,92,73},new int[]{62,6,16,1,22,46,62,23,21,51,95,38,28,44,91,39,42,42,60,57,77,96,7,51,97,77,32,7,76,40,15,59,85,12,77,42,39,63,2,29,61,29,38,7},new int[]{30,87,92,56,87,36,42,93,4,84,5,46,75,2,54,88,59,33,22,47,6,24,93,49,96,94,51,41,67,89,92,79,81,2,91,78,43,32,12,23,16,44,2,7},new int[]{21,58,95,23,60,25,35,99,45,7,69,32,53,69,25,95,84,86,77,2,86,61,9,51,2,45,32,72,80,97,75,32,8,96,85,89,20,65,21,7,89,9,86,2},new int[]{19,60,70,59,69,45,62,10,65,26,90,60,18,59,21,46,12,78,32,39,99,81,55,55,10,35,80,6,68,62,9,29,71,80,6,44,64,67,44,78,14,9,23,57},new int[]{57,15,64,7,20,64,19,6,51,39,65,71,99,25,23,89,58,11,34,31,38,46,12,9,13,64,20,59,85,22,65,60,41,81,45,4,70,45,58,83,94,23,32,63},new int[]{93,8,85,81,81,85,79,91,25,33,66,16,55,36,72,80,7,69,87,8,3,35,36,79,30,15,93,68,98,87,58,99,28,95,42,97,18,5,9,84,9,18,56,15},new int[]{79,78,62,35,40,51,60,56,84,75,41,54,17,25,93,87,9,56,89,23,2,45,65,38,6,48,44,79,7,66,62,30,93,76,52,98,94,36,35,66,50,3,76,4},new int[]{55,52,59,71,20,19,8,67,27,79,8,18,29,46,36,3,9,10,84,66,1,91,4,48,96,18,78,45,15,51,61,4,19,88,94,77,11,28,57,75,54,65,47,4},new int[]{34,76,54,88,61,96,83,93,93,83,20,3,40,69,23,69,94,32,24,51,58,42,35,32,54,45,48,86,85,92,49,34,16,11,97,19,92,29,54,53,67,82,82,76},new int[]{82,32,83,56,63,4,11,3,27,80,44,18,30,88,70,47,34,76,42,23,40,15,80,57,14,79,12,35,25,78,2,18,35,9,11,90,67,69,96,74,38,70,75,81},new int[]{59,66,41,24,50,5,21,6,4,9,69,68,9,18,59,43,80,66,29,48,51,42,36,76,45,98,35,6,37,36,84,16,72,22,69,69,63,75,19,81,18,73,17,41},new int[]{33,84,55,82,24,77,40,28,67,75,39,21,37,2,6,52,5,47,43,96,40,11,81,14,2,39,63,63,18,97,94,79,93,90,1,17,54,39,48,66,15,22,20,93},new int[]{89,43,56,24,98,43,21,48,66,16,40,21,52,8,78,55,86,82,58,5,42,30,95,9,95,95,41,51,57,73,61,6,26,74,6,53,61,33,45,94,40,24,92,45},new int[]{38,29,79,8,64,87,73,51,75,6,47,49,76,98,85,32,54,36,89,99,98,19,37,17,80,16,58,44,68,49,94,51,98,5,97,58,46,55,73,17,12,24,56,55},new int[]{76,79,16,87,82,22,44,95,43,79,21,8,49,6,81,47,36,92,23,31,75,62,84,96,81,57,70,65,37,68,95,75,17,7,52,35,2,40,37,57,10,76,81,46},new int[]{90,5,5,27,5,61,8,31,97,21,99,21,51,79,59,2,30,58,92,81,20,40,29,5,89,10,83,61,1,47,98,57,14,25,90,21,16,74,32,45,64,84,73,60},new int[]{98,95,19,47,95,64,30,47,88,33,82,21,95,63,42,61,43,68,26,33,33,49,84,41,72,36,72,95,22,47,83,20,87,24,43,88,73,16,27,45,37,13,51,2},new int[]{76,97,87,59,14,49,30,98,9,79,24,41,60,89,32,47,21,42,70,89,2,31,56,30,63,15,18,32,14,62,82,99,52,22,14,78,34,86,80,56,53,49,63,16},new int[]{80,40,38,18,23,48,82,46,22,54,40,30,55,56,42,42,62,82,53,82,53,64,1,79,69,27,17,63,41,58,57,96,38,90,66,92,45,23,20,36,42,22,60,11},new int[]{28,45,22,81,63,31,11,36,78,35,23,29,23,16,84,89,19,90,96,63,50,85,73,43,19,85,18,6,35,14,64,9,35,2,6,99,25,73,50,95,7,63,28,2},new int[]{65,59,24,62,99,71,38,93,62,65,51,94,52,96,74,98,63,11,48,54,91,50,74,38,86,88,8,6,68,69,6,32,38,57,84,64,54,14,64,50,47,54,19,75},new int[]{39,65,99,83,60,33,32,36,24,43,71,71,46,47,69,14,45,52,90,50,65,77,64,23,84,71,70,59,73,92,74,54,99,71,89,94,26,44,76,13,54,40,4,53},new int[]{1,6,55,66,91,18,29,53,33,3,20,4,82,8,86,86,83,28,66,73,99,86,26,34,71,94,49,89,49,73,27,65,33,72,49,63,32,19,50,22,90,67,9,35},new int[]{71,79,4,37,28,9,35,25,9,61,52,97,17,76,9,54,5,63,47,90,19,99,66,45,71,73,86,33,80,43,88,72,94,26,45,35,81,53,10,41,17,71,66,11},new int[]{63,67,46,20,13,87,17,93,32,99,99,98,85,16,23,11,14,67,71,45,75,33,83,45,54,51,87,23,29,6,39,5,96,40,90,78,82,21,59,89,20,24,3,86},new int[]{72,57,93,71,70,70,76,63,86,47,90,89,19,99,13,89,45,32,30,85,42,72,42,7,3,37,3,18,42,9,57,24,7,97,89,42,98,58,85,56,58,18,39,50},new int[]{33,28,56,25,14,55,84,84,7,4,95,30,62,57,37,55,85,65,52,3,77,7,70,70,34,96,16,8,21,11,50,87,6,15,11,27,79,45,38,4,78,45,10,54},new int[]{29,12,56,40,84,37,66,20,12,38,30,47,82,74,71,42,5,48,93,99,51,12,10,37,66,67,14,47,20,52,68,26,47,79,73,3,2,41,30,37,81,3,9,8},new int[]{9,17,24,72,14,54,80,18,88,39,47,27,92,71,98,91,34,19,6,30,92,12,15,39,64,64,15,58,67,1,7,9,1,5,47,10,2,23,93,56,19,38,47,84}}); param0.add(new int[][]{new int[]{99,52,49,71,23,50,17,48,2,69,62},new int[]{85,13,61,11,88,97,27,35,18,85,68},new int[]{61,41,96,43,49,11,67,51,52,85,43},new int[]{58,78,70,29,31,28,50,36,92,19,67},new int[]{12,88,76,24,65,92,80,21,94,98,26},new int[]{35,95,80,58,42,29,29,9,78,72,2},new int[]{75,2,18,69,57,71,23,19,19,58,83},new int[]{49,45,28,75,50,11,55,9,14,98,93},new int[]{21,48,58,69,97,9,67,78,18,12,87},new int[]{78,16,37,20,20,15,25,17,12,42,39},new int[]{56,53,71,72,88,47,25,85,50,33,74}}); param0.add(new int[][]{new int[]{29,3,39,4,37,95,6,92,10,12,66,3,65,64,35,24,47,52,34},new int[]{84,80,94,25,69,29,92,64,53,58,41,87,96,51,18,41,99,61,24},new int[]{47,28,36,21,56,69,26,54,87,44,33,26,22,20,2,41,54,57,18},new int[]{5,96,46,75,21,22,3,9,2,28,34,53,59,10,83,93,2,48,6},new int[]{44,54,71,36,8,83,10,33,91,93,19,18,51,23,1,59,3,10,71},new int[]{49,56,90,16,39,96,76,44,8,8,45,11,97,25,17,95,83,55,79},new int[]{56,44,53,35,39,2,98,25,38,68,80,32,79,78,41,79,71,7,72},new int[]{83,18,17,82,83,77,59,11,51,7,27,59,37,5,62,72,74,90,79},new int[]{55,16,93,92,74,56,51,68,46,61,78,33,55,18,12,74,21,97,78},new int[]{73,26,79,21,22,55,46,41,5,44,16,35,5,62,90,26,61,51,69},new int[]{56,50,36,24,79,30,69,48,22,33,69,96,50,23,10,36,17,53,91},new int[]{8,44,61,6,71,90,81,37,54,23,91,57,51,58,19,27,89,25,21},new int[]{25,51,71,35,70,50,15,24,49,68,7,94,81,54,38,94,45,9,55},new int[]{83,52,77,49,55,83,70,76,79,3,68,38,70,49,92,8,95,85,45},new int[]{29,79,49,24,21,23,95,98,28,32,22,62,67,73,6,65,22,51,68},new int[]{57,72,55,42,52,61,19,1,41,63,88,48,81,32,50,14,17,96,97},new int[]{30,51,98,92,62,24,63,14,34,59,65,86,33,58,18,12,74,66,2},new int[]{70,84,28,42,3,48,89,87,13,57,88,3,63,38,59,28,26,84,91},new int[]{65,74,74,61,57,1,32,32,27,13,17,28,89,52,36,47,66,32,32}}); param0.add(new int[][]{new int[]{55,73,80,89,40,28,81,31,87,31,26,4,58,79,23,69,60,43,89,94,26,67,68,55,47,82,59,75,75,16,58},new int[]{89,1,90,45,94,6,91,52,19,43,19,39,32,65,89,47,13,74,82,36,86,70,27,72,24,20,86,9,39,83,1},new int[]{11,74,1,91,81,44,51,17,66,23,41,59,74,94,99,25,17,19,82,82,46,35,74,23,86,44,9,32,90,93,59},new int[]{42,62,19,93,35,76,8,89,91,43,45,6,13,11,70,69,7,55,55,19,6,89,9,20,25,50,72,50,38,66,57},new int[]{22,56,36,51,68,1,48,33,24,49,69,58,48,57,64,99,53,60,90,43,41,26,59,49,64,5,44,18,57,89,40},new int[]{46,58,85,24,28,46,68,72,54,33,67,84,35,39,47,71,91,5,37,1,86,56,7,64,8,94,64,57,28,26,34},new int[]{96,22,20,14,23,67,19,78,39,37,99,1,19,15,89,1,31,52,43,46,86,50,20,62,43,5,79,66,12,57,60},new int[]{55,71,66,72,73,27,28,37,79,19,94,51,13,45,6,94,1,25,99,26,13,19,10,45,71,15,87,31,8,30,98},new int[]{97,1,16,11,27,86,40,83,44,70,57,48,40,39,84,3,55,1,23,67,62,34,17,48,91,53,61,87,11,15,90},new int[]{11,7,47,8,5,81,87,66,91,63,21,71,90,94,12,11,54,81,10,16,15,58,79,84,4,96,22,35,14,94,31},new int[]{74,70,91,11,36,74,80,24,85,40,42,87,21,96,81,51,81,55,85,4,62,87,25,96,70,14,41,57,38,62,41},new int[]{45,80,96,16,19,37,85,79,61,26,94,79,64,13,91,87,34,98,23,20,54,73,58,59,20,39,78,90,91,98,93},new int[]{32,41,69,68,87,21,97,24,16,32,83,26,3,99,82,7,96,88,16,53,88,4,45,32,98,83,78,58,13,22,95},new int[]{44,44,30,23,12,14,36,45,72,24,3,78,51,75,55,38,92,87,82,20,97,2,26,2,67,84,74,42,85,40,9},new int[]{2,28,3,16,4,23,94,77,6,74,55,81,8,73,98,81,86,64,67,41,40,93,27,39,53,40,52,37,67,19,34},new int[]{78,85,66,10,52,42,60,81,2,91,1,50,36,97,22,99,98,82,36,3,44,16,11,10,51,42,85,25,99,6,44},new int[]{8,34,41,1,3,52,91,77,43,47,83,19,70,47,78,5,64,45,64,45,36,9,23,32,93,45,28,52,11,19,64},new int[]{65,73,57,66,4,29,4,1,92,18,13,70,49,47,86,30,27,72,28,2,20,75,78,24,77,72,44,21,22,73,58},new int[]{11,80,53,9,67,52,13,1,44,75,24,5,66,81,81,20,64,15,68,54,11,23,1,42,47,68,38,2,45,27,98},new int[]{77,61,82,11,69,29,25,78,54,48,46,41,41,61,11,44,32,49,6,57,6,47,63,49,22,67,19,55,34,41,7},new int[]{57,16,59,38,9,77,34,46,37,43,47,6,38,61,4,5,70,60,77,88,92,77,56,82,59,7,68,31,88,86,85},new int[]{48,42,90,30,51,35,62,51,87,50,30,19,96,50,54,83,86,4,12,15,15,10,61,19,53,72,57,95,9,29,7},new int[]{72,17,79,16,71,83,38,89,76,96,47,10,24,50,68,43,37,45,54,43,68,37,89,41,94,1,93,16,37,37,7},new int[]{40,51,64,97,22,43,62,54,27,29,16,85,11,21,9,27,86,79,23,51,93,80,3,16,8,90,42,73,35,71,72},new int[]{99,48,54,36,6,71,12,59,65,50,43,43,49,89,76,55,91,87,83,85,50,21,88,13,42,15,50,1,51,34,42},new int[]{62,95,32,61,93,54,74,58,85,24,27,21,18,55,68,47,54,18,73,64,49,94,35,94,39,58,57,6,78,93,96},new int[]{78,20,50,9,76,14,23,48,98,80,82,56,40,97,69,39,74,86,43,97,31,70,3,4,27,89,27,47,60,36,46},new int[]{61,42,7,30,50,47,93,40,5,70,58,44,71,32,79,77,82,74,40,57,11,40,47,2,91,52,72,49,59,38,16},new int[]{88,87,78,27,74,28,89,66,45,33,60,50,46,35,41,58,77,55,5,5,22,34,65,59,17,51,49,9,74,15,29},new int[]{53,25,85,81,91,28,23,3,33,71,69,90,17,81,67,67,34,8,45,60,56,70,22,33,50,71,83,46,52,74,87},new int[]{66,21,24,48,13,64,5,18,75,37,54,32,28,86,45,28,65,70,75,42,33,16,13,21,59,47,39,88,43,27,37}}); param0.add(new int[][]{new int[]{76,7,58},new int[]{20,79,65},new int[]{74,14,79}}); param0.add(new int[][]{new int[]{89,95,74,37,6,6,28,78,13,13,10,80,39,99,79,23,37,8,90,60,86,5,98,27,19,43,43,35,84,55,61,47,77,56,82,18,65,96,53,89,85,91,11,1,83,96,8,19,55},new int[]{16,99,66,12,93,74,62,86,98,58,21,37,5,70,32,67,10,69,88,84,62,37,95,47,81,49,24,82,26,55,7,78,41,2,30,81,20,56,74,24,12,91,15,73,82,48,61,71,28},new int[]{3,16,36,4,99,9,12,74,44,66,19,13,55,97,65,92,70,3,25,52,16,43,56,68,8,80,44,38,23,6,43,44,80,80,23,16,76,9,82,9,85,58,65,59,23,69,19,35,97},new int[]{55,82,40,14,84,13,53,80,95,39,99,84,65,56,40,46,77,7,45,22,7,84,52,68,70,67,3,58,67,54,9,54,80,51,16,12,20,53,31,94,21,3,21,92,28,5,71,69,73},new int[]{47,85,20,38,37,58,17,42,92,95,97,32,62,96,87,21,89,33,67,6,92,66,32,64,26,62,5,11,74,79,82,49,78,92,94,62,60,77,84,2,89,59,76,25,68,42,76,71,55},new int[]{38,96,43,70,53,91,99,21,20,19,33,63,68,60,19,28,22,51,88,63,62,94,29,74,32,73,25,16,15,59,48,18,23,55,42,3,71,52,11,55,88,99,25,92,76,87,81,41,37},new int[]{82,55,9,99,36,57,63,82,20,85,47,20,6,73,93,29,77,91,49,6,39,32,49,43,28,45,65,50,54,51,43,64,95,30,82,93,42,38,87,86,66,69,15,61,96,6,78,24,85},new int[]{14,12,55,68,44,85,81,93,51,80,82,38,41,44,75,96,92,16,98,50,94,38,86,5,9,77,39,87,27,32,64,95,33,90,18,76,67,5,78,59,76,4,16,75,48,66,77,8,44},new int[]{21,26,35,15,40,30,66,80,13,1,43,28,1,40,34,13,61,66,4,89,98,13,36,96,61,58,85,90,15,93,90,85,12,76,69,61,42,90,32,2,8,91,54,8,88,13,29,13,58},new int[]{63,87,47,79,88,87,74,38,69,69,95,40,1,2,29,7,93,57,55,73,36,7,92,10,80,74,39,58,90,98,98,40,14,82,1,17,49,86,16,7,15,21,66,59,48,89,73,84,50},new int[]{10,52,85,68,30,34,94,78,86,65,60,8,75,65,69,57,45,49,74,62,39,77,21,53,45,97,28,53,9,75,93,71,61,27,22,95,30,92,84,15,15,53,76,81,23,70,16,91,87},new int[]{65,45,7,45,39,50,49,48,49,40,39,57,82,63,56,86,2,26,96,23,18,83,88,68,60,2,94,49,38,31,40,80,53,64,33,58,50,64,3,61,82,10,66,51,94,30,25,43,88},new int[]{64,59,62,99,10,64,94,60,90,99,88,20,49,99,74,27,51,57,79,79,37,99,3,29,68,47,80,69,21,42,21,2,78,69,7,75,35,30,44,46,55,1,54,80,1,63,55,86,77},new int[]{27,15,81,9,69,59,23,11,24,72,98,54,31,22,14,5,17,82,83,71,90,89,82,44,79,93,49,65,4,9,36,51,32,88,18,15,20,58,40,66,89,13,91,13,62,28,46,15,93},new int[]{85,44,95,23,67,99,78,66,50,13,2,76,91,34,40,69,61,25,75,77,63,28,85,56,26,27,26,15,50,6,68,4,30,77,9,42,14,92,40,3,41,93,33,79,60,64,62,79,7},new int[]{76,50,39,71,47,70,26,58,73,51,88,52,94,16,48,27,33,23,45,83,83,22,42,33,10,47,96,79,39,46,72,51,25,82,15,58,59,26,41,44,85,22,98,37,14,4,24,66,63},new int[]{65,66,13,27,81,17,69,88,57,72,73,18,16,51,96,40,39,56,54,44,46,32,48,61,66,38,43,4,5,58,37,26,9,15,88,88,99,89,26,63,87,70,27,54,83,31,32,2,18},new int[]{28,71,87,88,92,25,39,49,4,52,83,68,57,13,65,63,98,71,25,23,30,61,7,54,17,97,60,66,38,13,52,52,32,86,9,17,82,40,91,75,54,54,28,72,50,18,13,33,15},new int[]{86,38,94,6,45,59,98,83,97,78,48,41,83,79,74,55,61,2,2,85,76,10,76,39,2,65,66,87,92,81,52,85,44,34,73,81,45,32,5,78,89,86,63,69,54,38,9,61,95},new int[]{21,36,1,22,87,87,15,46,65,6,40,35,81,61,23,20,28,37,82,7,49,84,24,80,13,92,7,15,87,23,95,69,91,60,10,51,64,71,56,32,23,54,73,93,91,85,70,90,84},new int[]{61,79,20,53,15,29,70,80,65,62,70,16,54,97,7,60,10,53,8,85,90,37,82,4,84,83,97,23,9,38,45,45,18,46,2,48,17,16,45,48,24,95,65,92,33,4,1,33,74},new int[]{62,3,45,21,64,73,57,40,62,43,88,46,72,24,24,10,99,68,57,44,73,75,48,77,27,30,46,12,60,19,68,54,34,87,90,7,82,42,68,53,8,22,26,77,63,46,81,44,62},new int[]{36,41,79,82,27,70,98,41,5,57,76,29,12,25,34,75,87,24,82,63,63,10,5,95,89,53,81,28,65,45,66,49,40,66,91,8,27,17,68,44,31,5,60,89,92,19,42,23,77},new int[]{17,94,58,87,49,3,77,96,45,35,2,47,3,29,74,20,34,79,40,65,90,63,56,32,66,96,41,29,84,87,51,12,44,10,83,74,83,90,88,9,29,29,92,61,64,3,87,4,55},new int[]{14,77,28,63,39,64,60,20,28,96,14,77,75,58,39,58,15,73,3,5,92,42,15,3,35,7,94,24,31,78,80,4,3,99,9,68,83,88,60,11,79,36,95,72,2,50,3,67,85},new int[]{62,76,14,23,77,16,81,18,13,56,90,45,40,31,81,32,1,35,36,83,92,66,29,43,29,43,19,64,92,98,31,19,96,29,73,7,58,76,60,51,95,82,92,50,21,9,34,34,47},new int[]{24,80,28,46,51,99,6,63,53,64,52,60,41,11,4,14,13,15,8,88,11,99,89,23,7,69,32,92,44,3,94,44,69,51,61,51,33,20,30,44,86,86,29,21,82,53,11,10,35},new int[]{26,44,4,74,57,39,80,41,94,67,98,89,36,4,74,13,70,7,28,59,37,15,30,74,12,81,30,1,36,88,21,32,63,82,13,37,44,21,18,46,47,26,5,5,31,28,77,75,65},new int[]{88,13,18,24,29,28,45,86,84,11,51,59,84,13,47,88,43,24,48,63,17,69,54,94,14,15,73,78,10,22,95,13,81,65,14,44,39,35,65,27,45,57,22,34,9,50,54,58,96},new int[]{62,38,84,27,64,3,11,24,29,69,97,8,19,68,99,94,69,48,40,67,16,64,8,5,99,72,25,53,49,72,21,51,46,9,64,96,77,23,60,59,8,64,99,54,92,15,52,93,51},new int[]{4,34,24,21,2,7,56,75,76,68,35,26,18,64,56,80,55,12,37,52,19,15,86,84,52,77,87,95,26,45,96,21,81,93,53,29,48,86,19,54,78,87,2,32,62,97,7,98,68},new int[]{87,84,22,29,3,22,84,89,98,53,93,57,10,40,20,87,11,8,93,36,25,39,98,96,62,87,21,19,25,87,83,5,83,99,12,25,5,76,27,4,83,45,47,88,28,97,35,16,12},new int[]{80,75,43,28,87,81,19,75,68,74,55,83,36,62,39,41,60,86,66,59,97,40,91,19,55,46,4,83,62,25,63,70,13,86,4,2,67,30,4,48,43,93,45,97,13,47,96,28,37},new int[]{28,27,89,30,6,94,9,6,29,87,70,86,66,95,53,70,5,20,12,8,58,49,64,50,97,39,40,31,3,83,72,30,95,29,70,56,66,87,63,30,53,46,9,7,63,47,44,49,79},new int[]{79,85,62,59,78,75,75,84,13,30,84,43,51,8,37,97,90,64,39,8,62,82,39,14,52,82,57,21,23,4,74,43,11,84,19,65,95,2,49,69,34,4,91,39,49,3,26,41,65},new int[]{16,58,35,83,16,33,31,22,61,84,64,70,35,39,3,96,13,14,41,8,19,14,75,50,99,61,36,67,89,77,80,92,45,91,74,82,72,7,22,9,60,42,59,40,29,55,64,42,29},new int[]{92,21,97,63,63,90,38,79,66,12,33,79,1,97,68,28,62,78,59,49,45,76,6,20,85,16,12,52,20,58,45,97,2,34,26,33,42,94,65,8,65,10,32,51,57,40,66,31,63},new int[]{68,56,12,31,23,33,8,62,80,15,41,52,26,78,12,27,95,68,30,4,54,95,34,68,84,56,18,47,72,60,59,2,73,16,86,58,12,5,39,15,72,88,19,82,85,49,39,78,15},new int[]{55,67,56,45,75,57,67,94,6,70,31,22,85,38,58,70,29,56,11,48,86,60,51,39,6,30,89,1,86,9,45,8,34,80,83,8,12,43,56,31,42,33,19,91,88,92,55,4,12},new int[]{87,84,28,58,48,1,75,44,63,95,38,9,6,70,52,67,96,99,16,2,36,71,35,30,45,46,93,65,1,57,71,67,31,25,47,56,88,1,95,37,75,67,12,20,30,74,64,79,85},new int[]{64,18,32,19,94,33,62,22,29,88,4,50,76,4,5,83,39,57,31,7,12,10,29,85,13,87,70,31,9,51,88,16,59,58,11,36,1,21,44,37,6,14,93,1,8,44,83,87,75},new int[]{27,36,42,20,8,46,52,26,35,60,3,4,93,62,64,50,92,19,43,92,82,14,14,54,29,3,98,73,5,93,5,45,64,64,43,43,51,13,90,73,68,95,69,7,92,78,88,42,5},new int[]{47,48,98,92,47,8,21,88,24,13,15,89,53,92,72,31,71,51,47,39,81,57,50,57,35,86,7,53,10,92,39,58,93,35,59,22,9,8,94,94,58,95,22,95,40,28,46,69,81},new int[]{52,11,22,47,89,13,45,75,69,78,22,67,35,32,38,58,40,88,92,21,49,97,92,39,61,10,40,58,89,45,17,68,10,62,89,32,72,42,45,76,21,27,30,74,85,1,9,3,53},new int[]{42,19,6,7,43,80,36,68,82,96,96,82,39,43,37,28,50,39,2,37,66,19,69,44,13,22,7,2,62,78,89,90,5,20,54,76,63,36,95,81,16,57,64,10,99,97,99,51,27},new int[]{7,91,41,76,97,13,66,3,11,5,60,2,92,77,99,64,13,54,12,18,18,17,39,86,13,45,19,88,19,21,24,30,92,48,35,59,17,48,98,55,9,77,14,26,52,85,44,84,11},new int[]{51,42,62,35,64,95,18,14,49,69,17,21,14,3,31,89,47,44,17,90,81,56,83,27,71,90,69,2,80,62,75,87,99,6,65,97,18,55,67,57,19,74,84,11,96,84,55,96,37},new int[]{86,4,13,70,93,58,2,60,89,32,63,60,26,90,22,74,87,4,16,63,42,33,13,46,13,33,14,8,90,86,46,1,59,60,49,80,93,61,23,5,85,50,36,20,43,8,90,41,25},new int[]{7,86,61,33,69,38,12,44,53,14,71,92,52,52,46,80,41,2,49,95,78,28,32,92,76,77,22,42,29,94,79,68,33,46,9,38,80,26,43,53,27,11,26,78,57,1,11,30,88}}); param0.add(new int[][]{new int[]{4,86,72,80,33,33,74,66,4,87,51,27,33,97,84,77,75,83,32,67,77,28,86,57,19,31,84,53,88,32,9,51,83,23,25,97,46,44,66,67,28,99,78,24,56,50,3,23,34},new int[]{9,82,59,66,22,35,31,90,78,48,53,92,75,32,85,87,88,12,62,3,6,12,53,20,6,84,14,56,41,49,65,84,86,95,31,28,12,16,97,35,44,68,10,98,3,31,52,95,65},new int[]{5,5,66,15,65,21,71,11,90,42,66,94,61,60,14,5,31,48,32,57,34,74,95,27,82,5,17,75,69,56,38,54,48,85,88,94,80,49,41,22,57,66,19,2,75,33,73,59,89},new int[]{6,11,27,72,45,31,91,63,44,41,47,69,79,2,15,95,20,3,39,74,90,10,40,13,85,98,44,32,73,30,1,53,76,44,35,88,40,45,60,63,10,47,24,57,18,57,72,46,43},new int[]{77,16,14,9,73,69,61,11,19,64,38,10,16,93,69,82,42,44,53,35,36,22,24,76,12,35,50,83,78,87,40,22,47,75,66,10,43,69,94,85,97,25,47,7,28,80,45,67,83},new int[]{12,83,11,3,61,66,56,26,86,81,34,55,79,76,16,80,39,6,72,52,25,56,83,19,76,73,93,27,5,26,30,78,97,35,75,53,68,33,70,28,74,36,49,90,94,86,53,69,2},new int[]{97,80,71,64,21,35,46,86,48,22,6,33,39,43,25,18,41,35,24,55,40,87,97,29,10,79,10,90,64,29,98,18,2,25,85,51,95,22,9,91,89,89,91,74,94,4,21,30,33},new int[]{43,90,2,87,31,4,47,84,89,45,65,66,6,7,51,68,18,41,69,25,56,1,98,55,3,54,81,32,88,2,65,98,8,58,53,44,73,28,19,56,20,71,56,35,19,81,63,82,7},new int[]{27,39,30,23,84,23,90,47,78,48,95,91,63,9,23,63,74,47,87,74,66,37,38,1,48,82,35,71,86,53,25,42,23,9,27,75,51,91,92,57,82,36,34,13,55,46,52,94,28},new int[]{86,88,30,45,38,20,70,97,47,59,79,79,96,14,42,61,59,8,57,22,84,88,21,28,49,23,88,54,23,68,46,68,94,28,95,97,50,83,63,10,89,37,13,70,30,87,80,72,80},new int[]{11,1,86,18,11,84,10,48,61,10,60,22,75,99,9,15,83,37,70,44,69,3,10,77,4,56,40,33,98,33,60,21,69,45,57,77,40,81,64,10,74,66,85,65,30,82,35,53,39},new int[]{22,67,70,80,67,75,17,19,60,72,78,90,89,51,48,57,10,32,79,68,28,4,61,77,12,15,29,87,13,38,58,35,40,76,94,5,2,30,99,10,73,81,38,59,94,35,71,12,42},new int[]{98,49,67,33,13,75,20,95,33,34,50,50,9,7,9,26,2,5,66,10,31,33,6,14,78,15,97,95,81,43,79,20,21,64,29,59,73,64,93,44,34,47,9,60,30,17,52,59,4},new int[]{40,96,96,7,38,32,69,67,56,20,64,17,16,11,13,18,14,34,76,86,85,26,42,61,39,2,57,50,16,62,98,11,83,63,30,54,71,27,86,64,81,79,9,76,72,2,49,48,55},new int[]{80,67,31,26,66,30,77,78,1,96,70,22,75,87,54,14,14,84,71,19,26,59,22,6,63,77,74,54,19,95,10,37,77,17,55,5,21,39,20,71,15,79,53,87,33,44,66,50,32},new int[]{79,71,73,55,28,86,3,53,42,2,22,25,89,32,7,62,31,63,37,68,97,79,9,70,46,95,34,60,13,36,96,86,48,93,75,6,5,65,50,74,74,24,7,86,58,21,86,33,44},new int[]{25,95,80,15,29,83,52,17,90,36,35,40,23,73,34,58,82,80,61,96,28,60,32,58,82,44,34,93,21,1,55,80,49,97,21,99,55,27,20,95,16,78,48,32,32,53,53,2,57},new int[]{22,52,81,96,81,58,34,71,93,17,88,72,23,33,29,19,69,37,87,26,24,54,21,97,90,10,42,29,57,35,28,12,58,44,7,16,84,93,35,92,7,86,14,59,62,74,66,22,16},new int[]{99,75,43,97,98,97,83,20,10,19,12,10,71,56,11,80,97,61,38,17,54,45,25,31,65,39,20,73,43,66,1,55,51,5,12,14,60,96,40,9,42,42,33,25,78,9,91,44,83},new int[]{58,25,32,22,93,55,92,61,57,77,61,92,67,94,75,2,57,73,33,90,63,16,89,1,85,64,84,69,17,40,1,13,18,68,14,5,62,33,26,61,68,30,62,62,81,92,70,57,91},new int[]{36,7,65,74,77,41,32,14,33,30,73,6,10,75,20,89,12,22,76,14,48,54,36,61,55,14,2,2,61,6,25,67,23,73,95,28,25,99,65,66,79,43,40,80,23,49,99,8,7},new int[]{21,35,97,99,82,61,83,74,68,30,97,68,9,17,43,88,57,13,57,26,61,62,19,81,30,90,13,49,82,85,98,51,9,94,29,93,83,8,81,76,15,69,34,52,50,67,5,98,9},new int[]{88,5,27,84,47,62,45,66,23,98,61,93,43,35,30,67,10,56,34,65,6,70,43,16,63,65,5,25,27,42,55,26,16,90,28,92,30,77,89,45,19,13,75,23,14,74,98,23,40},new int[]{64,85,59,20,32,78,24,46,18,94,92,48,14,54,21,98,5,31,67,87,59,44,64,94,42,94,38,7,59,69,70,49,78,11,2,95,27,16,64,66,49,90,16,73,52,73,5,36,7},new int[]{61,96,29,67,30,40,31,48,91,6,62,29,9,54,84,11,19,74,5,87,70,95,18,21,15,59,95,74,6,24,97,60,28,92,74,23,79,46,37,14,48,78,71,36,82,60,54,79,63},new int[]{97,48,22,43,41,17,63,90,79,18,72,3,54,14,34,97,1,48,99,10,83,11,99,66,3,15,59,64,47,92,2,30,38,5,6,5,12,4,24,25,26,55,46,46,43,60,33,21,87},new int[]{37,12,21,13,33,70,76,61,30,37,82,16,45,71,1,53,28,53,44,67,39,10,51,14,79,6,39,80,82,99,48,25,97,33,83,75,67,65,40,25,57,32,46,4,23,80,75,22,33},new int[]{41,62,38,56,63,77,85,76,55,51,90,65,57,86,27,57,55,96,72,98,82,4,65,56,53,44,16,94,23,31,28,50,16,41,9,2,43,66,96,80,77,49,91,95,97,21,19,57,77},new int[]{60,19,99,64,35,33,67,85,87,48,60,45,75,68,68,15,92,72,88,98,15,23,60,91,14,2,99,43,71,16,86,28,32,71,86,2,72,7,38,48,85,86,99,82,73,2,42,42,81},new int[]{20,6,11,69,74,87,97,40,36,51,47,98,17,26,53,48,27,46,67,19,72,81,65,71,36,67,83,42,91,67,98,69,49,37,46,80,56,63,78,30,96,63,76,91,26,93,23,86,20},new int[]{46,80,31,67,21,51,39,63,69,20,23,96,42,73,3,27,91,74,80,24,87,9,2,6,99,71,79,21,87,29,13,69,42,1,20,43,1,99,40,7,35,52,34,50,69,29,91,71,1},new int[]{73,58,65,91,17,62,96,94,79,42,28,3,92,5,66,54,38,80,44,81,76,90,57,71,24,80,82,59,8,91,90,95,82,2,41,87,56,48,22,97,18,79,41,67,48,23,2,4,26},new int[]{19,49,74,86,53,6,62,1,16,52,7,88,35,78,68,15,57,23,83,78,91,86,11,4,58,96,40,58,88,98,67,38,2,87,40,84,56,72,35,49,67,96,95,44,31,65,76,18,88},new int[]{36,62,29,89,23,3,30,81,45,49,94,19,64,5,56,34,73,48,26,5,88,31,24,85,22,22,85,57,30,47,74,67,39,93,89,66,77,91,29,14,4,72,5,44,91,24,98,28,24},new int[]{5,13,82,55,81,30,83,86,49,82,90,15,92,30,28,84,4,68,15,34,75,87,99,43,99,75,61,63,2,52,52,15,40,28,95,96,98,55,50,22,29,72,86,12,87,38,2,12,55},new int[]{85,12,95,9,79,32,73,88,8,28,56,82,36,37,32,85,39,49,93,18,23,33,73,51,43,4,80,67,72,80,2,45,83,88,80,40,2,32,1,18,64,32,9,55,67,24,11,28,16},new int[]{93,12,68,90,4,75,66,31,56,50,67,89,98,1,69,39,52,95,36,67,12,61,80,72,11,14,91,82,54,8,33,4,30,84,94,91,89,54,6,5,78,51,14,34,41,89,39,18,20},new int[]{8,26,85,27,32,42,50,81,49,65,63,27,75,35,38,38,42,42,49,57,54,10,60,40,1,86,64,81,12,57,77,89,26,40,43,97,72,13,90,56,17,88,24,76,95,58,80,61,80},new int[]{94,28,67,97,51,88,94,92,39,66,77,74,40,13,19,6,18,9,81,68,54,50,70,11,55,42,90,11,72,67,2,82,66,26,76,37,90,36,16,78,66,21,7,11,56,44,54,93,57},new int[]{58,37,48,62,39,92,64,68,68,27,70,98,82,60,44,30,97,58,84,36,5,99,19,12,90,60,83,11,53,20,73,84,27,58,5,74,9,89,77,32,72,54,45,27,86,28,18,87,31},new int[]{41,34,7,5,21,6,45,35,87,3,33,38,87,80,89,16,89,71,8,3,69,19,7,86,90,50,89,6,5,61,86,95,58,22,57,75,32,17,58,41,22,80,42,79,8,46,48,3,77},new int[]{30,28,73,76,25,37,85,51,39,83,72,67,86,1,38,52,63,52,83,85,60,13,91,17,84,30,38,11,27,38,28,26,33,32,54,25,24,40,27,46,86,84,97,69,93,69,39,81,29},new int[]{75,86,31,65,15,83,74,9,13,45,90,6,44,2,29,48,12,87,67,50,11,5,45,74,47,6,80,95,87,94,84,89,99,69,63,67,47,34,12,27,69,86,68,28,71,45,98,2,9},new int[]{79,31,36,15,97,62,31,27,2,73,43,1,83,9,60,2,58,65,12,55,90,10,65,65,61,95,75,69,35,11,68,38,39,21,36,92,72,20,43,21,35,64,32,36,69,52,4,7,98},new int[]{84,71,24,21,57,73,19,84,28,32,34,16,38,81,75,4,56,40,50,40,82,49,48,6,96,5,79,45,16,17,59,56,79,35,8,99,61,27,78,87,20,57,70,88,23,76,2,27,32},new int[]{93,50,64,40,33,29,33,17,74,65,43,63,81,92,58,91,43,37,46,25,98,67,93,99,51,74,38,38,1,54,65,96,22,61,58,54,19,99,70,34,79,44,67,52,22,29,14,94,62},new int[]{15,93,14,67,22,97,87,7,84,7,17,32,79,77,56,62,58,58,3,89,96,80,1,67,20,92,86,62,56,53,65,56,78,45,79,96,18,48,38,22,80,75,71,73,1,42,72,75,69},new int[]{29,6,56,12,39,71,12,33,83,53,19,58,85,83,43,73,45,86,19,37,11,56,25,99,69,45,62,95,14,77,34,98,82,60,64,70,51,42,21,5,66,70,61,8,66,87,62,20,4},new int[]{15,94,56,20,24,9,21,41,13,5,64,46,78,71,70,59,76,51,16,51,96,42,11,68,93,52,98,73,10,72,63,36,96,45,6,6,91,66,73,64,38,69,98,61,78,74,63,71,20}}); param0.add(new int[][]{new int[]{64,81,37,36,97,10,34,45,63,13,25,44,97},new int[]{74,24,69,74,47,91,50,36,33,92,3,31,60},new int[]{29,44,45,42,21,32,28,85,47,99,94,47,17},new int[]{29,48,2,33,63,68,39,89,5,68,52,52,29},new int[]{37,8,20,41,70,36,32,5,20,68,22,97,31},new int[]{41,93,5,10,75,37,56,86,24,85,16,2,15},new int[]{41,63,49,26,94,66,29,70,60,65,40,11,52},new int[]{87,90,95,79,73,64,98,81,99,3,11,28,62},new int[]{48,28,46,64,55,83,2,96,75,16,11,3,55},new int[]{42,29,69,92,31,77,25,6,60,67,22,41,53},new int[]{60,39,55,96,30,71,89,2,8,63,59,97,28},new int[]{74,38,18,62,77,85,97,23,65,40,60,85,5},new int[]{99,18,38,29,26,60,36,82,29,31,63,13,94}}); List<Integer> param1 = new ArrayList<>(); param1.add(5); param1.add(8); param1.add(33); param1.add(10); param1.add(0); param1.add(16); param1.add(2); param1.add(41); param1.add(34); param1.add(12); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([[2, 9, 1, 4, -2], [6, 7, 2, 11, 4], [ 4, 2, 9, 2, 4], [1, 9, 2, 4, 4 ], [ 0, 2, 4, 2, 5]],5,), ([[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],8,), ([[52, 88, 22, 69, 1, 83, 30, 39, 79, 35, 69, 70, 89, 11, 51, 63, 86, 34, 55, 78, 73, 20, 80, 58, 81, 17, 34, 75, 99, 62, 34, 72, 19, 97, 87, 66, 72, 93, 42, 51, 71, 49, 29, 95], [30, 99, 25, 68, 62, 38, 17, 74, 1, 18, 63, 46, 19, 50, 96, 54, 31, 97, 86, 65, 46, 35, 49, 81, 34, 29, 6, 1, 55, 27, 12, 4, 80, 52, 11, 52, 84, 26, 28, 72, 66, 90, 27, 97], [55, 71, 54, 46, 36, 21, 49, 34, 87, 34, 40, 7, 90, 52, 49, 81, 95, 89, 37, 62, 15, 2, 11, 96, 94, 17, 88, 45, 68, 61, 46, 32, 19, 67, 4, 25, 73, 21, 87, 93, 94, 89, 93, 98], [14, 22, 48, 51, 80, 11, 59, 14, 7, 69, 58, 40, 93, 81, 94, 25, 78, 42, 86, 44, 5, 28, 76, 60, 77, 21, 96, 49, 56, 57, 85, 61, 38, 73, 2, 3, 43, 74, 35, 73, 40, 96, 85, 58], [34, 25, 56, 32, 22, 89, 65, 21, 80, 96, 21, 28, 19, 14, 87, 24, 20, 32, 74, 52, 65, 95, 52, 58, 79, 95, 92, 10, 70, 15, 47, 91, 10, 21, 19, 68, 22, 63, 38, 15, 70, 75, 44, 30], [24, 86, 94, 46, 4, 6, 38, 26, 19, 2, 68, 69, 47, 99, 29, 64, 80, 12, 85, 73, 11, 8, 60, 26, 32, 39, 4, 98, 92, 89, 44, 99, 83, 35, 51, 51, 29, 78, 85, 36, 78, 60, 15, 51], [50, 94, 55, 12, 50, 62, 5, 27, 79, 90, 9, 35, 13, 44, 46, 97, 98, 68, 77, 74, 53, 1, 11, 50, 9, 38, 87, 13, 5, 25, 10, 5, 22, 42, 89, 20, 28, 21, 11, 93, 69, 37, 49, 69], [33, 45, 8, 6, 15, 15, 9, 61, 56, 5, 26, 87, 80, 57, 35, 10, 91, 80, 21, 12, 9, 16, 73, 93, 54, 23, 39, 88, 22, 55, 31, 74, 47, 27, 98, 48, 39, 88, 21, 15, 81, 45, 19, 53], [89, 55, 86, 49, 78, 61, 60, 92, 76, 91, 24, 86, 39, 61, 23, 72, 92, 93, 79, 39, 72, 92, 97, 11, 42, 25, 34, 22, 2, 51, 16, 11, 78, 96, 86, 69, 87, 62, 19, 29, 42, 23, 60, 73], [18, 95, 81, 55, 18, 27, 85, 1, 96, 14, 59, 78, 33, 36, 39, 76, 45, 25, 15, 20, 34, 58, 60, 78, 30, 13, 78, 93, 90, 67, 89, 91, 45, 40, 80, 38, 75, 93, 47, 88, 29, 34, 11, 20], [20, 73, 56, 23, 91, 88, 25, 89, 33, 31, 74, 79, 1, 54, 16, 85, 59, 66, 3, 15, 32, 50, 91, 99, 60, 88, 8, 7, 4, 94, 10, 60, 25, 42, 47, 96, 96, 32, 74, 73, 25, 89, 16, 49], [16, 94, 38, 5, 7, 77, 8, 33, 62, 74, 84, 32, 93, 1, 91, 20, 55, 63, 78, 79, 6, 52, 2, 93, 39, 32, 51, 69, 86, 92, 32, 93, 3, 62, 95, 13, 70, 21, 61, 14, 89, 71, 22, 32], [41, 32, 42, 52, 94, 81, 54, 62, 85, 90, 43, 3, 38, 81, 39, 70, 85, 45, 46, 13, 52, 9, 57, 69, 43, 7, 44, 44, 95, 68, 77, 44, 79, 40, 77, 43, 62, 43, 90, 19, 49, 65, 77, 25], [84, 41, 23, 58, 88, 43, 40, 30, 34, 10, 60, 1, 12, 46, 93, 75, 17, 84, 58, 38, 6, 62, 84, 74, 10, 95, 26, 58, 17, 53, 78, 5, 67, 20, 51, 46, 79, 67, 3, 23, 9, 11, 47, 49], [44, 13, 8, 63, 22, 38, 27, 26, 23, 95, 93, 65, 74, 47, 61, 46, 4, 31, 4, 29, 73, 79, 44, 3, 59, 79, 53, 11, 6, 47, 7, 68, 85, 1, 56, 87, 77, 43, 28, 29, 18, 87, 92, 73], [62, 6, 16, 1, 22, 46, 62, 23, 21, 51, 95, 38, 28, 44, 91, 39, 42, 42, 60, 57, 77, 96, 7, 51, 97, 77, 32, 7, 76, 40, 15, 59, 85, 12, 77, 42, 39, 63, 2, 29, 61, 29, 38, 7], [30, 87, 92, 56, 87, 36, 42, 93, 4, 84, 5, 46, 75, 2, 54, 88, 59, 33, 22, 47, 6, 24, 93, 49, 96, 94, 51, 41, 67, 89, 92, 79, 81, 2, 91, 78, 43, 32, 12, 23, 16, 44, 2, 7], [21, 58, 95, 23, 60, 25, 35, 99, 45, 7, 69, 32, 53, 69, 25, 95, 84, 86, 77, 2, 86, 61, 9, 51, 2, 45, 32, 72, 80, 97, 75, 32, 8, 96, 85, 89, 20, 65, 21, 7, 89, 9, 86, 2], [19, 60, 70, 59, 69, 45, 62, 10, 65, 26, 90, 60, 18, 59, 21, 46, 12, 78, 32, 39, 99, 81, 55, 55, 10, 35, 80, 6, 68, 62, 9, 29, 71, 80, 6, 44, 64, 67, 44, 78, 14, 9, 23, 57], [57, 15, 64, 7, 20, 64, 19, 6, 51, 39, 65, 71, 99, 25, 23, 89, 58, 11, 34, 31, 38, 46, 12, 9, 13, 64, 20, 59, 85, 22, 65, 60, 41, 81, 45, 4, 70, 45, 58, 83, 94, 23, 32, 63], [93, 8, 85, 81, 81, 85, 79, 91, 25, 33, 66, 16, 55, 36, 72, 80, 7, 69, 87, 8, 3, 35, 36, 79, 30, 15, 93, 68, 98, 87, 58, 99, 28, 95, 42, 97, 18, 5, 9, 84, 9, 18, 56, 15], [79, 78, 62, 35, 40, 51, 60, 56, 84, 75, 41, 54, 17, 25, 93, 87, 9, 56, 89, 23, 2, 45, 65, 38, 6, 48, 44, 79, 7, 66, 62, 30, 93, 76, 52, 98, 94, 36, 35, 66, 50, 3, 76, 4], [55, 52, 59, 71, 20, 19, 8, 67, 27, 79, 8, 18, 29, 46, 36, 3, 9, 10, 84, 66, 1, 91, 4, 48, 96, 18, 78, 45, 15, 51, 61, 4, 19, 88, 94, 77, 11, 28, 57, 75, 54, 65, 47, 4], [34, 76, 54, 88, 61, 96, 83, 93, 93, 83, 20, 3, 40, 69, 23, 69, 94, 32, 24, 51, 58, 42, 35, 32, 54, 45, 48, 86, 85, 92, 49, 34, 16, 11, 97, 19, 92, 29, 54, 53, 67, 82, 82, 76], [82, 32, 83, 56, 63, 4, 11, 3, 27, 80, 44, 18, 30, 88, 70, 47, 34, 76, 42, 23, 40, 15, 80, 57, 14, 79, 12, 35, 25, 78, 2, 18, 35, 9, 11, 90, 67, 69, 96, 74, 38, 70, 75, 81], [59, 66, 41, 24, 50, 5, 21, 6, 4, 9, 69, 68, 9, 18, 59, 43, 80, 66, 29, 48, 51, 42, 36, 76, 45, 98, 35, 6, 37, 36, 84, 16, 72, 22, 69, 69, 63, 75, 19, 81, 18, 73, 17, 41], [33, 84, 55, 82, 24, 77, 40, 28, 67, 75, 39, 21, 37, 2, 6, 52, 5, 47, 43, 96, 40, 11, 81, 14, 2, 39, 63, 63, 18, 97, 94, 79, 93, 90, 1, 17, 54, 39, 48, 66, 15, 22, 20, 93], [89, 43, 56, 24, 98, 43, 21, 48, 66, 16, 40, 21, 52, 8, 78, 55, 86, 82, 58, 5, 42, 30, 95, 9, 95, 95, 41, 51, 57, 73, 61, 6, 26, 74, 6, 53, 61, 33, 45, 94, 40, 24, 92, 45], [38, 29, 79, 8, 64, 87, 73, 51, 75, 6, 47, 49, 76, 98, 85, 32, 54, 36, 89, 99, 98, 19, 37, 17, 80, 16, 58, 44, 68, 49, 94, 51, 98, 5, 97, 58, 46, 55, 73, 17, 12, 24, 56, 55], [76, 79, 16, 87, 82, 22, 44, 95, 43, 79, 21, 8, 49, 6, 81, 47, 36, 92, 23, 31, 75, 62, 84, 96, 81, 57, 70, 65, 37, 68, 95, 75, 17, 7, 52, 35, 2, 40, 37, 57, 10, 76, 81, 46], [90, 5, 5, 27, 5, 61, 8, 31, 97, 21, 99, 21, 51, 79, 59, 2, 30, 58, 92, 81, 20, 40, 29, 5, 89, 10, 83, 61, 1, 47, 98, 57, 14, 25, 90, 21, 16, 74, 32, 45, 64, 84, 73, 60], [98, 95, 19, 47, 95, 64, 30, 47, 88, 33, 82, 21, 95, 63, 42, 61, 43, 68, 26, 33, 33, 49, 84, 41, 72, 36, 72, 95, 22, 47, 83, 20, 87, 24, 43, 88, 73, 16, 27, 45, 37, 13, 51, 2], [76, 97, 87, 59, 14, 49, 30, 98, 9, 79, 24, 41, 60, 89, 32, 47, 21, 42, 70, 89, 2, 31, 56, 30, 63, 15, 18, 32, 14, 62, 82, 99, 52, 22, 14, 78, 34, 86, 80, 56, 53, 49, 63, 16], [80, 40, 38, 18, 23, 48, 82, 46, 22, 54, 40, 30, 55, 56, 42, 42, 62, 82, 53, 82, 53, 64, 1, 79, 69, 27, 17, 63, 41, 58, 57, 96, 38, 90, 66, 92, 45, 23, 20, 36, 42, 22, 60, 11], [28, 45, 22, 81, 63, 31, 11, 36, 78, 35, 23, 29, 23, 16, 84, 89, 19, 90, 96, 63, 50, 85, 73, 43, 19, 85, 18, 6, 35, 14, 64, 9, 35, 2, 6, 99, 25, 73, 50, 95, 7, 63, 28, 2], [65, 59, 24, 62, 99, 71, 38, 93, 62, 65, 51, 94, 52, 96, 74, 98, 63, 11, 48, 54, 91, 50, 74, 38, 86, 88, 8, 6, 68, 69, 6, 32, 38, 57, 84, 64, 54, 14, 64, 50, 47, 54, 19, 75], [39, 65, 99, 83, 60, 33, 32, 36, 24, 43, 71, 71, 46, 47, 69, 14, 45, 52, 90, 50, 65, 77, 64, 23, 84, 71, 70, 59, 73, 92, 74, 54, 99, 71, 89, 94, 26, 44, 76, 13, 54, 40, 4, 53], [1, 6, 55, 66, 91, 18, 29, 53, 33, 3, 20, 4, 82, 8, 86, 86, 83, 28, 66, 73, 99, 86, 26, 34, 71, 94, 49, 89, 49, 73, 27, 65, 33, 72, 49, 63, 32, 19, 50, 22, 90, 67, 9, 35], [71, 79, 4, 37, 28, 9, 35, 25, 9, 61, 52, 97, 17, 76, 9, 54, 5, 63, 47, 90, 19, 99, 66, 45, 71, 73, 86, 33, 80, 43, 88, 72, 94, 26, 45, 35, 81, 53, 10, 41, 17, 71, 66, 11], [63, 67, 46, 20, 13, 87, 17, 93, 32, 99, 99, 98, 85, 16, 23, 11, 14, 67, 71, 45, 75, 33, 83, 45, 54, 51, 87, 23, 29, 6, 39, 5, 96, 40, 90, 78, 82, 21, 59, 89, 20, 24, 3, 86], [72, 57, 93, 71, 70, 70, 76, 63, 86, 47, 90, 89, 19, 99, 13, 89, 45, 32, 30, 85, 42, 72, 42, 7, 3, 37, 3, 18, 42, 9, 57, 24, 7, 97, 89, 42, 98, 58, 85, 56, 58, 18, 39, 50], [33, 28, 56, 25, 14, 55, 84, 84, 7, 4, 95, 30, 62, 57, 37, 55, 85, 65, 52, 3, 77, 7, 70, 70, 34, 96, 16, 8, 21, 11, 50, 87, 6, 15, 11, 27, 79, 45, 38, 4, 78, 45, 10, 54], [29, 12, 56, 40, 84, 37, 66, 20, 12, 38, 30, 47, 82, 74, 71, 42, 5, 48, 93, 99, 51, 12, 10, 37, 66, 67, 14, 47, 20, 52, 68, 26, 47, 79, 73, 3, 2, 41, 30, 37, 81, 3, 9, 8], [9, 17, 24, 72, 14, 54, 80, 18, 88, 39, 47, 27, 92, 71, 98, 91, 34, 19, 6, 30, 92, 12, 15, 39, 64, 64, 15, 58, 67, 1, 7, 9, 1, 5, 47, 10, 2, 23, 93, 56, 19, 38, 47, 84]],33,), ([[99, 52, 49, 71, 23, 50, 17, 48, 2, 69, 62], [85, 13, 61, 11, 88, 97, 27, 35, 18, 85, 68], [61, 41, 96, 43, 49, 11, 67, 51, 52, 85, 43], [58, 78, 70, 29, 31, 28, 50, 36, 92, 19, 67], [12, 88, 76, 24, 65, 92, 80, 21, 94, 98, 26], [35, 95, 80, 58, 42, 29, 29, 9, 78, 72, 2], [75, 2, 18, 69, 57, 71, 23, 19, 19, 58, 83], [49, 45, 28, 75, 50, 11, 55, 9, 14, 98, 93], [21, 48, 58, 69, 97, 9, 67, 78, 18, 12, 87], [78, 16, 37, 20, 20, 15, 25, 17, 12, 42, 39], [56, 53, 71, 72, 88, 47, 25, 85, 50, 33, 74]],10,), ([[29, 3, 39, 4, 37, 95, 6, 92, 10, 12, 66, 3, 65, 64, 35, 24, 47, 52, 34], [84, 80, 94, 25, 69, 29, 92, 64, 53, 58, 41, 87, 96, 51, 18, 41, 99, 61, 24], [47, 28, 36, 21, 56, 69, 26, 54, 87, 44, 33, 26, 22, 20, 2, 41, 54, 57, 18], [5, 96, 46, 75, 21, 22, 3, 9, 2, 28, 34, 53, 59, 10, 83, 93, 2, 48, 6], [44, 54, 71, 36, 8, 83, 10, 33, 91, 93, 19, 18, 51, 23, 1, 59, 3, 10, 71], [49, 56, 90, 16, 39, 96, 76, 44, 8, 8, 45, 11, 97, 25, 17, 95, 83, 55, 79], [56, 44, 53, 35, 39, 2, 98, 25, 38, 68, 80, 32, 79, 78, 41, 79, 71, 7, 72], [83, 18, 17, 82, 83, 77, 59, 11, 51, 7, 27, 59, 37, 5, 62, 72, 74, 90, 79], [55, 16, 93, 92, 74, 56, 51, 68, 46, 61, 78, 33, 55, 18, 12, 74, 21, 97, 78], [73, 26, 79, 21, 22, 55, 46, 41, 5, 44, 16, 35, 5, 62, 90, 26, 61, 51, 69], [56, 50, 36, 24, 79, 30, 69, 48, 22, 33, 69, 96, 50, 23, 10, 36, 17, 53, 91], [8, 44, 61, 6, 71, 90, 81, 37, 54, 23, 91, 57, 51, 58, 19, 27, 89, 25, 21], [25, 51, 71, 35, 70, 50, 15, 24, 49, 68, 7, 94, 81, 54, 38, 94, 45, 9, 55], [83, 52, 77, 49, 55, 83, 70, 76, 79, 3, 68, 38, 70, 49, 92, 8, 95, 85, 45], [29, 79, 49, 24, 21, 23, 95, 98, 28, 32, 22, 62, 67, 73, 6, 65, 22, 51, 68], [57, 72, 55, 42, 52, 61, 19, 1, 41, 63, 88, 48, 81, 32, 50, 14, 17, 96, 97], [30, 51, 98, 92, 62, 24, 63, 14, 34, 59, 65, 86, 33, 58, 18, 12, 74, 66, 2], [70, 84, 28, 42, 3, 48, 89, 87, 13, 57, 88, 3, 63, 38, 59, 28, 26, 84, 91], [65, 74, 74, 61, 57, 1, 32, 32, 27, 13, 17, 28, 89, 52, 36, 47, 66, 32, 32]],0,), ([[55, 73, 80, 89, 40, 28, 81, 31, 87, 31, 26, 4, 58, 79, 23, 69, 60, 43, 89, 94, 26, 67, 68, 55, 47, 82, 59, 75, 75, 16, 58], [89, 1, 90, 45, 94, 6, 91, 52, 19, 43, 19, 39, 32, 65, 89, 47, 13, 74, 82, 36, 86, 70, 27, 72, 24, 20, 86, 9, 39, 83, 1], [11, 74, 1, 91, 81, 44, 51, 17, 66, 23, 41, 59, 74, 94, 99, 25, 17, 19, 82, 82, 46, 35, 74, 23, 86, 44, 9, 32, 90, 93, 59], [42, 62, 19, 93, 35, 76, 8, 89, 91, 43, 45, 6, 13, 11, 70, 69, 7, 55, 55, 19, 6, 89, 9, 20, 25, 50, 72, 50, 38, 66, 57], [22, 56, 36, 51, 68, 1, 48, 33, 24, 49, 69, 58, 48, 57, 64, 99, 53, 60, 90, 43, 41, 26, 59, 49, 64, 5, 44, 18, 57, 89, 40], [46, 58, 85, 24, 28, 46, 68, 72, 54, 33, 67, 84, 35, 39, 47, 71, 91, 5, 37, 1, 86, 56, 7, 64, 8, 94, 64, 57, 28, 26, 34], [96, 22, 20, 14, 23, 67, 19, 78, 39, 37, 99, 1, 19, 15, 89, 1, 31, 52, 43, 46, 86, 50, 20, 62, 43, 5, 79, 66, 12, 57, 60], [55, 71, 66, 72, 73, 27, 28, 37, 79, 19, 94, 51, 13, 45, 6, 94, 1, 25, 99, 26, 13, 19, 10, 45, 71, 15, 87, 31, 8, 30, 98], [97, 1, 16, 11, 27, 86, 40, 83, 44, 70, 57, 48, 40, 39, 84, 3, 55, 1, 23, 67, 62, 34, 17, 48, 91, 53, 61, 87, 11, 15, 90], [11, 7, 47, 8, 5, 81, 87, 66, 91, 63, 21, 71, 90, 94, 12, 11, 54, 81, 10, 16, 15, 58, 79, 84, 4, 96, 22, 35, 14, 94, 31], [74, 70, 91, 11, 36, 74, 80, 24, 85, 40, 42, 87, 21, 96, 81, 51, 81, 55, 85, 4, 62, 87, 25, 96, 70, 14, 41, 57, 38, 62, 41], [45, 80, 96, 16, 19, 37, 85, 79, 61, 26, 94, 79, 64, 13, 91, 87, 34, 98, 23, 20, 54, 73, 58, 59, 20, 39, 78, 90, 91, 98, 93], [32, 41, 69, 68, 87, 21, 97, 24, 16, 32, 83, 26, 3, 99, 82, 7, 96, 88, 16, 53, 88, 4, 45, 32, 98, 83, 78, 58, 13, 22, 95], [44, 44, 30, 23, 12, 14, 36, 45, 72, 24, 3, 78, 51, 75, 55, 38, 92, 87, 82, 20, 97, 2, 26, 2, 67, 84, 74, 42, 85, 40, 9], [2, 28, 3, 16, 4, 23, 94, 77, 6, 74, 55, 81, 8, 73, 98, 81, 86, 64, 67, 41, 40, 93, 27, 39, 53, 40, 52, 37, 67, 19, 34], [78, 85, 66, 10, 52, 42, 60, 81, 2, 91, 1, 50, 36, 97, 22, 99, 98, 82, 36, 3, 44, 16, 11, 10, 51, 42, 85, 25, 99, 6, 44], [8, 34, 41, 1, 3, 52, 91, 77, 43, 47, 83, 19, 70, 47, 78, 5, 64, 45, 64, 45, 36, 9, 23, 32, 93, 45, 28, 52, 11, 19, 64], [65, 73, 57, 66, 4, 29, 4, 1, 92, 18, 13, 70, 49, 47, 86, 30, 27, 72, 28, 2, 20, 75, 78, 24, 77, 72, 44, 21, 22, 73, 58], [11, 80, 53, 9, 67, 52, 13, 1, 44, 75, 24, 5, 66, 81, 81, 20, 64, 15, 68, 54, 11, 23, 1, 42, 47, 68, 38, 2, 45, 27, 98], [77, 61, 82, 11, 69, 29, 25, 78, 54, 48, 46, 41, 41, 61, 11, 44, 32, 49, 6, 57, 6, 47, 63, 49, 22, 67, 19, 55, 34, 41, 7], [57, 16, 59, 38, 9, 77, 34, 46, 37, 43, 47, 6, 38, 61, 4, 5, 70, 60, 77, 88, 92, 77, 56, 82, 59, 7, 68, 31, 88, 86, 85], [48, 42, 90, 30, 51, 35, 62, 51, 87, 50, 30, 19, 96, 50, 54, 83, 86, 4, 12, 15, 15, 10, 61, 19, 53, 72, 57, 95, 9, 29, 7], [72, 17, 79, 16, 71, 83, 38, 89, 76, 96, 47, 10, 24, 50, 68, 43, 37, 45, 54, 43, 68, 37, 89, 41, 94, 1, 93, 16, 37, 37, 7], [40, 51, 64, 97, 22, 43, 62, 54, 27, 29, 16, 85, 11, 21, 9, 27, 86, 79, 23, 51, 93, 80, 3, 16, 8, 90, 42, 73, 35, 71, 72], [99, 48, 54, 36, 6, 71, 12, 59, 65, 50, 43, 43, 49, 89, 76, 55, 91, 87, 83, 85, 50, 21, 88, 13, 42, 15, 50, 1, 51, 34, 42], [62, 95, 32, 61, 93, 54, 74, 58, 85, 24, 27, 21, 18, 55, 68, 47, 54, 18, 73, 64, 49, 94, 35, 94, 39, 58, 57, 6, 78, 93, 96], [78, 20, 50, 9, 76, 14, 23, 48, 98, 80, 82, 56, 40, 97, 69, 39, 74, 86, 43, 97, 31, 70, 3, 4, 27, 89, 27, 47, 60, 36, 46], [61, 42, 7, 30, 50, 47, 93, 40, 5, 70, 58, 44, 71, 32, 79, 77, 82, 74, 40, 57, 11, 40, 47, 2, 91, 52, 72, 49, 59, 38, 16], [88, 87, 78, 27, 74, 28, 89, 66, 45, 33, 60, 50, 46, 35, 41, 58, 77, 55, 5, 5, 22, 34, 65, 59, 17, 51, 49, 9, 74, 15, 29], [53, 25, 85, 81, 91, 28, 23, 3, 33, 71, 69, 90, 17, 81, 67, 67, 34, 8, 45, 60, 56, 70, 22, 33, 50, 71, 83, 46, 52, 74, 87], [66, 21, 24, 48, 13, 64, 5, 18, 75, 37, 54, 32, 28, 86, 45, 28, 65, 70, 75, 42, 33, 16, 13, 21, 59, 47, 39, 88, 43, 27, 37]],16,), ([[76, 7, 58], [20, 79, 65], [74, 14, 79]],2,), ([[89, 95, 74, 37, 6, 6, 28, 78, 13, 13, 10, 80, 39, 99, 79, 23, 37, 8, 90, 60, 86, 5, 98, 27, 19, 43, 43, 35, 84, 55, 61, 47, 77, 56, 82, 18, 65, 96, 53, 89, 85, 91, 11, 1, 83, 96, 8, 19, 55], [16, 99, 66, 12, 93, 74, 62, 86, 98, 58, 21, 37, 5, 70, 32, 67, 10, 69, 88, 84, 62, 37, 95, 47, 81, 49, 24, 82, 26, 55, 7, 78, 41, 2, 30, 81, 20, 56, 74, 24, 12, 91, 15, 73, 82, 48, 61, 71, 28], [3, 16, 36, 4, 99, 9, 12, 74, 44, 66, 19, 13, 55, 97, 65, 92, 70, 3, 25, 52, 16, 43, 56, 68, 8, 80, 44, 38, 23, 6, 43, 44, 80, 80, 23, 16, 76, 9, 82, 9, 85, 58, 65, 59, 23, 69, 19, 35, 97], [55, 82, 40, 14, 84, 13, 53, 80, 95, 39, 99, 84, 65, 56, 40, 46, 77, 7, 45, 22, 7, 84, 52, 68, 70, 67, 3, 58, 67, 54, 9, 54, 80, 51, 16, 12, 20, 53, 31, 94, 21, 3, 21, 92, 28, 5, 71, 69, 73], [47, 85, 20, 38, 37, 58, 17, 42, 92, 95, 97, 32, 62, 96, 87, 21, 89, 33, 67, 6, 92, 66, 32, 64, 26, 62, 5, 11, 74, 79, 82, 49, 78, 92, 94, 62, 60, 77, 84, 2, 89, 59, 76, 25, 68, 42, 76, 71, 55], [38, 96, 43, 70, 53, 91, 99, 21, 20, 19, 33, 63, 68, 60, 19, 28, 22, 51, 88, 63, 62, 94, 29, 74, 32, 73, 25, 16, 15, 59, 48, 18, 23, 55, 42, 3, 71, 52, 11, 55, 88, 99, 25, 92, 76, 87, 81, 41, 37], [82, 55, 9, 99, 36, 57, 63, 82, 20, 85, 47, 20, 6, 73, 93, 29, 77, 91, 49, 6, 39, 32, 49, 43, 28, 45, 65, 50, 54, 51, 43, 64, 95, 30, 82, 93, 42, 38, 87, 86, 66, 69, 15, 61, 96, 6, 78, 24, 85], [14, 12, 55, 68, 44, 85, 81, 93, 51, 80, 82, 38, 41, 44, 75, 96, 92, 16, 98, 50, 94, 38, 86, 5, 9, 77, 39, 87, 27, 32, 64, 95, 33, 90, 18, 76, 67, 5, 78, 59, 76, 4, 16, 75, 48, 66, 77, 8, 44], [21, 26, 35, 15, 40, 30, 66, 80, 13, 1, 43, 28, 1, 40, 34, 13, 61, 66, 4, 89, 98, 13, 36, 96, 61, 58, 85, 90, 15, 93, 90, 85, 12, 76, 69, 61, 42, 90, 32, 2, 8, 91, 54, 8, 88, 13, 29, 13, 58], [63, 87, 47, 79, 88, 87, 74, 38, 69, 69, 95, 40, 1, 2, 29, 7, 93, 57, 55, 73, 36, 7, 92, 10, 80, 74, 39, 58, 90, 98, 98, 40, 14, 82, 1, 17, 49, 86, 16, 7, 15, 21, 66, 59, 48, 89, 73, 84, 50], [10, 52, 85, 68, 30, 34, 94, 78, 86, 65, 60, 8, 75, 65, 69, 57, 45, 49, 74, 62, 39, 77, 21, 53, 45, 97, 28, 53, 9, 75, 93, 71, 61, 27, 22, 95, 30, 92, 84, 15, 15, 53, 76, 81, 23, 70, 16, 91, 87], [65, 45, 7, 45, 39, 50, 49, 48, 49, 40, 39, 57, 82, 63, 56, 86, 2, 26, 96, 23, 18, 83, 88, 68, 60, 2, 94, 49, 38, 31, 40, 80, 53, 64, 33, 58, 50, 64, 3, 61, 82, 10, 66, 51, 94, 30, 25, 43, 88], [64, 59, 62, 99, 10, 64, 94, 60, 90, 99, 88, 20, 49, 99, 74, 27, 51, 57, 79, 79, 37, 99, 3, 29, 68, 47, 80, 69, 21, 42, 21, 2, 78, 69, 7, 75, 35, 30, 44, 46, 55, 1, 54, 80, 1, 63, 55, 86, 77], [27, 15, 81, 9, 69, 59, 23, 11, 24, 72, 98, 54, 31, 22, 14, 5, 17, 82, 83, 71, 90, 89, 82, 44, 79, 93, 49, 65, 4, 9, 36, 51, 32, 88, 18, 15, 20, 58, 40, 66, 89, 13, 91, 13, 62, 28, 46, 15, 93], [85, 44, 95, 23, 67, 99, 78, 66, 50, 13, 2, 76, 91, 34, 40, 69, 61, 25, 75, 77, 63, 28, 85, 56, 26, 27, 26, 15, 50, 6, 68, 4, 30, 77, 9, 42, 14, 92, 40, 3, 41, 93, 33, 79, 60, 64, 62, 79, 7], [76, 50, 39, 71, 47, 70, 26, 58, 73, 51, 88, 52, 94, 16, 48, 27, 33, 23, 45, 83, 83, 22, 42, 33, 10, 47, 96, 79, 39, 46, 72, 51, 25, 82, 15, 58, 59, 26, 41, 44, 85, 22, 98, 37, 14, 4, 24, 66, 63], [65, 66, 13, 27, 81, 17, 69, 88, 57, 72, 73, 18, 16, 51, 96, 40, 39, 56, 54, 44, 46, 32, 48, 61, 66, 38, 43, 4, 5, 58, 37, 26, 9, 15, 88, 88, 99, 89, 26, 63, 87, 70, 27, 54, 83, 31, 32, 2, 18], [28, 71, 87, 88, 92, 25, 39, 49, 4, 52, 83, 68, 57, 13, 65, 63, 98, 71, 25, 23, 30, 61, 7, 54, 17, 97, 60, 66, 38, 13, 52, 52, 32, 86, 9, 17, 82, 40, 91, 75, 54, 54, 28, 72, 50, 18, 13, 33, 15], [86, 38, 94, 6, 45, 59, 98, 83, 97, 78, 48, 41, 83, 79, 74, 55, 61, 2, 2, 85, 76, 10, 76, 39, 2, 65, 66, 87, 92, 81, 52, 85, 44, 34, 73, 81, 45, 32, 5, 78, 89, 86, 63, 69, 54, 38, 9, 61, 95], [21, 36, 1, 22, 87, 87, 15, 46, 65, 6, 40, 35, 81, 61, 23, 20, 28, 37, 82, 7, 49, 84, 24, 80, 13, 92, 7, 15, 87, 23, 95, 69, 91, 60, 10, 51, 64, 71, 56, 32, 23, 54, 73, 93, 91, 85, 70, 90, 84], [61, 79, 20, 53, 15, 29, 70, 80, 65, 62, 70, 16, 54, 97, 7, 60, 10, 53, 8, 85, 90, 37, 82, 4, 84, 83, 97, 23, 9, 38, 45, 45, 18, 46, 2, 48, 17, 16, 45, 48, 24, 95, 65, 92, 33, 4, 1, 33, 74], [62, 3, 45, 21, 64, 73, 57, 40, 62, 43, 88, 46, 72, 24, 24, 10, 99, 68, 57, 44, 73, 75, 48, 77, 27, 30, 46, 12, 60, 19, 68, 54, 34, 87, 90, 7, 82, 42, 68, 53, 8, 22, 26, 77, 63, 46, 81, 44, 62], [36, 41, 79, 82, 27, 70, 98, 41, 5, 57, 76, 29, 12, 25, 34, 75, 87, 24, 82, 63, 63, 10, 5, 95, 89, 53, 81, 28, 65, 45, 66, 49, 40, 66, 91, 8, 27, 17, 68, 44, 31, 5, 60, 89, 92, 19, 42, 23, 77], [17, 94, 58, 87, 49, 3, 77, 96, 45, 35, 2, 47, 3, 29, 74, 20, 34, 79, 40, 65, 90, 63, 56, 32, 66, 96, 41, 29, 84, 87, 51, 12, 44, 10, 83, 74, 83, 90, 88, 9, 29, 29, 92, 61, 64, 3, 87, 4, 55], [14, 77, 28, 63, 39, 64, 60, 20, 28, 96, 14, 77, 75, 58, 39, 58, 15, 73, 3, 5, 92, 42, 15, 3, 35, 7, 94, 24, 31, 78, 80, 4, 3, 99, 9, 68, 83, 88, 60, 11, 79, 36, 95, 72, 2, 50, 3, 67, 85], [62, 76, 14, 23, 77, 16, 81, 18, 13, 56, 90, 45, 40, 31, 81, 32, 1, 35, 36, 83, 92, 66, 29, 43, 29, 43, 19, 64, 92, 98, 31, 19, 96, 29, 73, 7, 58, 76, 60, 51, 95, 82, 92, 50, 21, 9, 34, 34, 47], [24, 80, 28, 46, 51, 99, 6, 63, 53, 64, 52, 60, 41, 11, 4, 14, 13, 15, 8, 88, 11, 99, 89, 23, 7, 69, 32, 92, 44, 3, 94, 44, 69, 51, 61, 51, 33, 20, 30, 44, 86, 86, 29, 21, 82, 53, 11, 10, 35], [26, 44, 4, 74, 57, 39, 80, 41, 94, 67, 98, 89, 36, 4, 74, 13, 70, 7, 28, 59, 37, 15, 30, 74, 12, 81, 30, 1, 36, 88, 21, 32, 63, 82, 13, 37, 44, 21, 18, 46, 47, 26, 5, 5, 31, 28, 77, 75, 65], [88, 13, 18, 24, 29, 28, 45, 86, 84, 11, 51, 59, 84, 13, 47, 88, 43, 24, 48, 63, 17, 69, 54, 94, 14, 15, 73, 78, 10, 22, 95, 13, 81, 65, 14, 44, 39, 35, 65, 27, 45, 57, 22, 34, 9, 50, 54, 58, 96], [62, 38, 84, 27, 64, 3, 11, 24, 29, 69, 97, 8, 19, 68, 99, 94, 69, 48, 40, 67, 16, 64, 8, 5, 99, 72, 25, 53, 49, 72, 21, 51, 46, 9, 64, 96, 77, 23, 60, 59, 8, 64, 99, 54, 92, 15, 52, 93, 51], [4, 34, 24, 21, 2, 7, 56, 75, 76, 68, 35, 26, 18, 64, 56, 80, 55, 12, 37, 52, 19, 15, 86, 84, 52, 77, 87, 95, 26, 45, 96, 21, 81, 93, 53, 29, 48, 86, 19, 54, 78, 87, 2, 32, 62, 97, 7, 98, 68], [87, 84, 22, 29, 3, 22, 84, 89, 98, 53, 93, 57, 10, 40, 20, 87, 11, 8, 93, 36, 25, 39, 98, 96, 62, 87, 21, 19, 25, 87, 83, 5, 83, 99, 12, 25, 5, 76, 27, 4, 83, 45, 47, 88, 28, 97, 35, 16, 12], [80, 75, 43, 28, 87, 81, 19, 75, 68, 74, 55, 83, 36, 62, 39, 41, 60, 86, 66, 59, 97, 40, 91, 19, 55, 46, 4, 83, 62, 25, 63, 70, 13, 86, 4, 2, 67, 30, 4, 48, 43, 93, 45, 97, 13, 47, 96, 28, 37], [28, 27, 89, 30, 6, 94, 9, 6, 29, 87, 70, 86, 66, 95, 53, 70, 5, 20, 12, 8, 58, 49, 64, 50, 97, 39, 40, 31, 3, 83, 72, 30, 95, 29, 70, 56, 66, 87, 63, 30, 53, 46, 9, 7, 63, 47, 44, 49, 79], [79, 85, 62, 59, 78, 75, 75, 84, 13, 30, 84, 43, 51, 8, 37, 97, 90, 64, 39, 8, 62, 82, 39, 14, 52, 82, 57, 21, 23, 4, 74, 43, 11, 84, 19, 65, 95, 2, 49, 69, 34, 4, 91, 39, 49, 3, 26, 41, 65], [16, 58, 35, 83, 16, 33, 31, 22, 61, 84, 64, 70, 35, 39, 3, 96, 13, 14, 41, 8, 19, 14, 75, 50, 99, 61, 36, 67, 89, 77, 80, 92, 45, 91, 74, 82, 72, 7, 22, 9, 60, 42, 59, 40, 29, 55, 64, 42, 29], [92, 21, 97, 63, 63, 90, 38, 79, 66, 12, 33, 79, 1, 97, 68, 28, 62, 78, 59, 49, 45, 76, 6, 20, 85, 16, 12, 52, 20, 58, 45, 97, 2, 34, 26, 33, 42, 94, 65, 8, 65, 10, 32, 51, 57, 40, 66, 31, 63], [68, 56, 12, 31, 23, 33, 8, 62, 80, 15, 41, 52, 26, 78, 12, 27, 95, 68, 30, 4, 54, 95, 34, 68, 84, 56, 18, 47, 72, 60, 59, 2, 73, 16, 86, 58, 12, 5, 39, 15, 72, 88, 19, 82, 85, 49, 39, 78, 15], [55, 67, 56, 45, 75, 57, 67, 94, 6, 70, 31, 22, 85, 38, 58, 70, 29, 56, 11, 48, 86, 60, 51, 39, 6, 30, 89, 1, 86, 9, 45, 8, 34, 80, 83, 8, 12, 43, 56, 31, 42, 33, 19, 91, 88, 92, 55, 4, 12], [87, 84, 28, 58, 48, 1, 75, 44, 63, 95, 38, 9, 6, 70, 52, 67, 96, 99, 16, 2, 36, 71, 35, 30, 45, 46, 93, 65, 1, 57, 71, 67, 31, 25, 47, 56, 88, 1, 95, 37, 75, 67, 12, 20, 30, 74, 64, 79, 85], [64, 18, 32, 19, 94, 33, 62, 22, 29, 88, 4, 50, 76, 4, 5, 83, 39, 57, 31, 7, 12, 10, 29, 85, 13, 87, 70, 31, 9, 51, 88, 16, 59, 58, 11, 36, 1, 21, 44, 37, 6, 14, 93, 1, 8, 44, 83, 87, 75], [27, 36, 42, 20, 8, 46, 52, 26, 35, 60, 3, 4, 93, 62, 64, 50, 92, 19, 43, 92, 82, 14, 14, 54, 29, 3, 98, 73, 5, 93, 5, 45, 64, 64, 43, 43, 51, 13, 90, 73, 68, 95, 69, 7, 92, 78, 88, 42, 5], [47, 48, 98, 92, 47, 8, 21, 88, 24, 13, 15, 89, 53, 92, 72, 31, 71, 51, 47, 39, 81, 57, 50, 57, 35, 86, 7, 53, 10, 92, 39, 58, 93, 35, 59, 22, 9, 8, 94, 94, 58, 95, 22, 95, 40, 28, 46, 69, 81], [52, 11, 22, 47, 89, 13, 45, 75, 69, 78, 22, 67, 35, 32, 38, 58, 40, 88, 92, 21, 49, 97, 92, 39, 61, 10, 40, 58, 89, 45, 17, 68, 10, 62, 89, 32, 72, 42, 45, 76, 21, 27, 30, 74, 85, 1, 9, 3, 53], [42, 19, 6, 7, 43, 80, 36, 68, 82, 96, 96, 82, 39, 43, 37, 28, 50, 39, 2, 37, 66, 19, 69, 44, 13, 22, 7, 2, 62, 78, 89, 90, 5, 20, 54, 76, 63, 36, 95, 81, 16, 57, 64, 10, 99, 97, 99, 51, 27], [7, 91, 41, 76, 97, 13, 66, 3, 11, 5, 60, 2, 92, 77, 99, 64, 13, 54, 12, 18, 18, 17, 39, 86, 13, 45, 19, 88, 19, 21, 24, 30, 92, 48, 35, 59, 17, 48, 98, 55, 9, 77, 14, 26, 52, 85, 44, 84, 11], [51, 42, 62, 35, 64, 95, 18, 14, 49, 69, 17, 21, 14, 3, 31, 89, 47, 44, 17, 90, 81, 56, 83, 27, 71, 90, 69, 2, 80, 62, 75, 87, 99, 6, 65, 97, 18, 55, 67, 57, 19, 74, 84, 11, 96, 84, 55, 96, 37], [86, 4, 13, 70, 93, 58, 2, 60, 89, 32, 63, 60, 26, 90, 22, 74, 87, 4, 16, 63, 42, 33, 13, 46, 13, 33, 14, 8, 90, 86, 46, 1, 59, 60, 49, 80, 93, 61, 23, 5, 85, 50, 36, 20, 43, 8, 90, 41, 25], [7, 86, 61, 33, 69, 38, 12, 44, 53, 14, 71, 92, 52, 52, 46, 80, 41, 2, 49, 95, 78, 28, 32, 92, 76, 77, 22, 42, 29, 94, 79, 68, 33, 46, 9, 38, 80, 26, 43, 53, 27, 11, 26, 78, 57, 1, 11, 30, 88]],41,), ([[4, 86, 72, 80, 33, 33, 74, 66, 4, 87, 51, 27, 33, 97, 84, 77, 75, 83, 32, 67, 77, 28, 86, 57, 19, 31, 84, 53, 88, 32, 9, 51, 83, 23, 25, 97, 46, 44, 66, 67, 28, 99, 78, 24, 56, 50, 3, 23, 34], [9, 82, 59, 66, 22, 35, 31, 90, 78, 48, 53, 92, 75, 32, 85, 87, 88, 12, 62, 3, 6, 12, 53, 20, 6, 84, 14, 56, 41, 49, 65, 84, 86, 95, 31, 28, 12, 16, 97, 35, 44, 68, 10, 98, 3, 31, 52, 95, 65], [5, 5, 66, 15, 65, 21, 71, 11, 90, 42, 66, 94, 61, 60, 14, 5, 31, 48, 32, 57, 34, 74, 95, 27, 82, 5, 17, 75, 69, 56, 38, 54, 48, 85, 88, 94, 80, 49, 41, 22, 57, 66, 19, 2, 75, 33, 73, 59, 89], [6, 11, 27, 72, 45, 31, 91, 63, 44, 41, 47, 69, 79, 2, 15, 95, 20, 3, 39, 74, 90, 10, 40, 13, 85, 98, 44, 32, 73, 30, 1, 53, 76, 44, 35, 88, 40, 45, 60, 63, 10, 47, 24, 57, 18, 57, 72, 46, 43], [77, 16, 14, 9, 73, 69, 61, 11, 19, 64, 38, 10, 16, 93, 69, 82, 42, 44, 53, 35, 36, 22, 24, 76, 12, 35, 50, 83, 78, 87, 40, 22, 47, 75, 66, 10, 43, 69, 94, 85, 97, 25, 47, 7, 28, 80, 45, 67, 83], [12, 83, 11, 3, 61, 66, 56, 26, 86, 81, 34, 55, 79, 76, 16, 80, 39, 6, 72, 52, 25, 56, 83, 19, 76, 73, 93, 27, 5, 26, 30, 78, 97, 35, 75, 53, 68, 33, 70, 28, 74, 36, 49, 90, 94, 86, 53, 69, 2], [97, 80, 71, 64, 21, 35, 46, 86, 48, 22, 6, 33, 39, 43, 25, 18, 41, 35, 24, 55, 40, 87, 97, 29, 10, 79, 10, 90, 64, 29, 98, 18, 2, 25, 85, 51, 95, 22, 9, 91, 89, 89, 91, 74, 94, 4, 21, 30, 33], [43, 90, 2, 87, 31, 4, 47, 84, 89, 45, 65, 66, 6, 7, 51, 68, 18, 41, 69, 25, 56, 1, 98, 55, 3, 54, 81, 32, 88, 2, 65, 98, 8, 58, 53, 44, 73, 28, 19, 56, 20, 71, 56, 35, 19, 81, 63, 82, 7], [27, 39, 30, 23, 84, 23, 90, 47, 78, 48, 95, 91, 63, 9, 23, 63, 74, 47, 87, 74, 66, 37, 38, 1, 48, 82, 35, 71, 86, 53, 25, 42, 23, 9, 27, 75, 51, 91, 92, 57, 82, 36, 34, 13, 55, 46, 52, 94, 28], [86, 88, 30, 45, 38, 20, 70, 97, 47, 59, 79, 79, 96, 14, 42, 61, 59, 8, 57, 22, 84, 88, 21, 28, 49, 23, 88, 54, 23, 68, 46, 68, 94, 28, 95, 97, 50, 83, 63, 10, 89, 37, 13, 70, 30, 87, 80, 72, 80], [11, 1, 86, 18, 11, 84, 10, 48, 61, 10, 60, 22, 75, 99, 9, 15, 83, 37, 70, 44, 69, 3, 10, 77, 4, 56, 40, 33, 98, 33, 60, 21, 69, 45, 57, 77, 40, 81, 64, 10, 74, 66, 85, 65, 30, 82, 35, 53, 39], [22, 67, 70, 80, 67, 75, 17, 19, 60, 72, 78, 90, 89, 51, 48, 57, 10, 32, 79, 68, 28, 4, 61, 77, 12, 15, 29, 87, 13, 38, 58, 35, 40, 76, 94, 5, 2, 30, 99, 10, 73, 81, 38, 59, 94, 35, 71, 12, 42], [98, 49, 67, 33, 13, 75, 20, 95, 33, 34, 50, 50, 9, 7, 9, 26, 2, 5, 66, 10, 31, 33, 6, 14, 78, 15, 97, 95, 81, 43, 79, 20, 21, 64, 29, 59, 73, 64, 93, 44, 34, 47, 9, 60, 30, 17, 52, 59, 4], [40, 96, 96, 7, 38, 32, 69, 67, 56, 20, 64, 17, 16, 11, 13, 18, 14, 34, 76, 86, 85, 26, 42, 61, 39, 2, 57, 50, 16, 62, 98, 11, 83, 63, 30, 54, 71, 27, 86, 64, 81, 79, 9, 76, 72, 2, 49, 48, 55], [80, 67, 31, 26, 66, 30, 77, 78, 1, 96, 70, 22, 75, 87, 54, 14, 14, 84, 71, 19, 26, 59, 22, 6, 63, 77, 74, 54, 19, 95, 10, 37, 77, 17, 55, 5, 21, 39, 20, 71, 15, 79, 53, 87, 33, 44, 66, 50, 32], [79, 71, 73, 55, 28, 86, 3, 53, 42, 2, 22, 25, 89, 32, 7, 62, 31, 63, 37, 68, 97, 79, 9, 70, 46, 95, 34, 60, 13, 36, 96, 86, 48, 93, 75, 6, 5, 65, 50, 74, 74, 24, 7, 86, 58, 21, 86, 33, 44], [25, 95, 80, 15, 29, 83, 52, 17, 90, 36, 35, 40, 23, 73, 34, 58, 82, 80, 61, 96, 28, 60, 32, 58, 82, 44, 34, 93, 21, 1, 55, 80, 49, 97, 21, 99, 55, 27, 20, 95, 16, 78, 48, 32, 32, 53, 53, 2, 57], [22, 52, 81, 96, 81, 58, 34, 71, 93, 17, 88, 72, 23, 33, 29, 19, 69, 37, 87, 26, 24, 54, 21, 97, 90, 10, 42, 29, 57, 35, 28, 12, 58, 44, 7, 16, 84, 93, 35, 92, 7, 86, 14, 59, 62, 74, 66, 22, 16], [99, 75, 43, 97, 98, 97, 83, 20, 10, 19, 12, 10, 71, 56, 11, 80, 97, 61, 38, 17, 54, 45, 25, 31, 65, 39, 20, 73, 43, 66, 1, 55, 51, 5, 12, 14, 60, 96, 40, 9, 42, 42, 33, 25, 78, 9, 91, 44, 83], [58, 25, 32, 22, 93, 55, 92, 61, 57, 77, 61, 92, 67, 94, 75, 2, 57, 73, 33, 90, 63, 16, 89, 1, 85, 64, 84, 69, 17, 40, 1, 13, 18, 68, 14, 5, 62, 33, 26, 61, 68, 30, 62, 62, 81, 92, 70, 57, 91], [36, 7, 65, 74, 77, 41, 32, 14, 33, 30, 73, 6, 10, 75, 20, 89, 12, 22, 76, 14, 48, 54, 36, 61, 55, 14, 2, 2, 61, 6, 25, 67, 23, 73, 95, 28, 25, 99, 65, 66, 79, 43, 40, 80, 23, 49, 99, 8, 7], [21, 35, 97, 99, 82, 61, 83, 74, 68, 30, 97, 68, 9, 17, 43, 88, 57, 13, 57, 26, 61, 62, 19, 81, 30, 90, 13, 49, 82, 85, 98, 51, 9, 94, 29, 93, 83, 8, 81, 76, 15, 69, 34, 52, 50, 67, 5, 98, 9], [88, 5, 27, 84, 47, 62, 45, 66, 23, 98, 61, 93, 43, 35, 30, 67, 10, 56, 34, 65, 6, 70, 43, 16, 63, 65, 5, 25, 27, 42, 55, 26, 16, 90, 28, 92, 30, 77, 89, 45, 19, 13, 75, 23, 14, 74, 98, 23, 40], [64, 85, 59, 20, 32, 78, 24, 46, 18, 94, 92, 48, 14, 54, 21, 98, 5, 31, 67, 87, 59, 44, 64, 94, 42, 94, 38, 7, 59, 69, 70, 49, 78, 11, 2, 95, 27, 16, 64, 66, 49, 90, 16, 73, 52, 73, 5, 36, 7], [61, 96, 29, 67, 30, 40, 31, 48, 91, 6, 62, 29, 9, 54, 84, 11, 19, 74, 5, 87, 70, 95, 18, 21, 15, 59, 95, 74, 6, 24, 97, 60, 28, 92, 74, 23, 79, 46, 37, 14, 48, 78, 71, 36, 82, 60, 54, 79, 63], [97, 48, 22, 43, 41, 17, 63, 90, 79, 18, 72, 3, 54, 14, 34, 97, 1, 48, 99, 10, 83, 11, 99, 66, 3, 15, 59, 64, 47, 92, 2, 30, 38, 5, 6, 5, 12, 4, 24, 25, 26, 55, 46, 46, 43, 60, 33, 21, 87], [37, 12, 21, 13, 33, 70, 76, 61, 30, 37, 82, 16, 45, 71, 1, 53, 28, 53, 44, 67, 39, 10, 51, 14, 79, 6, 39, 80, 82, 99, 48, 25, 97, 33, 83, 75, 67, 65, 40, 25, 57, 32, 46, 4, 23, 80, 75, 22, 33], [41, 62, 38, 56, 63, 77, 85, 76, 55, 51, 90, 65, 57, 86, 27, 57, 55, 96, 72, 98, 82, 4, 65, 56, 53, 44, 16, 94, 23, 31, 28, 50, 16, 41, 9, 2, 43, 66, 96, 80, 77, 49, 91, 95, 97, 21, 19, 57, 77], [60, 19, 99, 64, 35, 33, 67, 85, 87, 48, 60, 45, 75, 68, 68, 15, 92, 72, 88, 98, 15, 23, 60, 91, 14, 2, 99, 43, 71, 16, 86, 28, 32, 71, 86, 2, 72, 7, 38, 48, 85, 86, 99, 82, 73, 2, 42, 42, 81], [20, 6, 11, 69, 74, 87, 97, 40, 36, 51, 47, 98, 17, 26, 53, 48, 27, 46, 67, 19, 72, 81, 65, 71, 36, 67, 83, 42, 91, 67, 98, 69, 49, 37, 46, 80, 56, 63, 78, 30, 96, 63, 76, 91, 26, 93, 23, 86, 20], [46, 80, 31, 67, 21, 51, 39, 63, 69, 20, 23, 96, 42, 73, 3, 27, 91, 74, 80, 24, 87, 9, 2, 6, 99, 71, 79, 21, 87, 29, 13, 69, 42, 1, 20, 43, 1, 99, 40, 7, 35, 52, 34, 50, 69, 29, 91, 71, 1], [73, 58, 65, 91, 17, 62, 96, 94, 79, 42, 28, 3, 92, 5, 66, 54, 38, 80, 44, 81, 76, 90, 57, 71, 24, 80, 82, 59, 8, 91, 90, 95, 82, 2, 41, 87, 56, 48, 22, 97, 18, 79, 41, 67, 48, 23, 2, 4, 26], [19, 49, 74, 86, 53, 6, 62, 1, 16, 52, 7, 88, 35, 78, 68, 15, 57, 23, 83, 78, 91, 86, 11, 4, 58, 96, 40, 58, 88, 98, 67, 38, 2, 87, 40, 84, 56, 72, 35, 49, 67, 96, 95, 44, 31, 65, 76, 18, 88], [36, 62, 29, 89, 23, 3, 30, 81, 45, 49, 94, 19, 64, 5, 56, 34, 73, 48, 26, 5, 88, 31, 24, 85, 22, 22, 85, 57, 30, 47, 74, 67, 39, 93, 89, 66, 77, 91, 29, 14, 4, 72, 5, 44, 91, 24, 98, 28, 24], [5, 13, 82, 55, 81, 30, 83, 86, 49, 82, 90, 15, 92, 30, 28, 84, 4, 68, 15, 34, 75, 87, 99, 43, 99, 75, 61, 63, 2, 52, 52, 15, 40, 28, 95, 96, 98, 55, 50, 22, 29, 72, 86, 12, 87, 38, 2, 12, 55], [85, 12, 95, 9, 79, 32, 73, 88, 8, 28, 56, 82, 36, 37, 32, 85, 39, 49, 93, 18, 23, 33, 73, 51, 43, 4, 80, 67, 72, 80, 2, 45, 83, 88, 80, 40, 2, 32, 1, 18, 64, 32, 9, 55, 67, 24, 11, 28, 16], [93, 12, 68, 90, 4, 75, 66, 31, 56, 50, 67, 89, 98, 1, 69, 39, 52, 95, 36, 67, 12, 61, 80, 72, 11, 14, 91, 82, 54, 8, 33, 4, 30, 84, 94, 91, 89, 54, 6, 5, 78, 51, 14, 34, 41, 89, 39, 18, 20], [8, 26, 85, 27, 32, 42, 50, 81, 49, 65, 63, 27, 75, 35, 38, 38, 42, 42, 49, 57, 54, 10, 60, 40, 1, 86, 64, 81, 12, 57, 77, 89, 26, 40, 43, 97, 72, 13, 90, 56, 17, 88, 24, 76, 95, 58, 80, 61, 80], [94, 28, 67, 97, 51, 88, 94, 92, 39, 66, 77, 74, 40, 13, 19, 6, 18, 9, 81, 68, 54, 50, 70, 11, 55, 42, 90, 11, 72, 67, 2, 82, 66, 26, 76, 37, 90, 36, 16, 78, 66, 21, 7, 11, 56, 44, 54, 93, 57], [58, 37, 48, 62, 39, 92, 64, 68, 68, 27, 70, 98, 82, 60, 44, 30, 97, 58, 84, 36, 5, 99, 19, 12, 90, 60, 83, 11, 53, 20, 73, 84, 27, 58, 5, 74, 9, 89, 77, 32, 72, 54, 45, 27, 86, 28, 18, 87, 31], [41, 34, 7, 5, 21, 6, 45, 35, 87, 3, 33, 38, 87, 80, 89, 16, 89, 71, 8, 3, 69, 19, 7, 86, 90, 50, 89, 6, 5, 61, 86, 95, 58, 22, 57, 75, 32, 17, 58, 41, 22, 80, 42, 79, 8, 46, 48, 3, 77], [30, 28, 73, 76, 25, 37, 85, 51, 39, 83, 72, 67, 86, 1, 38, 52, 63, 52, 83, 85, 60, 13, 91, 17, 84, 30, 38, 11, 27, 38, 28, 26, 33, 32, 54, 25, 24, 40, 27, 46, 86, 84, 97, 69, 93, 69, 39, 81, 29], [75, 86, 31, 65, 15, 83, 74, 9, 13, 45, 90, 6, 44, 2, 29, 48, 12, 87, 67, 50, 11, 5, 45, 74, 47, 6, 80, 95, 87, 94, 84, 89, 99, 69, 63, 67, 47, 34, 12, 27, 69, 86, 68, 28, 71, 45, 98, 2, 9], [79, 31, 36, 15, 97, 62, 31, 27, 2, 73, 43, 1, 83, 9, 60, 2, 58, 65, 12, 55, 90, 10, 65, 65, 61, 95, 75, 69, 35, 11, 68, 38, 39, 21, 36, 92, 72, 20, 43, 21, 35, 64, 32, 36, 69, 52, 4, 7, 98], [84, 71, 24, 21, 57, 73, 19, 84, 28, 32, 34, 16, 38, 81, 75, 4, 56, 40, 50, 40, 82, 49, 48, 6, 96, 5, 79, 45, 16, 17, 59, 56, 79, 35, 8, 99, 61, 27, 78, 87, 20, 57, 70, 88, 23, 76, 2, 27, 32], [93, 50, 64, 40, 33, 29, 33, 17, 74, 65, 43, 63, 81, 92, 58, 91, 43, 37, 46, 25, 98, 67, 93, 99, 51, 74, 38, 38, 1, 54, 65, 96, 22, 61, 58, 54, 19, 99, 70, 34, 79, 44, 67, 52, 22, 29, 14, 94, 62], [15, 93, 14, 67, 22, 97, 87, 7, 84, 7, 17, 32, 79, 77, 56, 62, 58, 58, 3, 89, 96, 80, 1, 67, 20, 92, 86, 62, 56, 53, 65, 56, 78, 45, 79, 96, 18, 48, 38, 22, 80, 75, 71, 73, 1, 42, 72, 75, 69], [29, 6, 56, 12, 39, 71, 12, 33, 83, 53, 19, 58, 85, 83, 43, 73, 45, 86, 19, 37, 11, 56, 25, 99, 69, 45, 62, 95, 14, 77, 34, 98, 82, 60, 64, 70, 51, 42, 21, 5, 66, 70, 61, 8, 66, 87, 62, 20, 4], [15, 94, 56, 20, 24, 9, 21, 41, 13, 5, 64, 46, 78, 71, 70, 59, 76, 51, 16, 51, 96, 42, 11, 68, 93, 52, 98, 73, 10, 72, 63, 36, 96, 45, 6, 6, 91, 66, 73, 64, 38, 69, 98, 61, 78, 74, 63, 71, 20]],34,), ([[64, 81, 37, 36, 97, 10, 34, 45, 63, 13, 25, 44, 97], [74, 24, 69, 74, 47, 91, 50, 36, 33, 92, 3, 31, 60], [29, 44, 45, 42, 21, 32, 28, 85, 47, 99, 94, 47, 17], [29, 48, 2, 33, 63, 68, 39, 89, 5, 68, 52, 52, 29], [37, 8, 20, 41, 70, 36, 32, 5, 20, 68, 22, 97, 31], [41, 93, 5, 10, 75, 37, 56, 86, 24, 85, 16, 2, 15], [41, 63, 49, 26, 94, 66, 29, 70, 60, 65, 40, 11, 52], [87, 90, 95, 79, 73, 64, 98, 81, 99, 3, 11, 28, 62], [48, 28, 46, 64, 55, 83, 2, 96, 75, 16, 11, 3, 55], [42, 29, 69, 92, 31, 77, 25, 6, 60, 67, 22, 41, 53], [60, 39, 55, 96, 30, 71, 89, 2, 8, 63, 59, 97, 28], [74, 38, 18, 62, 77, 85, 97, 23, 65, 40, 60, 85, 5], [99, 18, 38, 29, 26, 60, 36, 82, 29, 31, 63, 13, 94]],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)))
null
MINIMIZE_SUM_PRODUCT_TWO_ARRAYS_PERMUTATIONS_ALLOWED
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMIZE_SUM_PRODUCT_TWO_ARRAYS_PERMUTATIONS_ALLOWED{ static int f_gold ( int A [ ] , int B [ ] , int n ) { Arrays . sort ( A ) ; Arrays . sort ( B ) ; int result = 0 ; for ( int i = 0 ; i < n ; i ++ ) result += ( A [ i ] * B [ n - i - 1 ] ) ; return result ; }
def f_gold ( A , B , n ) : sorted ( A ) sorted ( B ) result = 0 for i in range ( n ) : result += ( A [ i ] * B [ n - i - 1 ] ) return result
using namespace std; int f_gold ( int A [ ], int B [ ], int n ) { sort ( A, A + n ); sort ( B, B + n ); int result = 0; for ( int i = 0; i < n; i ++ ) result += ( A [ i ] * B [ n - i - 1 ] ); return result; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{31,85}); param0.add(new int[]{22,-6,84,70,84,6,28,-74,-14,68,22,90,-10}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{12,33,93,2,83,9,61,84,9,69,2}); param0.add(new int[]{-92,-88,-84,-78,-78,-76,-66,-54,-52,-48,-46,-44,-40,-34,-32,-24,-20,-14,-6,-4,2,6,10,10,22,26,32,36,36,40,46,48,56,58,64,76,80,80,80,84,84,84,92}); param0.add(new int[]{1,0,1,1,0,1,1,0,1,0,0,1,1,1,0,0,0,0,0,0,1,0,1,1,0,1,0,1,1,0,0,0,1,0}); param0.add(new int[]{4,6,6,20,22,23,26,39,40,47,50,68,68,70,73,77,80,82,85}); param0.add(new int[]{78,60,-8,46,-12}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{60,66,84,99,85,89,28,97,85,71,53,93,23,9,45,26,49,95,64,33,70,34,10,1,68,39,53,12}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{18,33}); param1.add(new int[]{2,-48,-36,-4,-22,-98,-74,-92,-72,-4,48,-32,94}); param1.add(new int[]{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{85,92,92,1,54,31,69,4,39,81,52}); param1.add(new int[]{-98,-90,-82,-80,-76,-66,-62,-62,-62,-50,-50,-50,-32,-30,-14,-12,4,6,12,14,16,30,30,30,32,34,40,42,50,52,56,58,60,62,62,64,66,68,78,82,86,90,94}); param1.add(new int[]{0,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,1,1,0,1,1,0,0,1,1,0,0,0,0,1,1,1}); param1.add(new int[]{2,3,15,21,22,26,35,37,37,38,57,59,62,63,64,76,81,85,91}); param1.add(new int[]{-72,-80,-30,16,-38}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{37,33,33,77,78,34,28,1,63,15,51,50,90,22,71,23,68,55,2,22,31,54,76,36,2,27,96,89}); List<Integer> param2 = new ArrayList<>(); param2.add(1); param2.add(6); param2.add(14); param2.add(7); param2.add(26); param2.add(32); param2.add(17); param2.add(2); param2.add(17); param2.add(15); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([31, 85],[18, 33],1,), ([22, -6, 84, 70, 84, 6, 28, -74, -14, 68, 22, 90, -10],[2, -48, -36, -4, -22, -98, -74, -92, -72, -4, 48, -32, 94],6,), ([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1],[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],14,), ([12, 33, 93, 2, 83, 9, 61, 84, 9, 69, 2],[85, 92, 92, 1, 54, 31, 69, 4, 39, 81, 52],7,), ([-92, -88, -84, -78, -78, -76, -66, -54, -52, -48, -46, -44, -40, -34, -32, -24, -20, -14, -6, -4, 2, 6, 10, 10, 22, 26, 32, 36, 36, 40, 46, 48, 56, 58, 64, 76, 80, 80, 80, 84, 84, 84, 92],[-98, -90, -82, -80, -76, -66, -62, -62, -62, -50, -50, -50, -32, -30, -14, -12, 4, 6, 12, 14, 16, 30, 30, 30, 32, 34, 40, 42, 50, 52, 56, 58, 60, 62, 62, 64, 66, 68, 78, 82, 86, 90, 94],26,), ([1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0],[0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1],32,), ([4, 6, 6, 20, 22, 23, 26, 39, 40, 47, 50, 68, 68, 70, 73, 77, 80, 82, 85],[2, 3, 15, 21, 22, 26, 35, 37, 37, 38, 57, 59, 62, 63, 64, 76, 81, 85, 91],17,), ([78, 60, -8, 46, -12],[-72, -80, -30, 16, -38],2,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1],17,), ([60, 66, 84, 99, 85, 89, 28, 97, 85, 71, 53, 93, 23, 9, 45, 26, 49, 95, 64, 33, 70, 34, 10, 1, 68, 39, 53, 12],[37, 33, 33, 77, 78, 34, 28, 1, 63, 15, 51, 50, 90, 22, 71, 23, 68, 55, 2, 22, 31, 54, 76, 36, 2, 27, 96, 89],15,) ] 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 {{31,85},{22,-6,84,70,84,6,28,-74,-14,68,22,90,-10},{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},{12,33,93,2,83,9,61,84,9,69,2},{-92,-88,-84,-78,-78,-76,-66,-54,-52,-48,-46,-44,-40,-34,-32,-24,-20,-14,-6,-4,2,6,10,10,22,26,32,36,36,40,46,48,56,58,64,76,80,80,80,84,84,84,92},{1,0,1,1,0,1,1,0,1,0,0,1,1,1,0,0,0,0,0,0,1,0,1,1,0,1,0,1,1,0,0,0,1,0},{4,6,6,20,22,23,26,39,40,47,50,68,68,70,73,77,80,82,85},{78,60,-8,46,-12},{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{60,66,84,99,85,89,28,97,85,71,53,93,23,9,45,26,49,95,64,33,70,34,10,1,68,39,53,12}}; vector<vector<int>> param1 {{18,33},{2,-48,-36,-4,-22,-98,-74,-92,-72,-4,48,-32,94},{0,0,0,0,0,1,1,1,1,1,1,1,1,1,1},{85,92,92,1,54,31,69,4,39,81,52},{-98,-90,-82,-80,-76,-66,-62,-62,-62,-50,-50,-50,-32,-30,-14,-12,4,6,12,14,16,30,30,30,32,34,40,42,50,52,56,58,60,62,62,64,66,68,78,82,86,90,94},{0,1,1,1,0,0,0,0,0,1,0,1,0,0,0,0,1,0,1,1,0,1,1,0,0,1,1,0,0,0,0,1,1,1},{2,3,15,21,22,26,35,37,37,38,57,59,62,63,64,76,81,85,91},{-72,-80,-30,16,-38},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1},{37,33,33,77,78,34,28,1,63,15,51,50,90,22,71,23,68,55,2,22,31,54,76,36,2,27,96,89}}; vector<int> param2 {1,6,14,7,26,32,17,2,17,15}; 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; }
AREA_CIRCUMSCRIBED_CIRCLE_SQUARE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class AREA_CIRCUMSCRIBED_CIRCLE_SQUARE{ static float f_gold ( float a ) { float PI = 3.14159265f ; return ( a * a * ( PI / 2 ) ) ; }
null
null
public static void main(String args[]) { int n_success = 0; List<Float> param0 = new ArrayList<>(); param0.add(3296.590241413969F); param0.add(-1688.6061770081972F); param0.add(1571.9067680023313F); param0.add(-3117.129927920369F); param0.add(8561.027934208052F); param0.add(-5052.211066243729F); param0.add(3601.752337206948F); param0.add(-651.9008970363393F); param0.add(4415.044414999076F); param0.add(-1453.219956352866F); for(int i = 0; i < param0.size(); ++i) { if(Math.abs(1 - (0.0000001 + Math.abs(f_gold(param0.get(i))) )/ (Math.abs(f_filled(param0.get(i))) + 0.0000001)) < 0.001F) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
null
MINIMUM_INCREMENT_K_OPERATIONS_MAKE_ELEMENTS_EQUAL
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_INCREMENT_K_OPERATIONS_MAKE_ELEMENTS_EQUAL{ static int f_gold ( int arr [ ] , int n , int k ) { Arrays . sort ( arr ) ; int max = arr [ arr . length - 1 ] ; int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( max - arr [ i ] ) % k != 0 ) return - 1 ; else res += ( max - arr [ i ] ) / k ; } return res ; }
def f_gold ( arr , n , k ) : max1 = max ( arr ) res = 0 for i in range ( 0 , n ) : if ( ( max1 - arr [ i ] ) % k != 0 ) : return - 1 else : res += ( max1 - arr [ i ] ) / k return int ( res )
using namespace std; int f_gold ( int arr [ ], int n, int k ) { int max = * max_element ( arr, arr + n ); int res = 0; for ( int i = 0; i < n; i ++ ) { if ( ( max - arr [ i ] ) % k != 0 ) return - 1; else res += ( max - arr [ i ] ) / k; } return res; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4, 7, 19, 16}); param0.add(new int[]{4,4,4,4,4}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{85,36,52,8,52,15,16}); param0.add(new int[]{-10,-5,-5,-20,10,30}); param0.add(new int[]{0,1,0,0,1,1,1,0,0,0,0,1,1,0,0,1,0}); param0.add(new int[]{1,5,5,9,11,12,12,13,13,14,16,18,26,26,28,28,30,31,32,37,37,38,40,43,44,45,47,47,55,58,60,62,63,64,69,78,83,84,92,96,96,99}); param0.add(new int[]{76,-78,92,-98,16,44,86,96,-8,2,-96,74,-28,12,54,-40,-64,-12,4,48,68,-82,8,0,-4,88,48,-54,90,62,-84,76,-48,62,-80,-94,38,-4,36}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{62,99,29,23,55,30,79,63,1,88,59,8,11,80,23,51,97,32,80,48,84,36,73,59,1,34,92,10}); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(5); param1.add(39); param1.add(5); param1.add(6); param1.add(10); param1.add(26); param1.add(34); param1.add(39); param1.add(18); List<Integer> param2 = new ArrayList<>(); param2.add(3); param2.add(3); param2.add(1); param2.add(6); param2.add(5); param2.add(15); param2.add(33); param2.add(3); param2.add(10); param2.add(1); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([4, 7, 19, 16],4,3), ([4,4,4,4,4],5,3), ([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],39,1), ([85,36,52,8,52,15,16],5,6), ([-10,-5,-5,-20,10,30],6,5), ([0,1,0,0,1,1,1,0,0,0,0,1,1,0,0,1,0],10,15), ([1,5,5,9,11,12,12,13,13,14,16,18,26,26,28,28,30,31,32,37,37,38,40,43,44,45,47,47,55,58,60,62,63,64,69,78,83,84,92,96,96,99],26,33), ([76,-78,92,-98,16,44,86,96,-8,2,-96,74,-28,12,54,-40,-64,-12,4,48,68,-82,8,0,-4,88,48,-54,90,62,-84,76,-48,62,-80,-94,38,-4,36],34,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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],39,10), ([62,99,29,23,55,30,79,63,1,88,59,8,11,80,23,51,97,32,80,48,84,36,73,59,1,34,92,10],18,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, 7, 19, 16},{4,4,4,4,4},{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},{85,36,52,8,52,15,16},{-10,-5,-5,-20,10,30},{0,1,0,0,1,1,1,0,0,0,0,1,1,0,0,1,0},{1,5,5,9,11,12,12,13,13,14,16,18,26,26,28,28,30,31,32,37,37,38,40,43,44,45,47,47,55,58,60,62,63,64,69,78,83,84,92,96,96,99},{76,-78,92,-98,16,44,86,96,-8,2,-96,74,-28,12,54,-40,-64,-12,4,48,68,-82,8,0,-4,88,48,-54,90,62,-84,76,-48,62,-80,-94,38,-4,36},{0,0,0,0,0,0,0,0,0,0,0,0,0,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},{62,99,29,23,55,30,79,63,1,88,59,8,11,80,23,51,97,32,80,48,84,36,73,59,1,34,92,10}}; vector<int> param1 {4,5,39,5,6,10,26,34,39,18}; vector<int> param2 {3,3,1,6,5,15,33,3,10,1}; 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; }
RECURSIVELY_BREAK_NUMBER_3_PARTS_GET_MAXIMUM_SUM
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class RECURSIVELY_BREAK_NUMBER_3_PARTS_GET_MAXIMUM_SUM{ static int f_gold ( int n ) { if ( n == 0 || n == 1 ) return n ; return Math . max ( ( f_gold ( n / 2 ) + f_gold ( n / 3 ) + f_gold ( n / 4 ) ) , n ) ; }
def f_gold ( n ) : if ( n == 0 or n == 1 ) : return n return max ( ( f_gold ( n // 2 ) + f_gold ( n // 3 ) + f_gold ( n // 4 ) ) , n )
using namespace std; int f_gold ( int n ) { if ( n == 0 || n == 1 ) return n; return max ( ( f_gold ( n / 2 ) + f_gold ( n / 3 ) + f_gold ( n / 4 ) ), n ); }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(39); param0.add(79); param0.add(7); param0.add(76); param0.add(48); param0.add(18); param0.add(58); param0.add(17); param0.add(36); param0.add(5); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (39,), (79,), (7,), (76,), (48,), (18,), (58,), (17,), (36,), (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 {39,79,7,76,48,18,58,17,36,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; }
MAXIMUM_SUM_SUBARRAY_REMOVING_ONE_ELEMENT
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_SUM_SUBARRAY_REMOVING_ONE_ELEMENT{ static int f_gold ( int arr [ ] , int n ) { int fw [ ] = new int [ n ] ; int bw [ ] = new int [ n ] ; int cur_max = arr [ 0 ] , max_so_far = arr [ 0 ] ; fw [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { cur_max = Math . max ( arr [ i ] , cur_max + arr [ i ] ) ; max_so_far = Math . max ( max_so_far , cur_max ) ; fw [ i ] = cur_max ; } cur_max = max_so_far = bw [ n - 1 ] = arr [ n - 1 ] ; for ( int i = n - 2 ; i >= 0 ; i -- ) { cur_max = Math . max ( arr [ i ] , cur_max + arr [ i ] ) ; max_so_far = Math . max ( max_so_far , cur_max ) ; bw [ i ] = cur_max ; } int fans = max_so_far ; for ( int i = 1 ; i < n - 1 ; i ++ ) fans = Math . max ( fans , fw [ i - 1 ] + bw [ i + 1 ] ) ; return fans ; }
def f_gold ( arr , n ) : fw = [ 0 for k in range ( n ) ] bw = [ 0 for k in range ( n ) ] cur_max , max_so_far = arr [ 0 ] , arr [ 0 ] for i in range ( n ) : cur_max = max ( arr [ i ] , cur_max + arr [ i ] ) max_so_far = max ( max_so_far , cur_max ) fw [ i ] = cur_max cur_max = max_so_far = bw [ n - 1 ] = arr [ n - 1 ] i = n - 2 while i >= 0 : cur_max = max ( arr [ i ] , cur_max + arr [ i ] ) max_so_far = max ( max_so_far , cur_max ) bw [ i ] = cur_max i -= 1 fans = max_so_far for i in range ( 1 , n - 1 ) : fans = max ( fans , fw [ i - 1 ] + bw [ i + 1 ] ) return fans
using namespace std; int f_gold ( int arr [ ], int n ) { int fw [ n ], bw [ n ]; int cur_max = arr [ 0 ], max_so_far = arr [ 0 ]; fw [ 0 ] = arr [ 0 ]; for ( int i = 1; i < n; i ++ ) { cur_max = max ( arr [ i ], cur_max + arr [ i ] ); max_so_far = max ( max_so_far, cur_max ); fw [ i ] = cur_max; } cur_max = max_so_far = bw [ n - 1 ] = arr [ n - 1 ]; for ( int i = n - 2; i >= 0; i -- ) { cur_max = max ( arr [ i ], cur_max + arr [ i ] ); max_so_far = max ( max_so_far, cur_max ); bw [ i ] = cur_max; } int fans = max_so_far; for ( int i = 1; i < n - 1; i ++ ) fans = max ( fans, fw [ i - 1 ] + bw [ i + 1 ] ); return fans; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,8,14,17,19,35,38,45,50,53,55,70,82,88,92,96}); param0.add(new int[]{-64,-56,-80,-82,72,62,-8,48,-96,34,64,-38,-60,80,4,-64,-62,34,94,-16,38,62,-84,48,42,-40}); param0.add(new int[]{0,0,0,0,1,1,1}); param0.add(new int[]{3,7,50,53,72,14,18,74,27,65,41,20,54,17,87,40,63,15,47}); param0.add(new int[]{-96,-96,-94,-80,-74,-74,-74,-74,-70,-64,-60,-58,-52,-52,-44,-42,-40,-38,-36,-34,-30,-14,-12,-8,-2,6,12,16,24,24,48,48,66,76,76,84,90}); param0.add(new int[]{1,1,0,1,1,1,1,0,0,0,1,0,1,0,0}); param0.add(new int[]{4,4,5,9,11,13,13,15,16,21,23,25,27,30,31,35,35,43,43,47,49,50,52,54,55,55,57,57,57,59,62,64,66,68,69,71,73,76,80,84,88,88,90,90,97,97,99}); param0.add(new int[]{-86,-60,4,14,6,-6,-50,46,-50,-62,-56,16,-76,90,40,2,36,48,-26,34,78,84,2,-54,94,60,-26,60,84,2,-98,2,-74}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}); param0.add(new int[]{36,99,27,8,90,74,67,77,49,23,43,25,68,56,85,6}); List<Integer> param1 = new ArrayList<>(); param1.add(13); param1.add(22); param1.add(6); param1.add(11); param1.add(32); param1.add(8); param1.add(34); param1.add(25); param1.add(9); param1.add(12); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([2, 8, 14, 17, 19, 35, 38, 45, 50, 53, 55, 70, 82, 88, 92, 96],13,), ([-64, -56, -80, -82, 72, 62, -8, 48, -96, 34, 64, -38, -60, 80, 4, -64, -62, 34, 94, -16, 38, 62, -84, 48, 42, -40],22,), ([0, 0, 0, 0, 1, 1, 1],6,), ([3, 7, 50, 53, 72, 14, 18, 74, 27, 65, 41, 20, 54, 17, 87, 40, 63, 15, 47],11,), ([-96, -96, -94, -80, -74, -74, -74, -74, -70, -64, -60, -58, -52, -52, -44, -42, -40, -38, -36, -34, -30, -14, -12, -8, -2, 6, 12, 16, 24, 24, 48, 48, 66, 76, 76, 84, 90],32,), ([1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0],8,), ([4, 4, 5, 9, 11, 13, 13, 15, 16, 21, 23, 25, 27, 30, 31, 35, 35, 43, 43, 47, 49, 50, 52, 54, 55, 55, 57, 57, 57, 59, 62, 64, 66, 68, 69, 71, 73, 76, 80, 84, 88, 88, 90, 90, 97, 97, 99],34,), ([-86, -60, 4, 14, 6, -6, -50, 46, -50, -62, -56, 16, -76, 90, 40, 2, 36, 48, -26, 34, 78, 84, 2, -54, 94, 60, -26, 60, 84, 2, -98, 2, -74],25,), ([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],9,), ([36, 99, 27, 8, 90, 74, 67, 77, 49, 23, 43, 25, 68, 56, 85, 6],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,8,14,17,19,35,38,45,50,53,55,70,82,88,92,96},{-64,-56,-80,-82,72,62,-8,48,-96,34,64,-38,-60,80,4,-64,-62,34,94,-16,38,62,-84,48,42,-40},{0,0,0,0,1,1,1},{3,7,50,53,72,14,18,74,27,65,41,20,54,17,87,40,63,15,47},{-96,-96,-94,-80,-74,-74,-74,-74,-70,-64,-60,-58,-52,-52,-44,-42,-40,-38,-36,-34,-30,-14,-12,-8,-2,6,12,16,24,24,48,48,66,76,76,84,90},{1,1,0,1,1,1,1,0,0,0,1,0,1,0,0},{4,4,5,9,11,13,13,15,16,21,23,25,27,30,31,35,35,43,43,47,49,50,52,54,55,55,57,57,57,59,62,64,66,68,69,71,73,76,80,84,88,88,90,90,97,97,99},{-86,-60,4,14,6,-6,-50,46,-50,-62,-56,16,-76,90,40,2,36,48,-26,34,78,84,2,-54,94,60,-26,60,84,2,-98,2,-74},{0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1},{36,99,27,8,90,74,67,77,49,23,43,25,68,56,85,6}}; vector<int> param1 {13,22,6,11,32,8,34,25,9,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; }
NUMBER_IS_DIVISIBLE_BY_29_OR_NOT
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_IS_DIVISIBLE_BY_29_OR_NOT{ static boolean f_gold ( long n ) { while ( n / 100 > 0 ) { int last_digit = ( int ) n % 10 ; n /= 10 ; n += last_digit * 3 ; } return ( n % 29 == 0 ) ; }
def f_gold ( n ) : while ( int ( n / 100 ) ) : last_digit = int ( n % 10 ) n = int ( n / 10 ) n += last_digit * 3 return ( n % 29 == 0 )
using namespace std; bool f_gold ( long long int n ) { while ( n / 100 ) { int last_digit = n % 10; n /= 10; n += last_digit * 3; } return ( n % 29 == 0 ); }
public static void main(String args[]) { int n_success = 0; List<Long> param0 = new ArrayList<>(); param0.add(29L); param0.add(0L); param0.add(65L); param0.add(1419L); param0.add(54L); param0.add(7L); param0.add(44L); param0.add(34L); param0.add(1160L); param0.add(292929002929L); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (29,), (0,), (65,), (1419,), (54,), (7,), (44,), (34,), (1160,), (292929002929,) ] 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 {50,11,65,32,8,54,7,44,34,63}; 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_PRODUCT_SUBSET_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MINIMUM_PRODUCT_SUBSET_ARRAY{ static int f_gold ( int a [ ] , int n ) { if ( n == 1 ) return a [ 0 ] ; int negmax = Integer . MIN_VALUE ; int posmin = Integer . MAX_VALUE ; int count_neg = 0 , count_zero = 0 ; int product = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] == 0 ) { count_zero ++ ; continue ; } if ( a [ i ] < 0 ) { count_neg ++ ; negmax = Math . max ( negmax , a [ i ] ) ; } if ( a [ i ] > 0 && a [ i ] < posmin ) posmin = a [ i ] ; product *= a [ i ] ; } if ( count_zero == n || ( count_neg == 0 && count_zero > 0 ) ) return 0 ; if ( count_neg == 0 ) return posmin ; if ( count_neg % 2 == 0 && count_neg != 0 ) { product = product / negmax ; } return product ; }
def f_gold ( a , n ) : if ( n == 1 ) : return a [ 0 ] max_neg = float ( '-inf' ) min_pos = float ( 'inf' ) count_neg = 0 count_zero = 0 prod = 1 for i in range ( 0 , n ) : if ( a [ i ] == 0 ) : count_zero = count_zero + 1 continue if ( a [ i ] < 0 ) : count_neg = count_neg + 1 max_neg = max ( max_neg , a [ i ] ) if ( a [ i ] > 0 ) : min_pos = min ( min_pos , a [ i ] ) prod = prod * a [ i ] if ( count_zero == n or ( count_neg == 0 and count_zero > 0 ) ) : return 0 ; if ( count_neg == 0 ) : return min_pos if ( ( count_neg & 1 ) == 0 and count_neg != 0 ) : prod = int ( prod / max_neg ) return prod ;
using namespace std; int f_gold ( int a [ ], int n ) { if ( n == 1 ) return a [ 0 ]; int max_neg = INT_MIN; int min_pos = INT_MAX; int count_neg = 0, count_zero = 0; int prod = 1; for ( int i = 0; i < n; i ++ ) { if ( a [ i ] == 0 ) { count_zero ++; continue; } if ( a [ i ] < 0 ) { count_neg ++; max_neg = max ( max_neg, a [ i ] ); } if ( a [ i ] > 0 ) min_pos = min ( min_pos, a [ i ] ); prod = prod * a [ i ]; } if ( count_zero == n || ( count_neg == 0 && count_zero > 0 ) ) return 0; if ( count_neg == 0 ) return min_pos; if ( ! ( count_neg & 1 ) && count_neg != 0 ) { prod = prod / max_neg; } return prod; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{3,6,7,8,8,9,12,12,12,13,15,15,15,16,18,18,18,19,20,21,22,22,23,28,29,30,30,33,33,35,35,36,40,43,58,63,73,78,82,83,84,87,89,89,92,94}); param0.add(new int[]{18,-6,-8,98,66,-86,24,6,58,74,82}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{97,79,93,41,76,34,94,57,63,98,52,62,96,7,63,44,55,43,36,66,35,14,24,40,26,16,67,19,31,86,64,93,85,86,66,24,73,86,45,99,25,98,38,57}); param0.add(new int[]{-58,-48,-46,-36,0,18}); param0.add(new int[]{1,1,1,0,0,0,1,0,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,0}); param0.add(new int[]{1,3,5,15,18,19,21,23,29,29,33,33,34,37,39,43,43,68,73,74,75,84,87,88,89,90,93}); param0.add(new int[]{74,70,-36,16,10,60,-82,96,-30,58,56,-54,-14,94,10,-82,-80,-40,-72,-68,8,38,-50,-76,34,2,-66,-30,26}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{74,74,8,74,85,41,31,3,84,46,73,39,64,72,28,83,98,27,64,7,95,37,10,38,77,32,69,72,62,96,5,81,34,96,80,25,38}); List<Integer> param1 = new ArrayList<>(); param1.add(23); param1.add(10); param1.add(25); param1.add(30); param1.add(3); param1.add(36); param1.add(18); param1.add(15); param1.add(20); param1.add(33); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([3, 6, 7, 8, 8, 9, 12, 12, 12, 13, 15, 15, 15, 16, 18, 18, 18, 19, 20, 21, 22, 22, 23, 28, 29, 30, 30, 33, 33, 35, 35, 36, 40, 43, 58, 63, 73, 78, 82, 83, 84, 87, 89, 89, 92, 94],23,), ([18, -6, -8, 98, 66, -86, 24, 6, 58, 74, 82],10,), ([0, 0, 0, 0, 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],25,), ([97, 79, 93, 41, 76, 34, 94, 57, 63, 98, 52, 62, 96, 7, 63, 44, 55, 43, 36, 66, 35, 14, 24, 40, 26, 16, 67, 19, 31, 86, 64, 93, 85, 86, 66, 24, 73, 86, 45, 99, 25, 98, 38, 57],30,), ([-58, -48, -46, -36, 0, 18],3,), ([1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0],36,), ([1, 3, 5, 15, 18, 19, 21, 23, 29, 29, 33, 33, 34, 37, 39, 43, 43, 68, 73, 74, 75, 84, 87, 88, 89, 90, 93],18,), ([74, 70, -36, 16, 10, 60, -82, 96, -30, 58, 56, -54, -14, 94, 10, -82, -80, -40, -72, -68, 8, 38, -50, -76, 34, 2, -66, -30, 26],15,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],20,), ([74, 74, 8, 74, 85, 41, 31, 3, 84, 46, 73, 39, 64, 72, 28, 83, 98, 27, 64, 7, 95, 37, 10, 38, 77, 32, 69, 72, 62, 96, 5, 81, 34, 96, 80, 25, 38],33,) ] 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,6,7,8,8,9,12,12,12,13,15,15,15,16,18,18,18,19,20,21,22,22,23,28,29,30,30,33,33,35,35,36,40,43,58,63,73,78,82,83,84,87,89,89,92,94},{18,-6,-8,98,66,-86,24,6,58,74,82},{0,0,0,0,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},{97,79,93,41,76,34,94,57,63,98,52,62,96,7,63,44,55,43,36,66,35,14,24,40,26,16,67,19,31,86,64,93,85,86,66,24,73,86,45,99,25,98,38,57},{-58,-48,-46,-36,0,18},{1,1,1,0,0,0,1,0,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,0},{1,3,5,15,18,19,21,23,29,29,33,33,34,37,39,43,43,68,73,74,75,84,87,88,89,90,93},{74,70,-36,16,10,60,-82,96,-30,58,56,-54,-14,94,10,-82,-80,-40,-72,-68,8,38,-50,-76,34,2,-66,-30,26},{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1},{74,74,8,74,85,41,31,3,84,46,73,39,64,72,28,83,98,27,64,7,95,37,10,38,77,32,69,72,62,96,5,81,34,96,80,25,38}}; vector<int> param1 {23,10,25,30,3,36,18,15,20,33}; 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; }
PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD{ static boolean f_gold ( int n ) { if ( n <= 1 ) return false ; for ( int i = 2 ; i < n ; i ++ ) if ( n % i == 0 ) return false ; return true ; }
def f_gold ( n ) : if n <= 1 : return False for i in range ( 2 , n ) : if n % i == 0 : return False ; return True
using namespace std; bool f_gold ( int n ) { if ( n <= 1 ) return false; for ( int i = 2; i < n; i ++ ) if ( n % i == 0 ) return false; return true; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(37); param0.add(39); param0.add(73); param0.add(8); param0.add(28); param0.add(66); param0.add(20); param0.add(36); param0.add(6); param0.add(51); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (37,), (39,), (73,), (8,), (28,), (66,), (20,), (36,), (6,), (51,) ] 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,39,73,8,28,66,20,36,6,51}; 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; }
FIRST_UPPERCASE_LETTER_IN_A_STRING_ITERATIVE_AND_RECURSIVE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIRST_UPPERCASE_LETTER_IN_A_STRING_ITERATIVE_AND_RECURSIVE{ static char f_gold ( String str ) { for ( int i = 0 ; i < str . length ( ) ; i ++ ) if ( Character . isUpperCase ( str . charAt ( i ) ) ) return str . charAt ( i ) ; return 0 ; }
def f_gold ( str ) : for i in range ( 0 , len ( str ) ) : if ( str [ i ].istitle ( ) ) : return str [ i ] return 0
using namespace std; char f_gold ( string str ) { for ( int i = 0; i < str . length ( ); i ++ ) if ( isupper ( str [ i ] ) ) return str [ i ]; return 0; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("pH"); param0.add("96544000"); param0.add("000010000"); param0.add("ujqpx"); param0.add("20684847994"); param0.add("111"); param0.add("rclkv"); param0.add("45173693434"); param0.add("11111011001101"); param0.add("f"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('pH',), ('96544000',), ('000010000',), ('ujqpx',), ('20684847994',), ('111',), ('rclkv',), ('45173693434',), ('11111011001101',), ('f',) ] 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 {"pH","96544000","000010000","ujqpx","20684847994","111","rclkv","45173693434","11111011001101","f"}; 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_COUNT_OCCURRENCE_GIVEN_CHARACTER_STRING
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_COUNT_OCCURRENCE_GIVEN_CHARACTER_STRING{ public static int f_gold ( String s , char c ) { int res = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == c ) res ++ ; } return res ; }
def f_gold ( s , c ) : res = 0 for i in range ( len ( s ) ) : if ( s [ i ] == c ) : res = res + 1 return res
using namespace std; int f_gold ( string s, char c ) { int res = 0; for ( int i = 0; i < s . length ( ); i ++ ) if ( s [ i ] == c ) res ++; return res; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("mhjnKfd"); param0.add("716662107"); param0.add("01"); param0.add("wPHSxIbnHakGRO"); param0.add("721106"); param0.add("111"); param0.add("TIBFU"); param0.add("0"); param0.add("10"); param0.add("lqq"); List<Character> param1 = new ArrayList<>(); param1.add('l'); param1.add('6'); param1.add('1'); param1.add('n'); param1.add('8'); param1.add('0'); param1.add('Q'); param1.add('3'); param1.add('0'); param1.add('d'); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('mhjnKfd','l',), ('716662107','6',), ('01','1',), ('wPHSxIbnHakGRO','n',), ('721106','8',), ('111','0',), ('TIBFU','Q',), ('0','3',), ('10','0',), ('lqq','d',) ] 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 {"mhjnKfd","716662107","01","wPHSxIbnHakGRO","721106","111","TIBFU","0","10","lqq"}; vector<char> param1 {'l','6','1','n','8','0','Q','3','0','d'}; 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_ODD_FACTORS_NUMBER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_SUM_ODD_FACTORS_NUMBER{ static int f_gold ( int n ) { int res = 1 ; while ( n % 2 == 0 ) n = n / 2 ; for ( int i = 3 ; i <= Math . sqrt ( n ) ; i ++ ) { int count = 0 , curr_sum = 1 ; int curr_term = 1 ; while ( n % i == 0 ) { count ++ ; n = n / i ; curr_term *= i ; curr_sum += curr_term ; } res *= curr_sum ; } if ( n >= 2 ) res *= ( 1 + n ) ; return res ; }
import math def f_gold ( n ) : res = 1 while n % 2 == 0 : n = n // 2 for i in range ( 3 , int ( math.sqrt ( n ) + 1 ) ) : count = 0 curr_sum = 1 curr_term = 1 while n % i == 0 : count += 1 n = n // i curr_term *= i curr_sum += curr_term res *= curr_sum if n >= 2 : res *= ( 1 + n ) return res
using namespace std; int f_gold ( int n ) { int res = 1; while ( n % 2 == 0 ) n = n / 2; for ( int i = 3; i <= sqrt ( n ); i ++ ) { int count = 0, curr_sum = 1; int curr_term = 1; while ( n % i == 0 ) { count ++; n = n / i; curr_term *= i; curr_sum += curr_term; } res *= curr_sum; } if ( n >= 2 ) res *= ( 1 + n ); return res; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(20); param0.add(6); param0.add(39); param0.add(80); param0.add(88); param0.add(7); param0.add(16); param0.add(27); param0.add(83); param0.add(6); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (20,), (6,), (39,), (80,), (88,), (7,), (16,), (27,), (83,), (6,) ] 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 {20,6,39,80,88,7,16,27,83,6}; 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_13_NOT
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class CHECK_LARGE_NUMBER_DIVISIBLE_13_NOT{ static boolean f_gold ( String num ) { int length = num . length ( ) ; if ( length == 1 && num . charAt ( 0 ) == '0' ) return true ; if ( length % 3 == 1 ) { num += "00" ; length += 2 ; } else if ( length % 3 == 2 ) { num += "0" ; length += 1 ; } int sum = 0 , p = 1 ; for ( int i = length - 1 ; i >= 0 ; i -- ) { int group = 0 ; group += num . charAt ( i -- ) - '0' ; group += ( num . charAt ( i -- ) - '0' ) * 10 ; group += ( num . charAt ( i ) - '0' ) * 100 ; sum = sum + group * p ; p *= ( - 1 ) ; } sum = Math . abs ( sum ) ; return ( sum % 13 == 0 ) ; }
def f_gold ( num ) : length = len ( num ) if ( length == 1 and num [ 0 ] == '0' ) : return True if ( length % 3 == 1 ) : num = str ( num ) + "00" length += 2 elif ( length % 3 == 2 ) : num = str ( num ) + "0" length += 1 sum = 0 p = 1 for i in range ( length - 1 , - 1 , - 1 ) : group = 0 group += ord ( num [ i ] ) - ord ( '0' ) i -= 1 group += ( ord ( num [ i ] ) - ord ( '0' ) ) * 10 i -= 1 group += ( ord ( num [ i ] ) - ord ( '0' ) ) * 100 sum = sum + group * p p *= ( - 1 ) sum = abs ( sum ) return ( sum % 13 == 0 )
using namespace std; bool f_gold ( string num ) { int length = num . size ( ); if ( length == 1 && num [ 0 ] == '0' ) return true; if ( length % 3 == 1 ) { num += "00"; length += 2; } else if ( length % 3 == 2 ) { num += "0"; length += 1; } int sum = 0, p = 1; for ( int i = length - 1; i >= 0; i -- ) { int group = 0; group += num [ i -- ] - '0'; group += ( num [ i -- ] - '0' ) * 10; group += ( num [ i ] - '0' ) * 100; sum = sum + group * p; p *= ( - 1 ); } sum = abs ( sum ); return ( sum % 13 == 0 ); }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("vzTUaItpCpLnjY"); param0.add("33855"); param0.add("0011110101011"); param0.add("MMQ"); param0.add("439340517954"); param0.add("000000000"); param0.add("UugAuRRJbjEgl"); param0.add("6406553695441"); param0.add("011001"); param0.add("yjFqEEvgiNjEX"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('vzTUaItpCpLnjY',), ('33855',), ('0011110101011',), ('MMQ',), ('439340517954',), ('000000000',), ('UugAuRRJbjEgl',), ('6406553695441',), ('011001',), ('yjFqEEvgiNjEX',) ] 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 {"vzTUaItpCpLnjY","33855","0011110101011","MMQ","439340517954","000000000","UugAuRRJbjEgl","6406553695441","011001","yjFqEEvgiNjEX"}; 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; }
LARGEST_SUBSEQUENCE_GCD_GREATER_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class LARGEST_SUBSEQUENCE_GCD_GREATER_1{ static int f_gold ( int arr [ ] , int n ) { int ans = 0 ; int maxele = Arrays . stream ( arr ) . max ( ) . getAsInt ( ) ; ; for ( int i = 2 ; i <= maxele ; ++ i ) { int count = 0 ; for ( int j = 0 ; j < n ; ++ j ) { if ( arr [ j ] % i == 0 ) ++ count ; } ans = Math . max ( ans , count ) ; } return ans ; }
def f_gold ( arr , n ) : ans = 0 maxele = max ( arr ) for i in range ( 2 , maxele + 1 ) : count = 0 for j in range ( n ) : if ( arr [ j ] % i == 0 ) : count += 1 ans = max ( ans , count ) return ans
using namespace std; int f_gold ( int arr [ ], int n ) { int ans = 0; int maxele = * max_element ( arr, arr + n ); for ( int i = 2; i <= maxele; ++ i ) { int count = 0; for ( int j = 0; j < n; ++ j ) { if ( arr [ j ] % i == 0 ) ++ count; } ans = max ( ans, count ); } return ans; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{10,18,22,22,22,29,30,32,33,34,37,39,40,41,44,47,49,50,50,51,53,67,69,70,71,71,73,75,78,80,81,82,91,91,93,97,97,99}); param0.add(new int[]{-42,62,6,98,38,-4,-38,72,42,4,-22,-94,78,-90,14}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{89,92,96,71,24,27,18,19,41,1,45,8}); param0.add(new int[]{-98,-94,-92,-90,-82,-80,-76,-76,-72,-62,-60,-58,-56,-52,-42,-36,-32,-32,-24,-22,-20,-10,-10,-10,-8,-2,-2,0,2,4,6,6,8,10,14,18,22,26,30,46,46,62,68,74,78,82,86,86}); param0.add(new int[]{1,0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1,0,1,1,1,0,0,0,0,1,0,1,0,0,0,1}); param0.add(new int[]{4,8,10,10,11,17,18,25,32,33,34,37,40,41,44,47,47,52,63,77,85,87,89,89,91,95,96,98}); param0.add(new int[]{-86,52,-48,70,10,-94,16,14,38,62}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{95,32,87,37,86,71,30,88,96,52,88,92,79,86,19,5,74,67}); List<Integer> param1 = new ArrayList<>(); param1.add(35); param1.add(10); param1.add(23); param1.add(7); param1.add(40); param1.add(41); param1.add(23); param1.add(9); param1.add(30); param1.add(13); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([10, 18, 22, 22, 22, 29, 30, 32, 33, 34, 37, 39, 40, 41, 44, 47, 49, 50, 50, 51, 53, 67, 69, 70, 71, 71, 73, 75, 78, 80, 81, 82, 91, 91, 93, 97, 97, 99],35,), ([-42, 62, 6, 98, 38, -4, -38, 72, 42, 4, -22, -94, 78, -90, 14],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],23,), ([89, 92, 96, 71, 24, 27, 18, 19, 41, 1, 45, 8],7,), ([-98, -94, -92, -90, -82, -80, -76, -76, -72, -62, -60, -58, -56, -52, -42, -36, -32, -32, -24, -22, -20, -10, -10, -10, -8, -2, -2, 0, 2, 4, 6, 6, 8, 10, 14, 18, 22, 26, 30, 46, 46, 62, 68, 74, 78, 82, 86, 86],40,), ([1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1],41,), ([4, 8, 10, 10, 11, 17, 18, 25, 32, 33, 34, 37, 40, 41, 44, 47, 47, 52, 63, 77, 85, 87, 89, 89, 91, 95, 96, 98],23,), ([-86, 52, -48, 70, 10, -94, 16, 14, 38, 62],9,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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],30,), ([95, 32, 87, 37, 86, 71, 30, 88, 96, 52, 88, 92, 79, 86, 19, 5, 74, 67],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 {{10,18,22,22,22,29,30,32,33,34,37,39,40,41,44,47,49,50,50,51,53,67,69,70,71,71,73,75,78,80,81,82,91,91,93,97,97,99},{-42,62,6,98,38,-4,-38,72,42,4,-22,-94,78,-90,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,1,1,1,1},{89,92,96,71,24,27,18,19,41,1,45,8},{-98,-94,-92,-90,-82,-80,-76,-76,-72,-62,-60,-58,-56,-52,-42,-36,-32,-32,-24,-22,-20,-10,-10,-10,-8,-2,-2,0,2,4,6,6,8,10,14,18,22,26,30,46,46,62,68,74,78,82,86,86},{1,0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1,0,1,1,1,0,0,0,0,1,0,1,0,0,0,1},{4,8,10,10,11,17,18,25,32,33,34,37,40,41,44,47,47,52,63,77,85,87,89,89,91,95,96,98},{-86,52,-48,70,10,-94,16,14,38,62},{0,0,0,0,0,0,0,0,0,0,0,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},{95,32,87,37,86,71,30,88,96,52,88,92,79,86,19,5,74,67}}; vector<int> param1 {35,10,23,7,40,41,23,9,30,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; }
PRINT_WORDS_STRING_REVERSE_ORDER
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PRINT_WORDS_STRING_REVERSE_ORDER{ static String f_gold ( String str ) { int i = str . length ( ) - 1 ; int start , end = i + 1 ; String result = "" ; while ( i >= 0 ) { if ( str . charAt ( i ) == ' ' ) { start = i + 1 ; while ( start != end ) result += str . charAt ( start ++ ) ; result += ' ' ; end = i ; } i -- ; } start = 0 ; while ( start != end ) result += str . charAt ( start ++ ) ; return result ; }
def f_gold ( str ) : i = len ( str ) - 1 start = end = i + 1 result = '' while i >= 0 : if str [ i ] == ' ' : start = i + 1 while start != end : result += str [ start ] start += 1 result += ' ' end = i i -= 1 start = 0 while start != end : result += str [ start ] start += 1 return result
using namespace std; string f_gold ( string str ) { int i = str . length ( ) - 1; int start, end = i + 1; string result = ""; while ( i >= 0 ) { if ( str [ i ] == ' ' ) { start = i + 1; while ( start != end ) result += str [ start ++ ]; result += ' '; end = i; } i --; } start = 0; while ( start != end ) result += str [ start ++ ]; return result; }
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("m Dm YZ"); param0.add("65 48 57 71"); param0.add("01 010"); param0.add("mT vhByi"); param0.add("19 44 9 1"); param0.add("0"); param0.add("z vUi "); param0.add("7 591 36643 9 055"); param0.add("01"); param0.add("ti YGaijPY"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)).equals(f_gold(param0.get(i)))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('m Dm YZ',), ('65 48 57 71',), ('01 010',), ('mT vhByi',), ('19 44 9 1',), ('0',), ('z vUi ',), ('7 591 36643 9 055',), ('01',), ('ti YGaijPY',) ] 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 { "m Dm YZ", "65 48 57 71", "01 010", "mT vhByi", "19 44 9 1", "0", "z vUi ", "7 591 36643 9 055", "01", "ti YGaijPY" }; 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_DECIMAL_BINARY_CONVERSION_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PROGRAM_DECIMAL_BINARY_CONVERSION_2{ static int f_gold ( int N ) { int B_Number = 0 ; int cnt = 0 ; while ( N != 0 ) { int rem = N % 2 ; double c = Math . pow ( 10 , cnt ) ; B_Number += rem * c ; N /= 2 ; cnt ++ ; } return B_Number ; }
def f_gold ( N ) : B_Number = 0 cnt = 0 while ( N != 0 ) : rem = N % 2 c = pow ( 10 , cnt ) B_Number += rem * c N //= 2 cnt += 1 return B_Number
null
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(18); param0.add(92); param0.add(87); param0.add(50); param0.add(56); param0.add(88); param0.add(3); param0.add(16); param0.add(45); param0.add(58); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (18,), (92,), (87,), (50,), (56,), (88,), (3,), (16,), (45,), (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)))
null
MAXIMUM_NUMBER_OF_SQUARES_THAT_CAN_BE_FIT_IN_A_RIGHT_ANGLE_ISOSCELES_TRIANGLE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_NUMBER_OF_SQUARES_THAT_CAN_BE_FIT_IN_A_RIGHT_ANGLE_ISOSCELES_TRIANGLE{ static int f_gold ( int b , int m ) { return ( b / m - 1 ) * ( b / m ) / 2 ; }
def f_gold ( b , m ) : return ( b / m - 1 ) * ( b / m ) / 2
using namespace std; int f_gold ( int b, int m ) { return ( b / m - 1 ) * ( b / m ) / 2; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(40); param0.add(38); param0.add(47); param0.add(52); param0.add(21); param0.add(50); param0.add(8); param0.add(56); param0.add(93); param0.add(21); List<Integer> param1 = new ArrayList<>(); param1.add(74); param1.add(35); param1.add(71); param1.add(29); param1.add(9); param1.add(33); param1.add(82); param1.add(80); param1.add(5); param1.add(90); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (40,74,), (38,35,), (47,71,), (52,29,), (21,9,), (50,33,), (8,82,), (56,80,), (93,5,), (21,90,) ] 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 {40,38,47,52,21,50,8,56,93,21}; vector<int> param1 {74,35,71,29,9,33,82,80,5,90}; 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; }
K_TH_DIGIT_RAISED_POWER_B
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class K_TH_DIGIT_RAISED_POWER_B{ public static int f_gold ( int a , int b , int k ) { int p = ( int ) Math . pow ( a , b ) ; int count = 0 ; while ( p > 0 && count < k ) { int rem = p % 10 ; count ++ ; if ( count == k ) return rem ; p = p / 10 ; } return 0 ; }
def f_gold ( a , b , k ) : p = a ** b count = 0 while ( p > 0 and count < k ) : rem = p % 10 count = count + 1 if ( count == k ) : return rem p = p / 10 ;
using namespace std; int f_gold ( int a, int b, int k ) { int p = pow ( a, b ); int count = 0; while ( p > 0 && count < k ) { int rem = p % 10; count ++; if ( count == k ) return rem; p = p / 10; } return 0; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(11); param0.add(41); param0.add(5); param0.add(1); param0.add(24); param0.add(5); param0.add(66); param0.add(7); param0.add(77); param0.add(60); List<Integer> param1 = new ArrayList<>(); param1.add(2); param1.add(3); param1.add(4); param1.add(2); param1.add(1); param1.add(2); param1.add(5); param1.add(10); param1.add(30); param1.add(50); List<Integer> param2 = new ArrayList<>(); param2.add(1); param2.add(0); param2.add(3); param2.add(4); param2.add(5); param2.add(3); param2.add(8); param2.add(3); param2.add(10); param2.add(1); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (11,2,1), (41,3,3), (5,4,3), (1,2,4), (24,1,5), (5,2,3), (66,5,8), (7,10,3), (77,30,10), (60,50,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 {11,41,5,1,24,5,66,7,77,60}; vector<int> param1 {2,3,4,2,1,2,5,10,30,50}; vector<int> param2 {1,0,3,4,5,3,8,3,10,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; }
ARRAY_RANGE_QUERIES_ELEMENTS_FREQUENCY_VALUE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class ARRAY_RANGE_QUERIES_ELEMENTS_FREQUENCY_VALUE{ static int f_gold ( int start , int end , int arr [ ] ) { Map < Integer , Integer > mp = new HashMap < > ( ) ; for ( int i = start ; i <= end ; i ++ ) mp . put ( arr [ i ] , mp . get ( arr [ i ] ) == null ? 1 : mp . get ( arr [ i ] ) + 1 ) ; int count = 0 ; for ( Map . Entry < Integer , Integer > entry : mp . entrySet ( ) ) if ( entry . getKey ( ) == entry . getValue ( ) ) count ++ ; return count ; }
def f_gold ( start , end , arr ) : frequency = dict ( ) for i in range ( start , end + 1 ) : if arr [ i ] in frequency.keys ( ) : frequency [ arr [ i ] ] += 1 else : frequency [ arr [ i ] ] = 1 count = 0 for x in frequency : if x == frequency [ x ] : count += 1 return count
using namespace std; int f_gold ( int start, int end, int arr [ ] ) { unordered_map < int, int > frequency; for ( int i = start; i <= end; i ++ ) frequency [ arr [ i ] ] ++; int count = 0; for ( auto x : frequency ) if ( x . first == x . second ) count ++; return count; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(0); param0.add(1); param0.add(3); param0.add(10); param0.add(2); param0.add(0); param0.add(14); param0.add(29); param0.add(31); param0.add(21); List<Integer> param1 = new ArrayList<>(); param1.add(31); param1.add(25); param1.add(4); param1.add(15); param1.add(3); param1.add(6); param1.add(18); param1.add(33); param1.add(19); param1.add(32); List<int [ ]> param2 = new ArrayList<>(); param2.add(new int[]{1,2,2,3,3,3,12,13,18,18,26,28,29,36,37,39,40,49,55,57,63,69,69,73,85,86,87,87,89,89,90,91,92,93,93,93,95,99}); param2.add(new int[]{24,-62,2,1,94,56,-22,-70,-22,-34,-92,-18,56,2,60,38,-88,16,-28,30,-30,58,-80,94,6,56}); param2.add(new int[]{0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param2.add(new int[]{84,13,81,40,87,82,50,30,90,80,81,70,14,54,72,93,78,27,61}); param2.add(new int[]{-20,20,34,60,90}); param2.add(new int[]{1,0,0,0,0,0,0,0,0,0}); param2.add(new int[]{11,18,18,19,25,30,42,42,56,58,63,66,67,68,69,75,78,83,83}); param2.add(new int[]{-24,-82,24,-84,94,2,-30,86,58,-56,-96,60,-38,76,94,74,-98,-84,-38,46,4,-84,-90,-28,-50,46,16,28,-14,-82,-64,42,64,-2,-40,96,60,2,-86,32,38,-66}); param2.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param2.add(new int[]{2,91,42,85,97,92,24,39,63,89,31,59,51,89,72,62,26,92,75,4,6,13,20,95,22,30,52,60,37,27,49,15,67,26}); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (0,31,[1,2,2,3,3,3,12,13,18,18,26,28,29,36,37,39,40,49,55,57,63,69,69,73,85,86,87,87,89,89,90,91,92,93,93,93,95,99],), (1,25,[24,-62,2,1,94,56,-22,-70,-22,-34,-92,-18,56,2,60,38,-88,16,-28,30,-30,58,-80,94,6,56],), (3,4,[0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],), (10,15,[84, 13, 81, 40, 87, 82, 50, 30, 90, 80, 81, 70, 14, 54, 72, 93, 78, 27, 61],), (2,3,[-20, 20, 34, 60, 90],), (0,6,[1, 0, 0, 0, 0, 0, 0, 0, 0, 0],), (14,18,[11, 18, 18, 19, 25, 30, 42, 42, 56, 58, 63, 66, 67, 68, 69, 75, 78, 83, 83],), (29,33,[-24, -82, 24, -84, 94, 2, -30, 86, 58, -56, -96, 60, -38, 76, 94, 74, -98, -84, -38, 46, 4, -84, -90, -28, -50, 46, 16, 28, -14, -82, -64, 42, 64, -2, -40, 96, 60, 2, -86, 32, 38, -66],), (31,19,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],), (21,32,[2, 91, 42, 85, 97, 92, 24, 39, 63, 89, 31, 59, 51, 89, 72, 62, 26, 92, 75, 4, 6, 13, 20, 95, 22, 30, 52, 60, 37, 27, 49, 15, 67, 26],) ] 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 {0,1,3,10,2,0,14,29,31,21}; vector<int> param1 {31,25,4,15,3,6,18,33,19,32}; vector<vector<int>> param2 { {1,2,2,3,3,3,12,13,18,18,26,28,29,36,37,39,40,49,55,57,63,69,69,73,85,86,87,87,89,89,90,91,92,93,93,93,95,99}, {24,-62,2,1,94,56,-22,-70,-22,-34,-92,-18,56,2,60,38,-88,16,-28,30,-30,58,-80,94,6,56}, {0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {84,13,81,40,87,82,50,30,90,80,81,70,14,54,72,93,78,27,61}, {-20,20,34,60,90}, {1,0,0,0,0,0,0,0,0,0}, {11,18,18,19,25,30,42,42,56,58,63,66,67,68,69,75,78,83,83}, {-24,-82,24,-84,94,2,-30,86,58,-56,-96,60,-38,76,94,74,-98,-84,-38,46,4,-84,-90,-28,-50,46,16,28,-14,-82,-64,42,64,-2,-40,96,60,2,-86,32,38,-66}, {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {2,91,42,85,97,92,24,39,63,89,31,59,51,89,72,62,26,92,75,4,6,13,20,95,22,30,52,60,37,27,49,15,67,26}}; for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0[i],param1[i],&param2[i].front()) == f_gold(param0[i],param1[i],&param2[i].front())) { n_success+=1; } } cout << "#Results:" << " " << n_success << ", " << param0.size(); return 0; }
FIND_SUBARRAY_WITH_GIVEN_SUM
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class FIND_SUBARRAY_WITH_GIVEN_SUM{ static int f_gold ( int arr [ ] , int n , int sum ) { int curr_sum , i , j ; for ( i = 0 ; i < n ; i ++ ) { curr_sum = arr [ i ] ; for ( j = i + 1 ; j <= n ; j ++ ) { if ( curr_sum == sum ) { int p = j - 1 ; System . out . println ( "Sum found between indexes " + i + " and " + p ) ; return 1 ; } if ( curr_sum > sum || j == n ) break ; curr_sum = curr_sum + arr [ j ] ; } } System . out . println ( "No subarray found" ) ; return 0 ; }
def f_gold ( arr , n , sum ) : for i in range ( n ) : curr_sum = arr [ i ] j = i + 1 while j <= n : if curr_sum == sum : print ( "Sum found between" ) print ( "indexes %d and %d" % ( i , j - 1 ) ) return 1 if curr_sum > sum or j == n : break curr_sum = curr_sum + arr [ j ] j += 1 print ( "No subarray found" ) return 0
using namespace std; int f_gold ( int arr [ ], int n, int sum ) { int curr_sum, i, j; for ( i = 0; i < n; i ++ ) { curr_sum = arr [ i ]; for ( j = i + 1; j <= n; j ++ ) { if ( curr_sum == sum ) { cout << "Sum found between indexes " << i << " and " << j - 1; return 1; } if ( curr_sum > sum || j == n ) break; curr_sum = curr_sum + arr [ j ]; } } cout << "No subarray found"; return 0; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,8,8,10,15,18,19,22,25,26,30,32,35,36,40,41,43,48,53,57,59,63,64,68,71,76,76,77,78,89,96,97}); param0.add(new int[]{-78,16,-16,-10,-2,-38,58,-72,-78,50,-68,-16,-96,82,70,2,-20}); param0.add(new int[]{0,0,0,0,0,0,0,0,1,1,1,1,1,1}); param0.add(new int[]{16,10,55,43,46,74,57,65,86,60,28,6,92}); param0.add(new int[]{-98,-98,-90,-84,-84,-80,-76,-76,-70,-54,-48,-46,-44,-42,-38,-14,-12,-4,6,8,24,28,32,40,40,42,64,84,98}); param0.add(new int[]{0,1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,1}); param0.add(new int[]{2,10,40,45,56,66,66,70,75,83,93,98}); param0.add(new int[]{-20,30,56,-68,54,-6,78,-86,88,-66,76,-66,62,78,22,46,-94,-10,18,16,-36,34,-98,-84,-40,98,82,10,12,54,-88}); param0.add(new int[]{0,0,1,1}); param0.add(new int[]{38,24,12}); List<Integer> param1 = new ArrayList<>(); param1.add(26); param1.add(9); param1.add(9); param1.add(10); param1.add(23); param1.add(12); param1.add(10); param1.add(30); param1.add(2); param1.add(1); List<Integer> param2 = new ArrayList<>(); param2.add(23); param2.add(12); param2.add(11); param2.add(6); param2.add(19); param2.add(8); param2.add(10); param2.add(17); param2.add(2); param2.add(1); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([4, 8, 8, 10, 15, 18, 19, 22, 25, 26, 30, 32, 35, 36, 40, 41, 43, 48, 53, 57, 59, 63, 64, 68, 71, 76, 76, 77, 78, 89, 96, 97],26,23,), ([-78, 16, -16, -10, -2, -38, 58, -72, -78, 50, -68, -16, -96, 82, 70, 2, -20],9,12,), ([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],9,11,), ([16, 10, 55, 43, 46, 74, 57, 65, 86, 60, 28, 6, 92],10,6,), ([-98, -98, -90, -84, -84, -80, -76, -76, -70, -54, -48, -46, -44, -42, -38, -14, -12, -4, 6, 8, 24, 28, 32, 40, 40, 42, 64, 84, 98],23,19,), ([0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],12,8,), ([2, 10, 40, 45, 56, 66, 66, 70, 75, 83, 93, 98],10,10,), ([-20, 30, 56, -68, 54, -6, 78, -86, 88, -66, 76, -66, 62, 78, 22, 46, -94, -10, 18, 16, -36, 34, -98, -84, -40, 98, 82, 10, 12, 54, -88],30,17,), ([0, 0, 1, 1],2,2,), ([38, 24, 12],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,8,8,10,15,18,19,22,25,26,30,32,35,36,40,41,43,48,53,57,59,63,64,68,71,76,76,77,78,89,96,97},{-78,16,-16,-10,-2,-38,58,-72,-78,50,-68,-16,-96,82,70,2,-20},{0,0,0,0,0,0,0,0,1,1,1,1,1,1},{16,10,55,43,46,74,57,65,86,60,28,6,92},{-98,-98,-90,-84,-84,-80,-76,-76,-70,-54,-48,-46,-44,-42,-38,-14,-12,-4,6,8,24,28,32,40,40,42,64,84,98},{0,1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,1},{2,10,40,45,56,66,66,70,75,83,93,98},{-20,30,56,-68,54,-6,78,-86,88,-66,76,-66,62,78,22,46,-94,-10,18,16,-36,34,-98,-84,-40,98,82,10,12,54,-88},{0,0,1,1},{38,24,12}}; vector<int> param1 {26,9,9,10,23,12,10,30,2,1}; vector<int> param2 {23,12,11,6,19,8,10,17,2,1}; 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; }
MAXIMUM_SUM_IARRI_AMONG_ROTATIONS_GIVEN_ARRAY
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class MAXIMUM_SUM_IARRI_AMONG_ROTATIONS_GIVEN_ARRAY{ static int f_gold ( int arr [ ] , int n ) { int res = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { int curr_sum = 0 ; for ( int j = 0 ; j < n ; j ++ ) { int index = ( i + j ) % n ; curr_sum += j * arr [ index ] ; } res = Math . max ( res , curr_sum ) ; } return res ; }
import sys def f_gold ( arr , n ) : res = - sys.maxsize for i in range ( 0 , n ) : curr_sum = 0 for j in range ( 0 , n ) : index = int ( ( i + j ) % n ) curr_sum += j * arr [ index ] res = max ( res , curr_sum ) return res
using namespace std; int f_gold ( int arr [ ], int n ) { int res = INT_MIN; for ( int i = 0; i < n; i ++ ) { int curr_sum = 0; for ( int j = 0; j < n; j ++ ) { int index = ( i + j ) % n; curr_sum += j * arr [ index ]; } res = max ( res, curr_sum ); } return res; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{11,12,16,26,29,40,54,59,65,70,71,73,78,81,87,87,88,90,95,97}); param0.add(new int[]{-46,-32,54,96,-72,-58,-36,-44,26,-2,-68,42,90,26,-92,-96,88,-42,-18,46,-70,24,0,24,34,34,-52,50,94,-60,64,58}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{48,2,79,98,28,17,41,47,61,76,82,5,74,4,80,51,22,45,91,75,91,93,42,45,69,98,76,74,83,17,30,88,53,25,35,19,26}); param0.add(new int[]{-88,-84,-82,-74,-44,-34,-32,-20,-20,-14,6,6,10,12,16,24,32,34,38,46,54,54,56,60,82,88,90,94,98}); param0.add(new int[]{0,1,1,1,1,0,1,1,1,1,1,1,1}); param0.add(new int[]{10,14,14,14,19,20,22,26,35,36,40,53,54,55,55,57,57,67,72,72,77,78,83,84,95,96}); param0.add(new int[]{-80,18,-76,48,-52,-38,52,-82,40,-44,-90,86,-86,-36,-32,-2,56,-12,-88,14,-16,8,52,24,46,56,84,-36,84,-60,72,-46,32,-16,-20,68,-86,-62,58,8,78,-52,22,-28,-22,-42,12,-48}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{20,94,36,2,50,62,84,50,66,75,1,18,41,48,72,61,86,22,54,6,71,46,92,68,59,51,89,31,58,78,82,84}); List<Integer> param1 = new ArrayList<>(); param1.add(11); param1.add(22); param1.add(33); param1.add(20); param1.add(24); param1.add(7); param1.add(16); param1.add(30); param1.add(14); param1.add(25); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([11, 12, 16, 26, 29, 40, 54, 59, 65, 70, 71, 73, 78, 81, 87, 87, 88, 90, 95, 97],11,), ([-46, -32, 54, 96, -72, -58, -36, -44, 26, -2, -68, 42, 90, 26, -92, -96, 88, -42, -18, 46, -70, 24, 0, 24, 34, 34, -52, 50, 94, -60, 64, 58],22,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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],33,), ([48, 2, 79, 98, 28, 17, 41, 47, 61, 76, 82, 5, 74, 4, 80, 51, 22, 45, 91, 75, 91, 93, 42, 45, 69, 98, 76, 74, 83, 17, 30, 88, 53, 25, 35, 19, 26],20,), ([-88, -84, -82, -74, -44, -34, -32, -20, -20, -14, 6, 6, 10, 12, 16, 24, 32, 34, 38, 46, 54, 54, 56, 60, 82, 88, 90, 94, 98],24,), ([0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],7,), ([10, 14, 14, 14, 19, 20, 22, 26, 35, 36, 40, 53, 54, 55, 55, 57, 57, 67, 72, 72, 77, 78, 83, 84, 95, 96],16,), ([-80, 18, -76, 48, -52, -38, 52, -82, 40, -44, -90, 86, -86, -36, -32, -2, 56, -12, -88, 14, -16, 8, 52, 24, 46, 56, 84, -36, 84, -60, 72, -46, 32, -16, -20, 68, -86, -62, 58, 8, 78, -52, 22, -28, -22, -42, 12, -48],30,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1],14,), ([20, 94, 36, 2, 50, 62, 84, 50, 66, 75, 1, 18, 41, 48, 72, 61, 86, 22, 54, 6, 71, 46, 92, 68, 59, 51, 89, 31, 58, 78, 82, 84],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 {{11,12,16,26,29,40,54,59,65,70,71,73,78,81,87,87,88,90,95,97},{-46,-32,54,96,-72,-58,-36,-44,26,-2,-68,42,90,26,-92,-96,88,-42,-18,46,-70,24,0,24,34,34,-52,50,94,-60,64,58},{0,0,0,0,0,0,0,0,0,0,0,0,0,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},{48,2,79,98,28,17,41,47,61,76,82,5,74,4,80,51,22,45,91,75,91,93,42,45,69,98,76,74,83,17,30,88,53,25,35,19,26},{-88,-84,-82,-74,-44,-34,-32,-20,-20,-14,6,6,10,12,16,24,32,34,38,46,54,54,56,60,82,88,90,94,98},{0,1,1,1,1,0,1,1,1,1,1,1,1},{10,14,14,14,19,20,22,26,35,36,40,53,54,55,55,57,57,67,72,72,77,78,83,84,95,96},{-80,18,-76,48,-52,-38,52,-82,40,-44,-90,86,-86,-36,-32,-2,56,-12,-88,14,-16,8,52,24,46,56,84,-36,84,-60,72,-46,32,-16,-20,68,-86,-62,58,8,78,-52,22,-28,-22,-42,12,-48},{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1},{20,94,36,2,50,62,84,50,66,75,1,18,41,48,72,61,86,22,54,6,71,46,92,68,59,51,89,31,58,78,82,84}}; vector<int> param1 {11,22,33,20,24,7,16,30,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; }
PRODUCT_MAXIMUM_FIRST_ARRAY_MINIMUM_SECOND
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PRODUCT_MAXIMUM_FIRST_ARRAY_MINIMUM_SECOND{ public static int f_gold ( int arr1 [ ] , int arr2 [ ] , int n1 , int n2 ) { Arrays . sort ( arr1 ) ; Arrays . sort ( arr2 ) ; return arr1 [ n1 - 1 ] * arr2 [ 0 ] ; }
null
using namespace std; int f_gold ( int arr1 [ ], int arr2 [ ], int n1, int n2 ) { sort ( arr1, arr1 + n1 ); sort ( arr2, arr2 + n2 ); return arr1 [ n1 - 1 ] * arr2 [ 0 ]; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{4,11,12,12,14,14,15,33,51,51,61,63,68,69,75,83,84,97}); param0.add(new int[]{88,-10,-18,74,56,-36,-86,72,76,26,-36,10,-6,-80,-34,14,-82,74,48,-76,-78,-50,-62,-86,96,22,42,-28,18,6,58,-72,54}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{84,2,52,25,38,63,10,44,36,12,67,25,79,36,12,14,14,18,32,8,94,34,9,72,27,44,75,80,28,57,34,67,26,21,53,92,31,87,62}); param0.add(new int[]{-64,-60,-36,-36,-34,-32,-18,-16,-2,6,22,36,42,46,52,54,70,94}); param0.add(new int[]{0,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,0,1,1,1,0,0,1,0,0,0,0,1,1,0,1,1,0,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0}); param0.add(new int[]{24,36,73}); param0.add(new int[]{86,-46,76,66,38,24,-10,-10,-88,-22,54,12,42,20,-6,-44,-26,78,-46,-88,-6,-24,72,-38,26,84,-70,90,56,-4,94,-72,-44,-40,-8,18,4,-72,72,-72,-38}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{41,47,59,85,10,38,4,63,74,71,76,32,54,40,20,38,17,76,87,49,53,73,92,90,36,76,1,65,62,10,93,65}); List<int [ ]> param1 = new ArrayList<>(); param1.add(new int[]{4,4,5,12,16,27,28,41,44,60,73,76,77,90,91,92,96,96}); param1.add(new int[]{24,-26,38,28,94,64,-36,42,62,-50,-12,-18,-72,-76,26,-4,44,-98,32,-48,54,-66,-84,16,-12,-30,-58,42,-88,-40,66,-66,30}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{92,20,7,22,79,50,27,19,2,58,93,19,60,45,16,50,87,31,45,8,89,39,61,76,48,92,22,18,19,35,54,32,81,57,22,29,63,83,20}); param1.add(new int[]{-96,-92,-64,-44,-22,-22,-22,-20,6,8,14,16,24,40,46,54,76,78}); param1.add(new int[]{0,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0,1,0,1,0,0,1,1,1,1,0,1}); param1.add(new int[]{5,41,60}); param1.add(new int[]{-30,-38,58,-6,-2,-18,34,24,-52,56,-80,-82,20,64,54,-96,70,-78,78,54,6,-4,34,0,90,-74,-50,-40,16,-48,-4,78,80,-98,-12,-64,94,-42,-22,-34,96}); param1.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param1.add(new int[]{62,30,71,1,83,88,62,50,88,80,22,98,62,43,84,21,23,89,78,5,36,21,17,30,54,88,66,48,83,12,4,50}); List<Integer> param2 = new ArrayList<>(); param2.add(10); param2.add(20); param2.add(40); param2.add(32); param2.add(11); param2.add(37); param2.add(2); param2.add(20); param2.add(38); param2.add(26); List<Integer> param3 = new ArrayList<>(); param3.add(15); param3.add(27); param3.add(39); param3.add(19); param3.add(10); param3.add(44); param3.add(2); param3.add(28); param3.add(35); param3.add(22); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
null
int main() { int n_success = 0; vector<vector<int>> param0 {{4,11,12,12,14,14,15,33,51,51,61,63,68,69,75,83,84,97},{88,-10,-18,74,56,-36,-86,72,76,26,-36,10,-6,-80,-34,14,-82,74,48,-76,-78,-50,-62,-86,96,22,42,-28,18,6,58,-72,54},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,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},{84,2,52,25,38,63,10,44,36,12,67,25,79,36,12,14,14,18,32,8,94,34,9,72,27,44,75,80,28,57,34,67,26,21,53,92,31,87,62},{-64,-60,-36,-36,-34,-32,-18,-16,-2,6,22,36,42,46,52,54,70,94},{0,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,0,1,1,1,0,0,1,0,0,0,0,1,1,0,1,1,0,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0},{24,36,73},{86,-46,76,66,38,24,-10,-10,-88,-22,54,12,42,20,-6,-44,-26,78,-46,-88,-6,-24,72,-38,26,84,-70,90,56,-4,94,-72,-44,-40,-8,18,4,-72,72,-72,-38},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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},{41,47,59,85,10,38,4,63,74,71,76,32,54,40,20,38,17,76,87,49,53,73,92,90,36,76,1,65,62,10,93,65}}; vector<vector<int>> param1 {{4,4,5,12,16,27,28,41,44,60,73,76,77,90,91,92,96,96},{24,-26,38,28,94,64,-36,42,62,-50,-12,-18,-72,-76,26,-4,44,-98,32,-48,54,-66,-84,16,-12,-30,-58,42,-88,-40,66,-66,30},{0,0,0,0,0,0,0,0,0,0,0,0,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},{92,20,7,22,79,50,27,19,2,58,93,19,60,45,16,50,87,31,45,8,89,39,61,76,48,92,22,18,19,35,54,32,81,57,22,29,63,83,20},{-96,-92,-64,-44,-22,-22,-22,-20,6,8,14,16,24,40,46,54,76,78},{0,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,0,1,0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0,1,0,1,0,0,1,1,1,1,0,1},{5,41,60},{-30,-38,58,-6,-2,-18,34,24,-52,56,-80,-82,20,64,54,-96,70,-78,78,54,6,-4,34,0,90,-74,-50,-40,16,-48,-4,78,80,-98,-12,-64,94,-42,-22,-34,96},{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},{62,30,71,1,83,88,62,50,88,80,22,98,62,43,84,21,23,89,78,5,36,21,17,30,54,88,66,48,83,12,4,50}}; vector<int> param2 {10,20,40,32,11,37,2,20,38,26}; vector<int> param3 {15,27,39,19,10,44,2,28,35,22}; 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; }
PRINT_MAXIMUM_SHORTEST_DISTANCE
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class PRINT_MAXIMUM_SHORTEST_DISTANCE{ static int f_gold ( int a [ ] , int n , int k ) { HashMap < Integer , Integer > b = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int x = a [ i ] ; int d = Math . min ( 1 + i , n - i ) ; if ( ! b . containsKey ( x ) ) b . put ( x , d ) ; else { b . put ( x , Math . min ( d , b . get ( x ) ) ) ; } } int ans = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { int x = a [ i ] ; if ( x != k - x && b . containsKey ( k - x ) ) ans = Math . min ( Math . max ( b . get ( x ) , b . get ( k - x ) ) , ans ) ; } return ans ; }
def f_gold ( a , n , k ) : b = dict ( ) for i in range ( n ) : x = a [ i ] d = min ( 1 + i , n - i ) if x not in b.keys ( ) : b [ x ] = d else : b [ x ] = min ( d , b [ x ] ) ans = 10 ** 9 for i in range ( n ) : x = a [ i ] if ( x != ( k - x ) and ( k - x ) in b.keys ( ) ) : ans = min ( max ( b [ x ] , b [ k - x ] ) , ans ) return ans
using namespace std; int f_gold ( int a [ ], int n, int k ) { unordered_map < int, int > b; for ( int i = 0; i < n; i ++ ) { int x = a [ i ]; int d = min ( 1 + i, n - i ); if ( b . find ( x ) == b . end ( ) ) b [ x ] = d; else b [ x ] = min ( d, b [ x ] ); } int ans = INT_MAX; for ( int i = 0; i < n; i ++ ) { int x = a [ i ]; if ( x != k - x && b . find ( k - x ) != b . end ( ) ) ans = min ( max ( b [ x ], b [ k - x ] ), ans ); } return ans; }
public static void main(String args[]) { int n_success = 0; List<int [ ]> param0 = new ArrayList<>(); param0.add(new int[]{2,27,66,89,96,96}); param0.add(new int[]{84,-38,-56,-20,-98,-40,-16,22,20,98,-56,-32,-44,30,-58,26,-44,-32,50,46,92}); param0.add(new int[]{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1}); param0.add(new int[]{20,71,66,58,74,2,63,13,1,36,28,83,24,20,85,30,59,56,8,97,58,28,28,42}); param0.add(new int[]{-94,-88,-86,-68,-66,-64,-28,-12,4,18,22,28,32,34,34,40,44,46,60,68,72,78,80,84,88,96}); param0.add(new int[]{0,0,0,0,0,1,1,1,1,0,0,0,1,1,1}); param0.add(new int[]{8,13,54,59,61,69,89,90,92}); param0.add(new int[]{-58,50,-74,-8,-50,90,90,-2,-22,8,-76,16,4,56,94,36,28,-42,80,-88,88,52,74,40,12,-72,-50,50,88,-54,32,-24,-48,-66,-86,40,-6,14,10,-88,56,80,-34}); param0.add(new int[]{0,0,0,0,0,0,0,1,1,1,1,1,1,1}); param0.add(new int[]{2,60,66,39,18,60,37,75,3,64,24,16,72,95,96,44,23,58,58,33,24,96}); List<Integer> param1 = new ArrayList<>(); param1.add(4); param1.add(13); param1.add(23); param1.add(23); param1.add(16); param1.add(8); param1.add(4); param1.add(27); param1.add(9); param1.add(21); List<Integer> param2 = new ArrayList<>(); param2.add(4); param2.add(11); param2.add(13); param2.add(17); param2.add(15); param2.add(13); param2.add(8); param2.add(42); param2.add(12); param2.add(17); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ([2, 27, 66, 89, 96, 96],4,4,), ([84, -38, -56, -20, -98, -40, -16, 22, 20, 98, -56, -32, -44, 30, -58, 26, -44, -32, 50, 46, 92],13,11,), ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],23,13,), ([20, 71, 66, 58, 74, 2, 63, 13, 1, 36, 28, 83, 24, 20, 85, 30, 59, 56, 8, 97, 58, 28, 28, 42],23,17,), ([-94, -88, -86, -68, -66, -64, -28, -12, 4, 18, 22, 28, 32, 34, 34, 40, 44, 46, 60, 68, 72, 78, 80, 84, 88, 96],16,15,), ([0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1],8,13,), ([8, 13, 54, 59, 61, 69, 89, 90, 92],4,8,), ([-58, 50, -74, -8, -50, 90, 90, -2, -22, 8, -76, 16, 4, 56, 94, 36, 28, -42, 80, -88, 88, 52, 74, 40, 12, -72, -50, 50, 88, -54, 32, -24, -48, -66, -86, 40, -6, 14, 10, -88, 56, 80, -34],27,42,), ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1],9,12,), ([2, 60, 66, 39, 18, 60, 37, 75, 3, 64, 24, 16, 72, 95, 96, 44, 23, 58, 58, 33, 24, 96],21,17,) ] 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,27,66,89,96,96},{84,-38,-56,-20,-98,-40,-16,22,20,98,-56,-32,-44,30,-58,26,-44,-32,50,46,92},{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{20,71,66,58,74,2,63,13,1,36,28,83,24,20,85,30,59,56,8,97,58,28,28,42},{-94,-88,-86,-68,-66,-64,-28,-12,4,18,22,28,32,34,34,40,44,46,60,68,72,78,80,84,88,96},{0,0,0,0,0,1,1,1,1,0,0,0,1,1,1},{8,13,54,59,61,69,89,90,92},{-58,50,-74,-8,-50,90,90,-2,-22,8,-76,16,4,56,94,36,28,-42,80,-88,88,52,74,40,12,-72,-50,50,88,-54,32,-24,-48,-66,-86,40,-6,14,10,-88,56,80,-34},{0,0,0,0,0,0,0,1,1,1,1,1,1,1},{2,60,66,39,18,60,37,75,3,64,24,16,72,95,96,44,23,58,58,33,24,96}}; vector<int> param1 {4,13,23,23,16,8,4,27,9,21}; vector<int> param2 {4,11,13,17,15,13,8,42,12,17}; 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; }
NUMBER_NON_NEGATIVE_INTEGRAL_SOLUTIONS_B_C_N_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NUMBER_NON_NEGATIVE_INTEGRAL_SOLUTIONS_B_C_N_1{ static int f_gold ( int n ) { return ( ( n + 1 ) * ( n + 2 ) ) / 2 ; }
def f_gold ( n ) : return int ( ( ( n + 1 ) * ( n + 2 ) ) / 2 )
using namespace std; int f_gold ( int n ) { return ( ( n + 1 ) * ( n + 2 ) ) / 2; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(41); param0.add(72); param0.add(54); param0.add(75); param0.add(87); param0.add(41); param0.add(78); param0.add(80); param0.add(46); param0.add(9); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (41,), (72,), (54,), (75,), (87,), (41,), (78,), (80,), (46,), (9,) ] 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 {41,72,54,75,87,41,78,80,46,9}; 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; }
BASIC_AND_EXTENDED_EUCLIDEAN_ALGORITHMS_1
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class BASIC_AND_EXTENDED_EUCLIDEAN_ALGORITHMS_1{ public static int f_gold ( int a , int b , int x , int y ) { if ( a == 0 ) { x = 0 ; y = 1 ; return b ; } int x1 = 1 , y1 = 1 ; int gcd = f_gold ( b % a , a , x1 , y1 ) ; x = y1 - ( b / a ) * x1 ; y = x1 ; return gcd ; }
def f_gold ( a , b , x , y ) : if a == 0 : x = 0 y = 1 return b x1 = 1 y1 = 1 gcd = f_gold ( b % a , a , x1 , y1 ) x = y1 - ( b / a ) * x1 y = x1 return gcd
null
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(44); param0.add(33); param0.add(39); param0.add(52); param0.add(64); param0.add(45); param0.add(53); param0.add(86); param0.add(57); param0.add(11); List<Integer> param1 = new ArrayList<>(); param1.add(17); param1.add(81); param1.add(77); param1.add(96); param1.add(48); param1.add(32); param1.add(88); param1.add(19); param1.add(67); param1.add(86); List<Integer> param2 = new ArrayList<>(); param2.add(10); param2.add(67); param2.add(21); param2.add(23); param2.add(17); param2.add(89); param2.add(24); param2.add(29); param2.add(30); param2.add(96); List<Integer> param3 = new ArrayList<>(); param3.add(65); param3.add(20); param3.add(34); param3.add(97); param3.add(33); param3.add(3); param3.add(74); param3.add(21); param3.add(32); param3.add(81); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i),param2.get(i),param3.get(i)) == f_gold(param0.get(i),param1.get(i),param2.get(i),param3.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (44,17,10,65,), (33,81,67,20,), (39,77,21,34,), (52,96,23,97,), (64,48,17,33,), (45,32,89,3,), (53,88,24,74,), (86,19,29,21,), (57,67,30,32,), (11,86,96,81,) ] 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
DYNAMIC_PROGRAMMING_SET_17_PALINDROME_PARTITIONING
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class DYNAMIC_PROGRAMMING_SET_17_PALINDROME_PARTITIONING{ static int f_gold ( String str ) { int n = str . length ( ) ; int [ ] [ ] C = new int [ n ] [ n ] ; boolean [ ] [ ] P = new boolean [ n ] [ n ] ; int i , j , k , L ; for ( i = 0 ; i < n ; i ++ ) { P [ i ] [ i ] = true ; C [ i ] [ i ] = 0 ; } for ( L = 2 ; L <= n ; L ++ ) { for ( i = 0 ; i < n - L + 1 ; i ++ ) { j = i + L - 1 ; if ( L == 2 ) P [ i ] [ j ] = ( str . charAt ( i ) == str . charAt ( j ) ) ; else P [ i ] [ j ] = ( str . charAt ( i ) == str . charAt ( j ) ) && P [ i + 1 ] [ j - 1 ] ; if ( P [ i ] [ j ] == true ) C [ i ] [ j ] = 0 ; else { C [ i ] [ j ] = Integer . MAX_VALUE ; for ( k = i ; k <= j - 1 ; k ++ ) C [ i ] [ j ] = Integer . min ( C [ i ] [ j ] , C [ i ] [ k ] + C [ k + 1 ] [ j ] + 1 ) ; } } } return C [ 0 ] [ n - 1 ] ; }
def f_gold ( str ) : n = len ( str ) C = [ [ 0 for i in range ( n ) ] for i in range ( n ) ] P = [ [ False for i in range ( n ) ] for i in range ( n ) ] j = 0 k = 0 L = 0 for i in range ( n ) : P [ i ] [ i ] = True ; C [ i ] [ i ] = 0 ; for L in range ( 2 , n + 1 ) : for i in range ( n - L + 1 ) : j = i + L - 1 if L == 2 : P [ i ] [ j ] = ( str [ i ] == str [ j ] ) else : P [ i ] [ j ] = ( ( str [ i ] == str [ j ] ) and P [ i + 1 ] [ j - 1 ] ) if P [ i ] [ j ] == True : C [ i ] [ j ] = 0 else : C [ i ] [ j ] = 100000000 for k in range ( i , j ) : C [ i ] [ j ] = min ( C [ i ] [ j ] , C [ i ] [ k ] + C [ k + 1 ] [ j ] + 1 ) return C [ 0 ] [ n - 1 ]
null
public static void main(String args[]) { int n_success = 0; List<String> param0 = new ArrayList<>(); param0.add("ydYdV"); param0.add("4446057"); param0.add("0111"); param0.add("keEj"); param0.add("642861576557"); param0.add("11111000101"); param0.add("ram"); param0.add("09773261"); param0.add("1"); param0.add("AVBEKClFdj"); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ ('ydYdV',), ('4446057',), ('0111',), ('keEj',), ('642861576557',), ('11111000101',), ('ram',), ('09773261',), ('1',), ('AVBEKClFdj',) ] 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
COUNT_WORDS_APPEAR_EXACTLY_TWO_TIMES_ARRAY_WORDS
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class COUNT_WORDS_APPEAR_EXACTLY_TWO_TIMES_ARRAY_WORDS{ static int f_gold ( String str [ ] , int n ) { HashMap < String , Integer > m = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( m . containsKey ( str [ i ] ) ) { int get = m . get ( str [ i ] ) ; m . put ( str [ i ] , get + 1 ) ; } else { m . put ( str [ i ] , 1 ) ; } } int res = 0 ; for ( Map . Entry < String , Integer > it : m . entrySet ( ) ) { if ( it . getValue ( ) == 2 ) res ++ ; } return res ; }
def f_gold ( stri , n ) : m = dict ( ) for i in range ( n ) : m [ stri [ i ] ] = m.get ( stri [ i ] , 0 ) + 1 res = 0 for i in m.values ( ) : if i == 2 : res += 1 return res
using namespace std; int f_gold ( string str [ ], int n ) { unordered_map < string, int > m; for ( int i = 0; i < n; i ++ ) m [ str [ i ] ] += 1; int res = 0; for ( auto it = m . begin ( ); it != m . end ( ); it ++ ) if ( ( it -> second == 2 ) ) res ++; return res; }
public static void main(String args[]) { int n_success = 0; List<String [ ]> param0 = new ArrayList<>(); param0.add(new String[]{"hate", "love", "peace", "love", "peace", "hate", "love", "peace", "love", "peace"}); param0.add(new String[]{"16","946613197072","532052","42780833","511552","1241934","4","3444540","47487223670074","23753","14158","4","95420017116714","16","0845","689000748","976403809728","8922","487784120896","329","611","59101","611","2131059721","53952148295020","445948587","3905249775372","4683180907","7169093","01413852276627","63","5864","40862536595","2280304422294","930028582","05","33447"}); param0.add(new String[]{"001000100000","1010","01011","11","011","1010"}); param0.add(new String[]{"Om", "Om", "Shankar", "Tripathi", "Tom", "Jerry", "Jerry"}); param0.add(new String[]{"2","644","2","42484637089","81578664","0778"}); param0.add(new String[]{"001000101","011010","1","101010011","011010","01","10111000101","0","1","00101101","0","0"}); param0.add(new String[]{"kl","p sH","PwCPMPu","tQoIgPpk","wtsNP WjS","kl ","TXsFWgU","kl","AD","NjjTyFGwNWZcB","jpFQslbGbDI","cEpGAgvpk","EMaDkMOm","YZuNZgfwDIjG","k","hJx jHmGpQYwQP","CIETe","RH","Pj","h","DInR","AEsqOvliQtz","NwzHTALTt LS","LwLR","WvDCzlQF","soJb","WktoldCbWyTO","pIdRJxY","BmpWxjOwTXkjjL","zmtCiQ","g","yBmDW","QhaBZrQnOJaAJ","u","MGTwCKve","UxYQrONag","xsGSz","dqNPTT","U W","ygJKvCEKDClby","M","yXJQHxjyDQDLkT","oJmaREOEk YA","zUwiwhSMdiC","jYgZEktcdgLD","fwyTAAW","GENttdzeGY "}); param0.add(new String[]{"938","074209","0949093096","218622476","71692175","0714","81217924991","74016430795374","52213147","338","939","798161500954","90528060774015","68715","75810","43450","8017","0193164","5945740","212","4589289","2912211026","0","49","8230114","0733435391403","5429","10070"}); param0.add(new String[]{"00","0","00","0101111010100","110"}); param0.add(new String[]{"g","h","ok","h","ok","sqozuC","ut","ZwRcG","ok","MR","jHrWyy","qaJlrokgRHuZH","LjPNzDUKszYmCq","g","ZGjLfMnyAGL","kEZoSxOMEWSFpw","IFtqNaDVnG","iJoJXl","vjrQMyWor","FTEHZqbHGlmHph","QeSdzm","nPostKHkigyJt","mOSekk"}); List<Integer> param1 = new ArrayList<>(); param1.add(10); param1.add(32); param1.add(6); param1.add(7); param1.add(6); param1.add(12); param1.add(43); param1.add(20); param1.add(4); param1.add(15); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i),param1.get(i)) == f_gold(param0.get(i),param1.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (["hate", "love", "peace", "love", "peace", "hate", "love", "peace", "love", "peace"],10,), (["16","946613197072","532052","42780833","511552","1241934","4","3444540","47487223670074","23753","14158","4","95420017116714","16","0845","689000748","976403809728","8922","487784120896","329","611","59101","611","2131059721","53952148295020","445948587","3905249775372","4683180907","7169093","01413852276627","63","5864","40862536595","2280304422294","930028582","05","33447"],32,), (["001000100000","1010","01011","11","011","1010"],6,), (["Om", "Om", "Shankar", "Tripathi", "Tom", "Jerry", "Jerry"],7,), (["2","644","2","42484637089","81578664","0778"],6,), (["001000101","011010","1","101010011","011010","01","10111000101","0","1","00101101","0","0"],12,), (["kl","p sH","PwCPMPu","tQoIgPpk","wtsNP WjS","kl ","TXsFWgU","kl","AD","NjjTyFGwNWZcB","jpFQslbGbDI","cEpGAgvpk","EMaDkMOm","YZuNZgfwDIjG","k","hJx jHmGpQYwQP","CIETe","RH","Pj","h","DInR","AEsqOvliQtz","NwzHTALTt LS","LwLR","WvDCzlQF","soJb","WktoldCbWyTO","pIdRJxY","BmpWxjOwTXkjjL","zmtCiQ","g","yBmDW","QhaBZrQnOJaAJ","u","MGTwCKve","UxYQrONag","xsGSz","dqNPTT","U W","ygJKvCEKDClby","M","yXJQHxjyDQDLkT","oJmaREOEk YA","zUwiwhSMdiC","jYgZEktcdgLD","fwyTAAW","GENttdzeGY "],43,), (["938","074209","0949093096","218622476","71692175","0714","81217924991","74016430795374","52213147","338","939","798161500954","90528060774015","68715","75810","43450","8017","0193164","5945740","212","4589289","2912211026","0","49","8230114","0733435391403","5429","10070"],20,), (["00","0","00","0101111010100","110"],4,), (["g","h","ok","h","ok","sqozuC","ut","ZwRcG","ok","MR","jHrWyy","qaJlrokgRHuZH","LjPNzDUKszYmCq","g","ZGjLfMnyAGL","kEZoSxOMEWSFpw","IFtqNaDVnG","iJoJXl","vjrQMyWor","FTEHZqbHGlmHph","QeSdzm","nPostKHkigyJt","mOSekk"],15,) ] 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<string>> param0 { {"hate", "love", "peace", "love", "peace", "hate", "love", "peace", "love", "peace"}, {"16","946613197072","532052","42780833","511552","1241934","4","3444540","47487223670074","23753","14158","4","95420017116714","16","0845","689000748","976403809728","8922","487784120896","329","611","59101","611","2131059721","53952148295020","445948587","3905249775372","4683180907","7169093","01413852276627","63","5864","40862536595","2280304422294","930028582","05","33447"}, {"001000100000","1010","01011","11","011","1010"}, {"Om", "Om", "Shankar", "Tripathi", "Tom", "Jerry", "Jerry"}, {"2","644","2","42484637089","81578664","0778"}, {"001000101","011010","1","101010011","011010","01","10111000101","0","1","00101101","0","0"}, {"kl","p sH","PwCPMPu","tQoIgPpk","wtsNP WjS","kl ","TXsFWgU","kl","AD","NjjTyFGwNWZcB","jpFQslbGbDI","cEpGAgvpk","EMaDkMOm","YZuNZgfwDIjG","k","hJx jHmGpQYwQP","CIETe","RH","Pj","h","DInR","AEsqOvliQtz","NwzHTALTt LS","LwLR","WvDCzlQF","soJb","WktoldCbWyTO","pIdRJxY","BmpWxjOwTXkjjL","zmtCiQ","g","yBmDW","QhaBZrQnOJaAJ","u","MGTwCKve","UxYQrONag","xsGSz","dqNPTT","U W","ygJKvCEKDClby","M","yXJQHxjyDQDLkT","oJmaREOEk YA","zUwiwhSMdiC","jYgZEktcdgLD","fwyTAAW","GENttdzeGY "}, {"938","074209","0949093096","218622476","71692175","0714","81217924991","74016430795374","52213147","338","939","798161500954","90528060774015","68715","75810","43450","8017","0193164","5945740","212","4589289","2912211026","0","49","8230114","0733435391403","5429","10070"}, {"00","0","00","0101111010100","110"}, {"g","h","ok","h","ok","sqozuC","ut","ZwRcG","ok","MR","jHrWyy","qaJlrokgRHuZH","LjPNzDUKszYmCq","g","ZGjLfMnyAGL","kEZoSxOMEWSFpw","IFtqNaDVnG","iJoJXl","vjrQMyWor","FTEHZqbHGlmHph","QeSdzm","nPostKHkigyJt","mOSekk"}}; vector<int> param1 {10,32,6,7,6,12,43,20,4,15}; 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; }
NEXT_POWER_OF_2_2
import java.util. *; import java.util.stream.*; import java.lang.*; import javafx.util.Pair; public class NEXT_POWER_OF_2_2{ static int f_gold ( int n ) { n -- ; n |= n >> 1 ; n |= n >> 2 ; n |= n >> 4 ; n |= n >> 8 ; n |= n >> 16 ; n ++ ; return n ; }
def f_gold ( n ) : n -= 1 n |= n >> 1 n |= n >> 2 n |= n >> 4 n |= n >> 8 n |= n >> 16 n += 1 return n
using namespace std; unsigned int f_gold ( unsigned int n ) { n --; n |= n >> 1; n |= n >> 2; n |= n >> 4; n |= n >> 8; n |= n >> 16; n ++; return n; }
public static void main(String args[]) { int n_success = 0; List<Integer> param0 = new ArrayList<>(); param0.add(63); param0.add(78); param0.add(13); param0.add(5); param0.add(34); param0.add(69); param0.add(63); param0.add(78); param0.add(80); param0.add(19); for(int i = 0; i < param0.size(); ++i) { if(f_filled(param0.get(i)) == f_gold(param0.get(i))) { n_success+=1; } } System.out.println("#Results:" + n_success + ", " + param0.size()); } }
if __name__ == '__main__': param = [ (63,), (78,), (13,), (5,), (34,), (69,), (63,), (78,), (80,), (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 {63,78,13,5,34,69,63,78,80,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; }