id
stringlengths
9
106
d_with_params
stringlengths
426
57.5k
MAXIMUM_SUM_SUBARRAY_REMOVING_ONE_ELEMENT
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [764, 350, 3, 767, 570, 8, 2357, 662, 8, 833]; 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, ...
SWAP_TWO_NIBBLES_BYTE
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [147, 54, 36, 22, 245, 162, 245, 149, 48, 69]; int [] param0 = [57, 99, 66, 97, 95, 42, 95, 89, 3, 84]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i...
PROGRAM_AREA_SQUARE
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [2500, 4096, 8464, 529, 1444, 3025, 4489, 3136, 3600, 8100]; int [] param0 = [50, 64, 92, 23, 38, 55, 67, 56, 60, 90]; int n_success = 0; for (int i = 0; i < param0.length; i++) { ...
CHECK_POSSIBLE_SORT_ARRAY_CONDITIONAL_SWAPPING_ADJACENT_ALLOWED
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, true, false, true, true, true, false, true, false]; int [] [] param0 = [[1, 4, 12, 16, 37, 44, 47, 51, 55, 57, 57, 62, 62, 62, 64, 69, 69, 70, 72, 81, 81, 88, 89, 97], [-86, 0, 14,...
POSSIBLE_FORM_TRIANGLE_ARRAY_VALUES
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, true, true, true, true, true, true, true, true]; int [] [] param0 = [[2, 6, 8, 10, 14, 15, 16, 19, 21, 26, 26, 26, 28, 29, 30, 33, 33, 35, 36, 36, 41, 44, 45, 45, 45, 49, 51, 54, 57...
COUNT_PALINDROME_SUB_STRINGS_STRING
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 3, 211, 1, 60, 72, 1, 1, 289, 0]; char [] [] param0 = [['e', 'e', 'j', 'p', 't', 'u', 'x', 'y', 'z', 'e', 'f', 'h', 'l', 'm', 'n', 'o', 'z'], ['8', '7', '3', '4', '9', '5', '3', '1', '4', '0'...
CEILING_IN_A_SORTED_ARRAY_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [13, 11, 1, -1, 20, -1, 12, 23, -1, 2]; int [] [] param0 = [[2, 6, 13, 16, 23, 24, 24, 27, 30, 32, 34, 34, 55, 56, 56, 63, 66, 81, 83, 96], [-28, -96, 48, 22, -12, 72, 48, -70, -96, -84, -62, 22,...
LARGEST_SUM_CONTIGUOUS_SUBARRAY_2
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1265, 90, 11, 1063, 348, 13, 1306, 172, 10, 1019]; int [] [] param0 = [[1, 3, 4, 7, 8, 8, 10, 12, 16, 19, 19, 20, 20, 21, 21, 22, 26, 27, 29, 34, 36, 38, 38, 39, 41, 43, 44, 47, 47, 49, 57, 57, ...
SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS_2
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [572, 234960, 146300, 2, 177120, 440, 5850, 14280, 1360, 95810]; int [] param0 = [12, 89, 76, 2, 81, 11, 26, 35, 16, 66]; int n_success = 0; for (int i = 0; i < param0.length; i++) { ...
HOW_TO_CHECK_IF_A_GIVEN_ARRAY_REPRESENTS_A_BINARY_HEAP_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [false, false, false, true, false, true, false, false, false, false]; int [] [] param0 = [[2, 2, 2, 7, 10, 14, 24, 38, 42, 50, 59, 60, 72, 73, 79, 83, 89], [-48, 98, 96, -56, -2, 58, 52, -50, 58...
DECODE_MEDIAN_STRING_ORIGINAL_STRING
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ string [] results = ["tpqcve gqeyzv", "484850", "1000000011111", "ysw", "524035", "0", "tlhwmmaq", "6792", "111111", "oqggubrdup"]; string [] param0 = [" egvqceqypztv", "488540", "0000101010111", "syw", "402355",...
COUNT_FIBONACCI_NUMBERS_GIVEN_RANGE_LOG_TIME
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [0, 0, 3, 0, 0, 0, 0, 1, 6, 0]; int [] param0 = [76, 96, 19, 36, 60, 20, 76, 63, 2, 41]; int [] param1 = [43, 52, 79, 2, 11, 15, 4, 93, 25, 39]; int n_success = 0; for (int i = 0; i...
FIND_THREE_ELEMENT_FROM_DIFFERENT_THREE_ARRAYS_SUCH_THAT_THAT_A_B_C_K_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [false, true, false, false, false, false, false, false, false, false]; 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], [-7...
MAXIMUM_NUMBER_2X2_SQUARES_CAN_FIT_INSIDE_RIGHT_ISOSCELES_TRIANGLE
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1081, 276, 10, 630, 666, 190, 10, 1081, 496, 28]; int [] param0 = [95, 49, 10, 73, 74, 40, 10, 94, 64, 16]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (resu...
STEINS_ALGORITHM_FOR_FINDING_GCD_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 2, 6, 1, 1, 1, 5, 2, 3, 1]; int [] param0 = [52, 36, 12, 69, 45, 7, 45, 62, 96, 89]; int [] param1 = [29, 94, 6, 7, 11, 51, 55, 86, 63, 12]; int n_success = 0; for (int i = 0; i...
CONVERT_STRICTLY_INCREASING_ARRAY_MINIMUM_CHANGES
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [2, 15, 5, 10, 4, 2, 0, 2, 1, 9]; int [] [] param0 = [[1, 4, 12, 14, 15, 18, 20, 24, 25, 25, 27, 33, 34, 42, 46, 48, 49, 50, 50, 52, 55, 56, 57, 58, 64, 65, 66, 69, 72, 75, 78, 80, 84, 90, 92, 95...
FIND_THE_MAXIMUM_SUBARRAY_XOR_IN_A_GIVEN_ARRAY
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [63, 126, 1, 33, 126, 1, 127, 126, 1, 127]; int [] [] param0 = [[1, 7, 7, 11, 12, 18, 20, 23, 27, 30, 44, 47, 53, 53, 55, 57, 57, 58, 61, 62, 67, 74, 76, 80, 86, 86], [-34, -4, 68, -82, 54, 20, 6...
FIND_THE_MISSING_NUMBER_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [-261, 524, 131, -954, 694, 341, -506, 227, 463, -697]; int [] [] param0 = [[13, 27, 46, 59, 62, 82, 92], [22, 86, -64, -20, -56, -16, 86, 42, 72, -90, 10, 42, 56, 8, 50, 24, -34, 0, -78, 64, 18,...
SUM_BINOMIAL_COEFFICIENTS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [256, 512, 32, 16, 4, 64, 128, 4096, 1024, 8]; int [] param0 = [8, 9, 5, 4, 2, 6, 7, 12, 10, 3]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_...
COUNT_WAYS_BUILD_STREET_GIVEN_CONSTRAINTS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ long [] results = [4478554083, 318281039, 3880899, 114243, 3363, 577, 17, 7]; int [] param0 = [25, 22, 17, 13, 9, 7, 3, 2]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (result...
COUNT_FREQUENCY_K_MATRIX_SIZE_N_MATRIXI_J_IJ
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [73, 35, 37, 70, -6, -30, 79, 74, 57, -19]; int [] param0 = [90, 86, 92, 72, 25, 11, 94, 91, 66, 34]; int [] param1 = [74, 36, 38, 71, 57, 53, 80, 75, 58, 88]; int n_success = 0; fo...
MAXIMUM_VALUE_CHOICE_EITHER_DIVIDING_CONSIDERING
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [3, 24, 57, 152, 192, 114, 83, 5, 3, 4]; int [] param0 = [3, 19, 39, 89, 96, 68, 48, 5, 3, 4]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_fi...
FIND_THE_MINIMUM_DISTANCE_BETWEEN_TWO_NUMBERS_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [11, 4, 2147483647, 12, 1, 1, 18, 2147483647, 2147483647, 2147483647]; int [] [] param0 = [[4, 7, 7, 8, 11, 14, 16, 25, 34, 35, 36, 36, 38, 40, 41, 43, 45, 47, 57, 60, 64, 72, 73, 74, 75, 82, 83,...
FIND_MAXIMUM_PRODUCT_OF_A_TRIPLET_IN_ARRAY
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [-1, 921984, -1, 931491, 69440, 1, 230400, 740880, 0, 477360]; int [] [] param0 = [[41, 66, 77], [92, -34, -36, -50, 20, -94, 2, -86, 22, -50, 74, 84, 52, -84, 98, -50, 88, 26, -36, -36, 6, -50, ...
SUM_PAIRWISE_PRODUCTS_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [382571, 834275, 2645897, 15675, 1711355, 266, 74907, 601036, 834275, 23485]; int [] param0 = [41, 50, 67, 18, 60, 6, 27, 46, 50, 20]; int n_success = 0; for (int i = 0; i < param0.leng...
PAINTING_FENCE_ALGORITHM
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ long [] results = [725841870, 370622679, 7554776, 76740139, 647498520, 70208793, 227130467, 204618786, 797370673, 903959704]; int [] param0 = [6, 23, 89, 63, 23, 44, 81, 43, 9, 41]; int [] param1 = [30, 87, 3...
EULERS_CRITERION_CHECK_IF_SQUARE_ROOT_UNDER_MODULO_P_EXISTS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [false, false, true, false, true, false, true, false, false, false]; int [] param0 = [71, 85, 4, 20, 71, 72, 36, 95, 83, 72]; int [] param1 = [78, 75, 35, 99, 29, 88, 54, 52, 33, 13]; i...
TRIANGULAR_NUMBERS_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, true, true, true, false, false, false, false, false]; int [] param0 = [1, 3, 6, 10, 55, 48, 63, 72, 16, 85]; int n_success = 0; for (int i = 0; i < param0.length; i++) { ...
LENGTH_OF_THE_LONGEST_ARITHMATIC_PROGRESSION_IN_A_SORTED_ARRAY
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [5, 2, 4, 1, 3, 4, 3, 3, 15, 2]; int [] [] param0 = [[3, 4, 4, 7, 8, 19, 21, 22, 25, 27, 28, 29, 38, 40, 41, 42, 43, 46, 50, 50, 53, 53, 54, 55, 60, 64, 64, 69, 70, 75, 77, 81, 81, 82, 86, 87, 87...
CHANGE_BITS_CAN_MADE_ONE_FLIP
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, false, true, true, false, false, false, false, false]; string [] param0 = ["00001", "0000", "11", "111110", "1", "111010111010", "huinqjxndbfp", "5191", "1110101101", "nupsru xz"];...
SUM_MATRIX_ELEMENT_ELEMENT_INTEGER_DIVISION_ROW_COLUMN
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [7021, 11190, 77, 11190, 1974, 8680, 19920, 156, 3697, 10530]; int [] param0 = [60, 74, 8, 74, 34, 66, 96, 11, 45, 72]; int n_success = 0; for (int i = 0; i < param0.length; i++) { ...
PYTHON_PROGRAM_FIND_PERIMETER_CIRCUMFERENCE_SQUARE_RECTANGLE
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [392, 36, 72, 152, 336, 32, 156, 24, 240, 188]; int [] param0 = [98, 9, 18, 38, 84, 8, 39, 6, 60, 47]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i]...
WRITE_ONE_LINE_C_FUNCTION_TO_FIND_WHETHER_A_NO_IS_POWER_OF_TWO_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, true, true, false, false, false, false, false, false]; int [] param0 = [1, 2, 8, 1024, 24, 7, 46, 61, 73, 66]; int n_success = 0; for (int i = 0; i < param0.length; i++) {...
LEONARDO_NUMBER_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1973, 242785, 29860703, 1219, 1402817465, 177, 3193, 2692537, 535828591, 866988873]; int [] param0 = [15, 25, 35, 14, 43, 10, 16, 30, 41, 42]; int n_success = 0; for (int i = 0; i < pa...
COUNT_MINIMUM_NUMBER_SUBSETS_SUBSEQUENCES_CONSECUTIVE_NUMBERS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [37, 31, 2, 35, 45, 44, 32, 44, 30, 37]; int [] [] param0 = [[3, 7, 7, 11, 14, 14, 14, 16, 17, 17, 21, 22, 24, 27, 27, 27, 31, 33, 35, 36, 36, 37, 38, 43, 45, 49, 52, 54, 57, 59, 59, 60, 67, 73, ...
MINIMUM_STEPS_MINIMIZE_N_PER_GIVEN_CONDITION
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [9, 3, 13, 11, 6, 6, 13, 6, 3, 12]; int [] param0 = [59, 7, 90, 78, 49, 15, 45, 56, 7, 70]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_fille...
SWAP_ALL_ODD_AND_EVEN_BITS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [147, 173, 7, 3, 142, 54, 57, 129, 145, 24]; int [] param0 = [99, 94, 11, 3, 77, 57, 54, 66, 98, 36]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] ...
FRIENDS_PAIRING_PROBLEM_2
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [10349536, 568504, 35696, 764, 76, 4, 1]; int [] param0 = [15, 13, 11, 8, 6, 3, 1]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0...
MAXIMUM_PROFIT_BY_BUYING_AND_SELLING_A_SHARE_AT_MOST_TWICE
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [80, 366, 1, 126, 132, 2, 62, 334, 0, 168]; int [] [] param0 = [[9, 10, 10, 12, 17, 18, 23, 32, 41, 44, 47, 50, 59, 69, 69, 75, 82, 84, 87, 89, 97, 99], [6, 6, 60, 40, 32, -70, -92, 88, 10, -8, -...
COUNT_WORDS_APPEAR_EXACTLY_TWO_TIMES_ARRAY_WORDS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 3, 1, 2, 1, 2, 1, 0, 1, 2]; string [] [] param0 = [["hate", "love", "peace", "love", "peace", "hate", "love", "peace", "love", "peace"], ["16", "946613197072", "532052", "42780833", "511552",...
PAIR_WITH_GIVEN_PRODUCT_SET_1_FIND_IF_ANY_PAIR_EXISTS_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [false, false, false, false, true, false, false, false, false, false]; int [] [] param0 = [[1, 2, 3, 7, 23, 23, 25, 27, 37, 42, 53, 56, 58, 61, 69, 78, 79, 84, 85, 86, 90, 93, 95], [-10, -18, 88...
EFFICIENT_WAY_CHECK_WHETHER_N_TH_FIBONACCI_NUMBER_MULTIPLE_10
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, true, true, false, false, false, false, false, false]; int [] param0 = [30, -30, 60, 90, 99, 32, 21, 65, 21, 99]; int n_success = 0; for (int i = 0; i < param0.length; i++...
PROGRAM_CALCULATE_AREA_OCTAGON
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ double [] results = [165794860.15449765, 196612808.27272156, 28799476.852711495, 447291345.3087225, 363738081.5089271, 34739881.027797274, 251483213.5426547, 167041618.6125096, 30124010.84898392, 444887003.7391194]; ...
NUMBER_IS_DIVISIBLE_BY_29_OR_NOT
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, false, false, false, false, false, false, true, false]; int [] param0 = [29, 0, 65, 1419, 54, 7, 44, 34, 1160, 2456]; int n_success = 0; for (int i = 0; i < param0.length;...
MINIMUM_COST_CONNECT_WEIGHTED_NODES_REPRESENTED_ARRAY
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [4548, -736, 0, 270, 40896, 0, 2652, 9936, 0, 1808]; 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,...
WRITE_AN_EFFICIENT_METHOD_TO_CHECK_IF_A_NUMBER_IS_MULTIPLE_OF_3
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [0, 0, 0, 1, 0, 1, 0, 0, 0, 0]; int [] param0 = [94, 94, 79, 39, 16, 90, 64, 76, 83, 47]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(...
COUNT_ARRAYS_CONSECUTIVE_ELEMENT_DIFFERENT_VALUES
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [0, 57, 14706, 1439671, 40690104, 214748365, 96855122, 699051, 0, 1]; int [] param0 = [1, 4, 7, 10, 13, 16, 19, 22, 25, 28]; int [] param1 = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]; int [] param2...
AREA_OF_THE_CIRCLE_THAT_HAS_A_SQUARE_AND_A_CIRCLE_INSCRIBED_IN_IT
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ float [] results = [4656.625710783471, 254.46900494077323, 5410.607947645021, 1194.5906065275187, 3631.6811075498013, 615.7521601035994, 3959.192141686537, 153.93804002589985, 346.36059005827474, 4185.386812745001]; ...
REMOVE_MINIMUM_ELEMENTS_EITHER_SIDE_2MIN_MAX
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 9, 9, 0, 28, 10, 2, 23, 2, 0]; int [] [] param0 = [[32, 50, 66, 73, 76, 87], [68, 74, 16, 40, 6, -44, -36, 94, 6, -24, -4, -58, -16, 24], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1...
PROGRAM_FIND_SMALLEST_DIFFERENCE_ANGLES_TWO_PARTS_GIVEN_CIRCLE
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [2, 16, 340, 256, 360, 354, 192, 24, 340, 0]; int [] [] param0 = [[4, 4, 5, 5, 13, 14, 14, 16, 19, 20, 30, 31, 32, 33, 35, 38, 38, 42, 44, 44, 48, 48, 52, 58, 60, 64, 65, 66, 68, 69, 70, 70, 71, ...
MIDDLE_OF_THREE_USING_MINIMUM_COMPARISONS_2
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [46, 16, 31, 34, 32, 58, 66, 38, 27, 13]; int [] param0 = [48, 21, 71, 93, 3, 58, 88, 8, 17, 13]; int [] param1 = [46, 7, 4, 34, 61, 78, 41, 84, 66, 3]; int [] param2 = [38, 16, 31, 11, 3...
COMPUTE_AVERAGE_TWO_NUMBERS_WITHOUT_OVERFLOW_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [45, 73, 26, 40, 12, 41, 32, 71, 74, 78]; int [] param0 = [9, 68, 51, 31, 14, 73, 51, 75, 98, 83]; int [] param1 = [81, 79, 2, 49, 10, 9, 13, 67, 51, 74]; int n_success = 0; for (in...
COMPUTE_N_UNDER_MODULO_P
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [0, 0, 0, 0, 0, 0, 0, 44, 0, 67]; int [] param0 = [85, 14, 83, 30, 96, 55, 82, 12, 38, 46]; int [] param1 = [18, 13, 21, 35, 51, 58, 71, 74, 3, 73]; int n_success = 0; for (int i = ...
MAKING_ELEMENTS_OF_TWO_ARRAYS_SAME_WITH_MINIMUM_INCREMENTDECREMENT
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [566, 220, 4, 80, 788, 0, 112, 410, 5, 366]; int [] [] param0 = [[1, 6, 6, 7, 10, 11, 13, 18, 19, 19, 19, 31, 34, 37, 37, 40, 41, 41, 47, 47, 53, 54, 55, 55, 56, 56, 60, 60, 62, 62, 66, 73, 75, 7...
SUM_LARGEST_PRIME_FACTOR_NUMBER_LESS_EQUAL_N
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [15, 291, 1554, 1672, 875, 43, 901, 90, 1695, 1334]; int [] param0 = [6, 35, 87, 91, 63, 11, 66, 17, 92, 81]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (res...
MAXIMUM_HEIGHT_OF_TRIANGULAR_ARRANGEMENT_OF_ARRAY_VALUES
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [8, 7, 6, 4, 1, 8, 3, 7, 1, 6]; int [] [] param0 = [[8, 10, 11, 14, 14, 17, 20, 20, 22, 22, 22, 23, 25, 30, 33, 39, 39, 41, 43, 45, 46, 46, 46, 50, 51, 53, 57, 59, 60, 64, 64, 66, 72, 72, 75, 77,...
DIAGONALLY_DOMINANT_MATRIX
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, true, true, false, false, false, false, false, false]; int [] [] [] param0 = [[[3, -2, 1], [1, -3, 2], [-1, 2, 4]], [[2, -2, 1], [1, -3, 2], [-1, 2, 4]], [[78, 46, 33, 58, 79, 94, ...
STOOGE_SORT
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [6, -13, 0, 7, 88, 1, 2, -31, 0, 77]; int [] [] param0 = [[6, 25, 42, 52, 53, 54, 58, 66, 67, 70], [-13, -98, 50, -63, 48, 3, -76, 12, -35, 93, 29, 17, 16, 5, -97, -54, -45, -25], [0, 0, 0, 0, 0,...
FINDING_POWER_PRIME_NUMBER_P_N
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 3, 1, 1, 2, 1, 0, 0, 1, 3]; int [] param0 = [49, 80, 10, 81, 11, 45, 86, 27, 80, 97]; int [] param1 = [30, 25, 9, 57, 4, 34, 90, 78, 60, 31]; int n_success = 0; for (int i = 0; ...
SUBARRAYS_DISTINCT_ELEMENTS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [255, 335, 30, 13, 35, 4, 152, 1791, 29, 35]; int [] [] param0 = [[3, 4, 5, 6, 12, 15, 16, 17, 20, 20, 22, 24, 24, 27, 28, 34, 37, 39, 39, 41, 43, 49, 49, 51, 55, 62, 63, 67, 71, 74, 74, 74, 77, ...
SEARCH_ALMOST_SORTED_ARRAY
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [12, 11, 1, -1, 2, -1, -1, -1, -1, -1]; int [] [] param0 = [[6, 7, 15, 42, 47, 54, 56, 59, 59, 64, 68, 70, 71, 75, 91, 93], [6, 7, 15, 42, 47, 56, 54, 59, 59, 64, 68, 71, 70, 75, 91, 93], [-92, -...
MAXIMUM_PROFIT_BY_BUYING_AND_SELLING_A_SHARE_AT_MOST_K_TIMES_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [34, 1272, 0, 46, 112, 3, 42, 564, 1, 213]; int [] [] param0 = [[3, 6, 16, 16, 19, 37, 47, 49, 74, 77, 86, 96], [-6, -70, -26, 78, 98, -72, 48, -94, -38, 52, -50, 58, 84, 16, -74, 32, -44, -50, 6...
CHECK_VALID_SEQUENCE_DIVISIBLE_M_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [6, -80, 1, 26, 16, 1, 25, 1, 0, 47]; int [] param0 = [19, 14, 5, 8, 14, 16, 24, 7, 35, 8]; int [] param1 = [29, 17, 7, 10, 12, 21, 26, 7, 35, 5]; int [] param2 = [20, 13, 6, 10, 16, 17, ...
NUMBER_OF_PAIRS_IN_AN_ARRAY_HAVING_SUM_EQUAL_TO_PRODUCT
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [0, 1, 21, 0, 0, 15, 0, 0, 15, 0]; int [] [] param0 = [[9, 10, 20, 26, 26, 28, 31, 34, 35, 36, 36, 37, 39, 43, 44, 44, 46, 49, 54, 57, 58, 63, 64, 64, 65, 67, 70, 70, 74, 75, 77, 78, 79, 81, 82, ...
GIVEN_LARGE_NUMBER_CHECK_SUBSEQUENCE_DIGITS_DIVISIBLE_8
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, true, true, true, true, true, true, true, false]; string [] param0 = ["1787075866", "8", "1110101110111", "6673177113", "7", "000001", "dbxmf", "71733", "01101101100", ""]; int...
COUNT_PAIRS_TWO_SORTED_ARRAYS_WHOSE_SUM_EQUAL_GIVEN_VALUE_X_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [2, 0, 0, 0, 0, 0, 0, 0, 0, 2]; int [] [] param0 = [[1, 2, 5, 5, 9, 11, 12, 14, 16, 18, 35, 36, 39, 44, 50, 52, 52, 59, 69, 81, 82, 84, 85, 87, 87, 87, 88, 88, 89, 90, 90, 92, 97], [52, 28, -38, ...
MINIMUM_SUM_SUBSEQUENCE_LEAST_ONE_EVERY_FOUR_CONSECUTIVE_ELEMENTS_PICKED
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [227, -622, 0, 281, -74, 0, 188, -318, 0, 153]; int [] [] param0 = [[2, 7, 11, 12, 13, 14, 18, 20, 22, 26, 28, 29, 31, 32, 33, 35, 38, 38, 40, 40, 41, 42, 43, 44, 45, 53, 54, 54, 59, 62, 69, 72, ...
TRIANGULAR_MATCHSTICK_NUMBER
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [63, 975, 360, 1395, 459, 9720, 1134, 273, 234, 6834]; int [] param0 = [6, 25, 15, 30, 17, 80, 27, 13, 12, 67]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (r...
WRITE_YOU_OWN_POWER_WITHOUT_USING_MULTIPLICATION_AND_DIVISION
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1296, 262144, 256, 125, 4096, 100, 19683, 2401, 10077696, 371293]; int [] param0 = [6, 8, 2, 5, 4, 10, 3, 7, 6, 13]; int [] param1 = [4, 6, 8, 3, 6, 2, 9, 4, 9, 5]; int n_success = 0; ...
FIND_WHETHER_AN_ARRAY_IS_SUBSET_OF_ANOTHER_ARRAY_SET_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, true, false, false, true, false, false, true, false]; int [] [] param0 = [[7, 10, 10, 10, 13, 17, 23, 24, 25, 28, 30, 33, 37, 49, 49, 50, 57, 60, 60, 63, 63, 64, 65, 65, 72, 81, 84,...
NTH_EVEN_LENGTH_PALINDROME
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ string [] results = ["lsuhevxcgfiifgcxvehusl", "7732928338292377", "010111111111111010", "stazbbzats", "07022070", "0111111111111110", "aa", "359118754930039457811953", "1101101001001001011011", "rznbbnzr"]; stri...
MULTIPLY_LARGE_NUMBERS_REPRESENTED_AS_STRINGS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ string [] results = ["812165205", "49207455593601", "12223454455433432211", "20253658262825", "175984925696", "1100012222210", "111651036", "3891078706008", "110101", "80493516"]; string [] param0 = ["12345", "88...
SUM_PAIRWISE_PRODUCTS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [28336, 145112, 9996, 284050, 1155, 25, 140, 601036, 551310, 7438442]; int [] param0 = [21, 32, 16, 38, 9, 3, 5, 46, 45, 87]; int n_success = 0; for (int i = 0; i < param0.length; i++) ...
STRING_K_DISTINCT_CHARACTERS_NO_CHARACTERS_ADJACENT
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ string [] results = ["abcdefg", "aaaaa", "abcdef", "abcdef", "abcde", "abcdefghi", "ababab", "abababab", "abcdab", "abc"]; int [] param0 = [6, 5, 1, 4, 5, 3, 6, 8, 6, 2]; int [] param1 = [7, 1, 6, 6, 5, 9, 2,...
MINIMUM_SUM_TWO_NUMBERS_FORMED_DIGITS_ARRAY
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [227889, -123809, 22222222, 11, -15712863, 1222222, 247916, -1894059, 22, 29134588]; int [] [] param0 = [[1, 1, 1, 1, 3, 4, 4, 4, 4, 4, 4, 5], [-7, -5, -2, -2, -2, 3, 4, 4, 5, 6], [0, 0, 0, 0, 0,...
WAYS_TRANSFORMING_ONE_STRING_REMOVING_0_CHARACTERS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [3, 4, 1, 0, 0, 11, 0, 1, 7, 1]; string [] param0 = ["abcccdf", "aabba", "aabsdfljk", "ioniqv", "9667771256770", "10001011", "fczbdtmdt", "298746088", "01100011000", "qk"]; string [] param1 =...
COUNT_TOTAL_SET_BITS_IN_ALL_NUMBERS_FROM_1_TO_N
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [279, 159, 112, 80, 231, 88, 112, 197, 32, 304]; int [] param0 = [90, 56, 43, 31, 77, 35, 43, 66, 15, 95]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (result...
K_TH_LARGEST_SUM_CONTIGUOUS_SUBARRAY
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [157, 166, 5, 508, -86, 3, 721, 36, 0, 1041]; int [] [] param0 = [[2, 3, 5, 7, 8, 29, 29, 44, 47, 52, 60, 65, 73, 83, 87, 92, 92, 95], [44, -98, -10, 14, -6, -46, 6, -74, -4, 36, 10, -2, 30, 28, ...
POSITION_ELEMENT_STABLE_SORT
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [32, 20, 30, 24, 17, 14, 35, 7, 19, 1]; int [] [] param0 = [[4, 8, 9, 12, 15, 16, 18, 28, 28, 31, 33, 36, 36, 37, 40, 41, 44, 44, 46, 50, 50, 50, 52, 52, 54, 55, 60, 61, 65, 68, 71, 75, 75, 78, 8...
NUMBER_RECTANGLES_NM_GRID
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ long [] results = [9296385, 1203345, 90, 326508, 212058, 259350, 1898100, 3558880, 1690650, 9900]; int [] param0 = [86, 33, 3, 91, 33, 13, 75, 58, 50, 4]; int [] param1 = [70, 65, 5, 12, 27, 75, 36, 64, 51, 4...
MAXIMUM_HEIGHT_OF_TRIANGULAR_ARRANGEMENT_OF_ARRAY_VALUES_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [6, 4, 6, 4, 5, 6, 7, 1, 1, 3]; 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,...
CHECK_IF_A_NUMBER_IS_JUMBLED_OR_NOT
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, false, false, true, true, false, false, true, false]; int [] param0 = [67, 77, 35, 79, 45, 22, 68, 17, 5, 85]; int n_success = 0; for (int i = 0; i < param0.length; i++) {...
SUM_SERIES_0_6_0_06_0_006_0_0006_N_TERMS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ double [] results = [0.5994, 0.65934, 0.665334, 0.6659334, 0.6659933400000001, 0.666, 0.666, 0.666, 0.665999999334, 0.665999999999334]; int [] param0 = [1, 2, 3, 4, 5, 74, 77, 67, 9, 12]; int n_success = 0; ...
COUNT_DISTINCT_NON_NEGATIVE_PAIRS_X_Y_SATISFY_INEQUALITY_XX_YY_N_2_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [64, 69, 83, 30, 41, 37, 71, 17, 71, 86]; int [] param0 = [72, 75, 92, 30, 45, 40, 81, 17, 81, 99]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] ==...
LONGEST_SUBSEQUENCE_SUCH_THAT_DIFFERENCE_BETWEEN_ADJACENTS_IS_ONE
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [2, 1, 2, 1, 1, 12, 3, 1, 2, 2]; 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...
PROGRAM_FOR_SURFACE_AREA_OF_OCTAHEDRON
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ double [] results = [7275798.574924052, 266562009.34357828, 30114046.875937637, 4857977.358664159, 190866258.51879707, 116865336.10679008, 2385823.7719733207, 188079541.63799432, 107551908.5552799, 55396369.52612884]...
COUNT_SUBARRAYS_WITH_SAME_EVEN_AND_ODD_ELEMENTS
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [50, 0, 11, 43, 0, 68, 5, 0, 4, 7]; int [] [] param0 = [[7, 8, 12, 13, 14, 19, 20, 22, 28, 30, 31, 31, 32, 34, 34, 39, 39, 43, 45, 46, 47, 62, 63, 63, 65, 66, 69, 69, 71, 76, 79, 82, 83, 88, 89, ...
COUNT_NEGATIVE_NUMBERS_IN_A_COLUMN_WISE_ROW_WISE_SORTED_MATRIX
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [383, 121, 84, 186, 258, 277, 643, 143, 130, 825]; int [] [] [] param0 = [[[-46, -39, -32, -31, -25, -24, -22, -21, -19, -19, -9, -4, -4, 5, 7, 10, 10, 17, 19, 20, 21, 26, 29, 29, 29, 30, 32, 32,...
SUM_MATRIX_ELEMENT_ABSOLUTE_DIFFERENCE_ROW_COLUMN_NUMBERS_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [83328, 124392, 7308, 14280, 70, 114310, 2660, 168, 168, 14280]; int [] param0 = [63, 72, 28, 35, 6, 70, 20, 8, 8, 35]; int n_success = 0; for (int i = 0; i < param0.length; i++) { ...
HEIGHT_COMPLETE_BINARY_TREE_HEAP_N_NODES
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [6, 6, 5, 4, 3, 0, 5, 6, 5, 4]; int [] param0 = [65, 94, 52, 31, 9, 1, 41, 98, 45, 24]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(pa...
PROGRAM_PRINT_IDENTITY_MATRIX_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, false, false, false, false, false, false, false]; int [] [] [] param0 = [[[1]], [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]], [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], ...
INTEGER_POSITIVE_VALUE_POSITIVE_NEGATIVE_VALUE_ARRAY_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [49, 74, 0, 41, -146, 0, 16, -96, 0, 55]; int [] [] param0 = [[49, 98], [82, 66, -68, 24, -10], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [56, 3, 18, 5, 20, 56, 47, 29, 60, 98, 60, 40, 42, 2, 5...
COUNT_POSSIBLE_DECODINGS_GIVEN_DIGIT_SEQUENCE_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 0, 0, 1, 0, 13, 0, 0, 0, 1]; char [] [] param0 = [['b', 'c', 'e', 'e', 'f', 'f', 'g', 'j', 'k', 'k', 'l', 'l', 'm', 'o', 'o', 'p', 'q', 'r', 'v', 'x', 'z', 'a', 'a', 'a', 'c', 'c', 'c', 'd', ...
COUNT_ENTRIES_EQUAL_TO_X_IN_A_SPECIAL_MATRIX
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [8, 5, 4, 0, 3, 5, 4, 6, 0, 5]; int [] param0 = [47, 57, 55, 11, 55, 63, 64, 28, 49, 48]; int [] param1 = [30, 16, 63, 23, 49, 64, 98, 30, 61, 64]; int n_success = 0; for (int i = 0...
FIND_MINIMUM_DIFFERENCE_PAIR
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [0, 0, 0, 1, 10, 0, 0, 0, 0, 0]; 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,...
PROGRAM_TO_FIND_REMAINDER_WITHOUT_USING_MODULO_OR_OPERATOR_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [34, 19, 15, 56, 63, 28, 54, 2, 3, 2]; int [] param0 = [34, 63, 15, 56, 63, 28, 54, 2, 94, 82]; int [] param1 = [55, 22, 26, 58, 94, 45, 97, 58, 91, 40]; int n_success = 0; for (int...
COUNT_POSSIBLE_PATHS_TOP_LEFT_BOTTOM_RIGHT_NXM_MATRIX_2
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 465, 847660528, 84672315, 155117520, 84672315, 847660528, 465, 1]; int [] param0 = [1, 3, 11, 12, 16, 21, 31, 30, 50]; int [] param1 = [50, 30, 31, 21, 16, 12, 11, 3, 1]; int n_succe...
SUM_BINOMIAL_COEFFICIENTS_1
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [256, 4, 32, 128, 8, 2, 64, 512, 32768, 4096]; int [] param0 = [8, 2, 5, 7, 3, 1, 6, 9, 15, 12]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_...
FIND_SUM_ODD_FACTORS_NUMBER
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [6, 4, 56, 6, 12, 8, 1, 40, 84, 4]; int [] param0 = [20, 6, 39, 80, 88, 7, 16, 27, 83, 6]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled...
MOBILE_NUMERIC_KEYPAD_PROBLEM
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [105314726, 465832, 1583522062, 138, 7004156, 2062, 120130, 30984, 7990, 36]; char [] [] [] param0 = [[[' ', 'a', 'c', 'k', 'r', 'r', 'v', 'c', 'd', 'i', 'i', 'j', 'm', 'o', 'q', 'q', 'r', 'r', '...