Datasets:

Modalities:
Text
Formats:
csv
Size:
< 1K
Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
9
106
function_java
stringlengths
50
1.9k
d_with_params
stringlengths
426
32.8k
ADD_1_TO_A_GIVEN_NUMBER
static int f_filled ( int x ) { int m = 1 ; while ( ( int ) ( x & m ) >= 1 ) { x = x ^ m ; m <<= 1 ; } x = x ^ m ; return x ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [97, 67, 68, 14, 76, 79, 2, 84, 28, 66]; int [] param0 = [96, 66, 67, 13, 75, 78, 1, 83, 27, 65]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
PRIMALITY_TEST_SET_1_INTRODUCTION_AND_SCHOOL_METHOD
static boolean f_filled ( int n ) { if ( n <= 1 ) return false ; for ( int i = 2 ; i < n ; i ++ ) if ( n % i == 0 ) return false ; return true ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, true, false, false, false, false, false, false, false]; int [] param0 = [37, 39, 73, 8, 28, 66, 20, 36, 6, 51]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
ADD_1_TO_A_GIVEN_NUMBER_1
static int f_filled ( int x ) { return ( - ( ~ x ) ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [21, 69, 53, 62, 4, 89, 42, 79, 95, 19]; int [] param0 = [20, 68, 52, 61, 3, 88, 41, 78, 94, 18]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
COUNT_SORTED_ROWS_MATRIX
static int f_filled ( int mat [ ] [ ] , int r , int c ) { int result = 0 ; for ( int i = 0 ; i < r ; i ++ ) { int j ; for ( j = 0 ; j < c - 1 ; j ++ ) if ( mat [ i ] [ j + 1 ] <= mat [ i ] [ j ] ) break ; if ( j == c - 1 ) result ++ ; } for ( int i = 0 ; i < r ; i ++ ) { int j ; for ( j = c - 1 ; j > 0 ; j -- ) if ( mat [ i ] [ j - 1 ] <= mat [ i ] [ j ] ) break ; if ( c > 1 && j == 0 ) result ++ ; } return result ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [3, 0, 0, 0, 9, 0, 6, 0, 0, 0]; int [] [] [] param0 = [[[4, 12, 13, 24, 25, 26, 27, 35, 41, 60, 69, 71, 73, 78, 85, 86, 95, 99], [1, 13, 18, 25, 41, 42, 44, 45, 49, 49, 51, 52, 59, 63, 64, 67, 78, 97], [1, 2, 11, 18, 23, 26, 30, 31, 41, 42, 45, 71, 75, 90, 91, 92, 95, 97], [26, 30, 44, 46, 46, 54, 56, 60, 67, 68, 75, 77, 77, 83, 87, 87, 94, 98], [19, 20, 27, 31, 33, 34, 37, 41, 42, 49, 60, 60, 64, 67, 71, 73, 77, 92], [2, 6, 9, 11, 20, 29, 37, 41, 42, 44, 49, 58, 62, 76, 87, 89, 94, 97], [7, 8, 9, 14, 20, 45, 49, 54, 63, 63, 64, 71, 72, 73, 73, 89, 94, 95], [2, 3, 7, 16, 17, 23, 23, 25, 44, 50, 58, 58, 59, 78, 83, 87, 90, 99], [4, 16, 18, 22, 23, 33, 34, 43, 43, 46, 51, 56, 62, 75, 79, 85, 97, 97], [16, 18, 29, 32, 39, 53, 54, 55, 67, 70, 72, 72, 76, 76, 86, 87, 96, 96], [6, 30, 34, 37, 38, 42, 52, 54, 59, 67, 71, 71, 72, 81, 85, 87, 91, 93], [2, 6, 6, 16, 18, 20, 21, 31, 40, 42, 50, 56, 62, 80, 80, 83, 91, 96], [2, 5, 6, 14, 16, 21, 23, 37, 52, 59, 72, 86, 86, 87, 87, 89, 90, 91], [1, 10, 17, 20, 22, 25, 27, 32, 37, 37, 44, 49, 65, 78, 80, 81, 85, 95], [1, 13, 14, 21, 43, 50, 52, 58, 62, 64, 65, 66, 66, 66, 67, 70, 81, 82], [1, 2, 9, 16, 17, 23, 25, 29, 30, 31, 42, 65, 73, 74, 82, 87, 92, 92], [1, 5, 9, 13, 21, 28, 32, 33, 34, 38, 46, 60, 80, 86, 93, 94, 96, 98], [11, 18, 23, 24, 25, 26, 28, 48, 59, 59, 67, 72, 82, 83, 86, 89, 92, 96]], [[82, 82, 2, 8, -32, 90, -76, -64, -66, -46, -72, -58, -28, -86, -8, -96, -62, -32, 54, -16, 96, 28, 76, 90, -40, 98, 88, -90, 4, -50, 70, 32, -74, -72, -72, 10, 36, 50, -16, -36], [-52, -6, 12, -6, -64, 6, 38, -14, -86, 74, -74, 82, 54, 2, 46, -94, 88, 86, -32, -72, 72, 88, 90, -8, -58, 32, -90, -68, -70, 72, 34, 74, -30, 92, 90, -88, 82, -54, 42, 94], [-4, -32, -12, -96, 16, -32, 32, 52, 2, -6, 2, -10, 40, -64, 4, -56, -50, 46, 54, -6, -14, -40, -98, -4, -20, 98, 94, 60, -70, -94, 52, -4, 32, 20, -30, -94, -50, 50, -86, -66], [10, 84, 2, -44, -54, -82, -64, 70, -20, -40, -50, 10, 26, -14, -88, 10, -80, -48, 10, 16, -14, -52, 74, -60, 48, -60, -62, 38, 56, -34, 86, 20, 74, -20, 28, -46, -44, 96, -58, -8], [-48, -36, -18, -66, -20, 60, -36, 34, -94, 44, -14, -34, -84, -26, 38, 48, 14, 12, 72, -76, 26, 50, -58, 40, 90, 14, -40, 22, -26, -24, 66, -62, -34, 16, -34, -30, 54, -76, -26, 4], [-26, 56, 74, -82, 58, -42, -98, 96, -24, -36, -86, -80, 42, 78, -2, -90, -8, -52, 46, -20, -16, 64, -36, -8, -16, -60, 96, 40, 66, 98, 14, -36, -78, -40, 52, 60, -20, 38, 26, -98], [-12, 60, -56, -66, 68, -20, -74, 30, 14, -36, -22, -54, 50, 62, -44, 14, 90, 66, 80, 76, -86, 92, -80, -6, 48, 44, 24, 40, 94, -42, 68, 28, -20, 98, 40, 50, -18, 90, 6, 2], [-98, 4, -32, -34, -64, 58, 16, 48, 82, 10, 36, 32, -60, -40, 2, -14, -58, 28, -44, 60, -28, -6, -68, 46, -50, 62, 10, 44, -4, 76, 60, -26, 52, 40, -88, -56, -36, -70, -66, -22], [18, -66, -82, 52, 34, -86, -50, -64, 18, 10, -14, 8, 80, -76, 20, 76, 96, -12, -36, 86, -10, 16, -14, 66, -4, 14, -82, 0, 2, 90, 78, -48, 42, -60, 90, -16, 80, 16, -64, -58], [12, 8, -74, 78, 46, -84, 20, 14, -2, -42, -80, -66, -64, 34, 58, 0, 28, -8, 34, 92, -14, -54, 82, 68, 64, 6, 30, 78, -50, -28, -74, -12, -18, 82, -50, -86, -2, -78, 94, -66], [10, -76, 58, 32, -44, 60, -14, 24, -92, 24, 16, 80, 90, -60, -6, 8, -50, 90, 60, 82, 6, 84, 74, -48, -98, -2, -38, 74, 64, 52, 8, -32, -58, -58, 70, -14, 68, 46, 32, 74], [84, 98, 78, 34, -94, 84, 10, 84, 10, -58, -70, -30, 98, -28, -80, 56, -36, 96, 82, 38, 2, -38, 28, 18, 82, 60, -16, -64, 90, 34, -10, 98, 36, 40, -6, -32, -32, -24, 92, 12], [54, 92, -30, -12, 40, 48, 8, 34, -20, -58, 8, -14, 0, -34, 98, -32, -98, 40, -44, 34, 94, -56, -90, 64, 4, -76, -34, -68, 48, 28, 84, -4, -46, -54, 72, -82, 0, -82, 38, -6], [44, -66, -86, 54, -4, 36, 62, 88, -16, -88, -26, -50, -84, -90, 38, 14, 62, 14, -92, 64, -50, -2, -96, -4, 94, -84, 26, -86, -68, 6, -18, -66, -56, -88, -92, -86, 64, -6, -92, -12], [-36, 80, -28, -42, 58, -12, -66, -38, -76, 34, -52, -32, -80, 66, 54, -2, -40, 78, 14, -54, 6, -92, 68, -40, 72, -80, 52, -60, 98, -60, -92, 26, -24, 26, 46, 34, 80, -92, 16, 16], [-4, 60, -72, -6, 46, 76, -8, 82, 42, -68, -86, 10, 20, 80, -22, 64, -40, 22, -6, -58, -74, -86, -16, -14, -76, -54, -98, -50, -74, 80, -44, 18, -70, -80, 58, -48, -70, 44, 46, 88], [-80, -76, -46, -92, -78, -72, -56, 72, -52, -86, -48, 6, 84, 38, -14, 66, 48, 86, 36, -80, -54, -44, -88, -18, -50, -56, -20, -14, -52, -98, -44, -76, -42, -66, -20, 62, 0, -54, -82, -70], [44, 98, 78, 56, -14, -70, -24, 62, 88, 70, -42, 72, 80, 42, 22, -90, -50, -22, 14, 40, 42, 34, 66, -58, 70, 22, -86, 58, -82, 54, -20, 72, 20, 32, 8, 30, 52, -6, -12, -62], [-4, 70, -76, 22, 22, 44, -84, -74, 34, -36, 64, -78, 50, 72, -40, -78, -26, -66, -84, -28, -40, -96, 66, 36, -28, -18, 4, 0, 20, 18, 78, -74, -58, -64, -68, 68, -84, 20, -56, -16], [0, 24, 64, -50, -36, 70, -88, -34, 70, 68, -68, 80, 88, 12, -50, 74, 32, 18, -14, 74, 58, 68, -62, -30, 20, 94, -68, 96, -32, -94, -70, -44, -76, -94, 34, 54, -74, 62, -80, -10], [-64, -26, -26, 44, 14, -72, -74, 36, -8, -64, -34, 6, 18, 14, 74, -90, 66, -12, -6, -6, -12, -58, 72, 18, 62, -44, 12, -56, 66, 34, 44, 0, -98, 96, -94, -60, 76, 52, 48, -6], [6, -58, 14, 82, -72, 0, 92, 8, -6, -18, 74, -66, 68, -24, -20, 90, -48, 54, 18, -24, -8, -48, 72, -78, -54, 84, 18, -52, -36, -30, -82, -34, 8, -94, -34, -78, -28, 44, 92, -78], [-50, -84, -82, -12, 62, -72, -36, 84, -36, -82, 12, -52, 12, -34, 36, 8, -24, 58, 6, -34, 0, -22, 46, 98, 62, 80, -88, -24, 98, 30, 22, 94, -38, -24, 78, 62, 0, -10, 2, 52], [94, -10, -88, -12, -10, 56, -86, 18, 54, -20, 22, -18, 76, -88, -38, 38, -88, -20, 82, 88, -80, -34, 14, 54, 28, -46, -88, -84, -86, 38, 86, 26, 98, -28, 14, -24, -22, -80, -98, 58], [60, 52, 12, -86, -54, -30, 10, -2, -54, -74, 56, 74, -74, 92, 86, -92, -28, -54, 30, -56, 40, 96, 92, 16, 82, -70, -80, 92, -80, 14, 56, -6, 8, -92, 20, 10, -50, -64, -34, 50], [64, 70, -74, -72, 78, 46, 42, 44, -96, -18, -62, 56, -90, -14, 38, 82, 8, -58, 52, 92, -90, 22, -60, 62, 60, -64, -56, -74, 92, -2, -90, -14, -56, -64, 38, 18, -52, -92, 30, -36], [50, 84, 82, 36, 60, 34, -50, -64, -72, 30, 8, 84, 48, -24, 78, 80, -10, -90, 82, -80, -4, -94, 24, 92, 92, -16, -80, 68, 60, 98, -92, 52, 60, 8, -72, 12, -60, -84, -44, -34], [-98, -30, 30, 36, 96, 74, -82, -2, -72, -38, -40, 10, 92, 30, 98, -28, 56, 70, -84, 66, 40, 92, 42, -86, -58, -90, -10, 98, -12, -80, 94, 4, -84, 60, 94, -90, 74, -68, 64, -76], [2, 94, 38, -6, 64, 4, -42, 92, -12, 54, 82, 90, -64, 32, 0, -24, -16, -68, 78, 54, 28, -86, -56, 4, 16, 98, 32, -18, -76, 90, -6, 72, 40, 20, 6, -90, 52, -62, 4, 30], [22, 90, 54, -34, -30, 0, -72, -6, 36, 28, -96, 86, -2, -48, -30, 8, -60, -32, 24, -50, -76, -86, 32, 28, -66, -88, 24, 86, 72, 96, 22, -32, -92, -26, 48, -52, -12, 4, -94, 2], [-44, 70, 38, 36, -36, 46, -68, -44, -36, 34, -32, -44, -22, -80, -64, 28, 60, 92, -52, 14, 42, -80, -70, 50, 24, -34, 16, 64, 62, -94, 18, -48, -68, 16, 76, -42, 30, -88, 46, -12], [46, 46, 44, 16, -70, -6, -78, -46, 70, 30, 70, 88, 66, 56, -12, 4, 76, -50, -28, -98, -16, -86, -68, 36, 28, -92, -46, -86, -2, 90, 6, 36, -62, -30, -26, -38, 22, -60, -20, -70], [80, 38, -94, -42, 70, -20, 42, -62, -30, 54, 82, -94, -78, 74, 60, 54, -52, -56, 66, 86, -30, -14, 0, -6, -22, 56, 70, -86, 50, 82, 72, -10, 54, 24, -46, -26, -20, -54, -96, 30], [-48, 94, 54, -16, 70, 20, -20, -2, -8, 84, -60, 30, -18, -14, 32, 42, 24, 26, -12, -62, 2, -94, 26, 36, -88, -22, -64, 46, 36, 74, -44, -56, -36, -98, 70, 72, -68, 68, 76, -32], [-4, 36, 0, 14, -42, -38, -98, -2, -44, -90, 82, 80, -66, 38, 62, 34, 52, 44, -22, 80, -74, -88, -74, 24, 98, 8, 18, -26, -4, -82, -60, 44, -2, 30, 20, 52, 26, -22, -54, 96], [98, -54, -12, -12, -74, 34, -6, -36, -94, 40, 96, 42, -32, -46, -46, 88, -90, 26, -98, 30, 92, -34, 74, -94, 36, -68, -66, 74, -2, 6, 94, -12, 82, 90, -2, 78, -80, -84, 18, 74], [-42, 30, 56, -74, -16, -44, 4, -62, -12, -62, -22, 64, 56, 96, -16, 40, 10, 88, -66, 54, 56, 96, 74, -6, -36, -70, -82, 74, -14, -18, -32, -70, 60, 26, -88, -78, -8, 32, -84, 90], [-44, -14, -44, 96, 0, 54, 2, 74, 36, -56, -98, -16, -70, 68, -88, 26, -18, 30, 62, -88, -28, -58, 62, -38, -62, 28, -80, -6, 88, -16, 64, -58, 14, 94, -40, 2, -12, -16, -24, -64], [20, 18, -94, 94, -2, -74, -56, -46, 62, -88, -16, -30, -10, -54, 38, 22, -42, 32, 28, -42, 44, 64, 46, 66, -96, 70, -32, 10, -14, 72, -42, 98, -54, 36, 76, 24, -96, 86, 54, -88], [74, -48, 90, 78, -44, 0, 76, -16, -28, -92, 10, -32, -30, -78, -8, 40, -90, 74, -40, 16, -78, 22, -42, 36, 68, 44, 42, 6, -60, 36, -74, -92, 92, -44, 40, -92, -46, 56, -36, -94]], [[0, 0, 0, 0, 0, 0, 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, 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], [0, 0, 0, 0, 0, 0, 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, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 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, 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, 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, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 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, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 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, 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, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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], [0, 0, 0, 0, 0, 0, 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, 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, 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], [0, 0, 0, 0, 0, 0, 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, 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, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], [[91, 8, 34, 7, 66, 59, 90, 78, 54, 77, 55, 29, 90, 69, 85, 42, 39, 49, 83, 59, 3, 41, 65, 60, 4, 45, 65, 29, 47, 40, 96, 11, 21, 74, 34, 83, 12, 3, 6, 67, 30, 29, 40, 87, 35, 73, 17, 13, 20], [38, 36, 55, 16, 85, 38, 67, 15, 37, 25, 81, 61, 31, 68, 31, 11, 23, 39, 35, 21, 66, 66, 52, 49, 55, 35, 40, 47, 99, 25, 91, 6, 50, 3, 62, 11, 46, 88, 95, 17, 40, 70, 35, 76, 59, 84, 4, 99, 84], [61, 2, 63, 5, 81, 77, 7, 32, 74, 17, 53, 17, 86, 5, 86, 15, 80, 84, 94, 64, 86, 94, 64, 7, 90, 64, 15, 94, 56, 51, 64, 84, 77, 70, 49, 2, 46, 96, 64, 25, 18, 54, 39, 73, 77, 23, 46, 14, 23], [48, 22, 2, 60, 46, 8, 3, 70, 58, 6, 27, 23, 71, 92, 10, 45, 48, 85, 81, 86, 61, 27, 85, 75, 1, 49, 47, 82, 8, 74, 92, 40, 61, 27, 12, 30, 37, 66, 84, 36, 86, 40, 36, 96, 60, 96, 70, 27, 41], [13, 6, 54, 10, 54, 19, 24, 61, 87, 77, 14, 45, 37, 15, 74, 4, 47, 61, 78, 91, 68, 99, 67, 70, 70, 26, 72, 19, 75, 93, 56, 66, 76, 80, 49, 45, 62, 85, 50, 51, 48, 40, 48, 13, 69, 62, 82, 13, 13], [25, 75, 45, 24, 38, 4, 19, 83, 38, 61, 21, 59, 71, 72, 76, 59, 36, 31, 72, 23, 16, 22, 68, 40, 28, 60, 89, 87, 87, 89, 16, 11, 45, 89, 75, 25, 43, 67, 69, 41, 66, 91, 38, 62, 73, 29, 13, 45, 68], [30, 1, 39, 11, 69, 4, 8, 3, 52, 59, 24, 47, 88, 62, 30, 96, 38, 80, 62, 86, 81, 12, 72, 65, 10, 64, 95, 58, 60, 95, 51, 60, 89, 35, 54, 85, 67, 38, 58, 85, 12, 40, 5, 47, 35, 95, 26, 60, 33], [47, 58, 24, 5, 76, 9, 56, 45, 32, 69, 14, 63, 7, 2, 55, 36, 29, 59, 15, 64, 65, 80, 99, 2, 99, 23, 18, 98, 26, 38, 58, 52, 92, 53, 18, 40, 86, 93, 18, 26, 71, 65, 29, 91, 80, 91, 29, 44, 31], [63, 5, 55, 56, 10, 58, 53, 43, 89, 30, 98, 71, 20, 94, 28, 27, 65, 65, 54, 66, 69, 28, 82, 30, 2, 13, 71, 16, 31, 55, 65, 62, 76, 66, 36, 70, 42, 66, 82, 73, 63, 21, 27, 89, 44, 99, 70, 75, 96], [6, 19, 62, 34, 59, 79, 75, 95, 84, 64, 95, 81, 81, 77, 83, 62, 24, 4, 18, 97, 33, 43, 57, 40, 90, 65, 10, 88, 84, 54, 68, 58, 40, 46, 88, 32, 1, 97, 4, 36, 41, 57, 30, 13, 43, 77, 88, 99, 29], [23, 37, 24, 76, 53, 11, 28, 95, 2, 89, 27, 47, 2, 3, 12, 67, 25, 66, 7, 38, 45, 63, 15, 93, 2, 12, 44, 28, 68, 27, 52, 23, 85, 4, 59, 92, 35, 17, 27, 7, 91, 20, 84, 22, 26, 34, 63, 87, 54], [97, 74, 14, 36, 43, 72, 69, 25, 78, 13, 46, 10, 88, 50, 49, 98, 55, 43, 22, 78, 13, 78, 46, 9, 24, 32, 61, 91, 51, 53, 58, 95, 54, 47, 11, 21, 18, 60, 10, 27, 82, 66, 90, 40, 45, 52, 98, 85, 16], [34, 59, 78, 37, 11, 87, 79, 40, 58, 33, 82, 33, 96, 86, 94, 40, 71, 85, 59, 22, 65, 73, 20, 63, 76, 91, 24, 29, 68, 27, 45, 97, 69, 33, 43, 86, 92, 31, 19, 32, 15, 39, 37, 19, 14, 38, 5, 53, 20], [44, 25, 58, 89, 40, 99, 34, 90, 26, 87, 63, 16, 43, 84, 77, 25, 48, 55, 7, 47, 43, 84, 3, 41, 28, 65, 34, 9, 43, 39, 76, 8, 52, 12, 75, 43, 16, 94, 18, 93, 12, 83, 54, 15, 27, 81, 46, 89, 24], [67, 92, 60, 34, 46, 5, 80, 64, 53, 65, 94, 65, 36, 66, 56, 52, 82, 54, 32, 55, 69, 88, 43, 41, 11, 8, 33, 95, 32, 48, 71, 9, 89, 7, 2, 33, 29, 76, 33, 38, 99, 48, 99, 92, 68, 22, 70, 19, 14], [90, 32, 71, 27, 57, 73, 87, 90, 40, 24, 15, 27, 70, 87, 74, 29, 8, 30, 17, 87, 13, 93, 46, 87, 12, 30, 43, 80, 14, 3, 23, 75, 67, 51, 23, 49, 69, 69, 69, 54, 57, 46, 60, 43, 47, 70, 14, 30, 95], [69, 58, 48, 20, 45, 70, 13, 66, 65, 42, 62, 76, 9, 8, 17, 28, 22, 2, 60, 6, 73, 54, 24, 32, 15, 11, 75, 62, 8, 99, 51, 36, 83, 15, 55, 18, 17, 78, 80, 82, 97, 70, 60, 46, 78, 16, 1, 26, 43], [34, 59, 69, 68, 91, 5, 24, 72, 81, 23, 64, 19, 72, 6, 66, 72, 91, 96, 65, 11, 28, 27, 27, 87, 87, 61, 29, 52, 86, 14, 41, 86, 59, 5, 42, 91, 22, 50, 9, 6, 99, 37, 24, 4, 8, 67, 62, 38, 99], [62, 48, 96, 3, 14, 75, 47, 80, 50, 61, 51, 77, 82, 37, 31, 49, 87, 48, 94, 4, 92, 94, 99, 26, 65, 29, 18, 4, 9, 14, 35, 60, 54, 33, 52, 49, 44, 31, 53, 95, 28, 3, 14, 97, 53, 19, 80, 73, 5], [18, 14, 24, 76, 93, 33, 55, 40, 65, 59, 45, 3, 29, 17, 12, 4, 60, 72, 23, 82, 14, 94, 65, 19, 24, 50, 91, 80, 96, 78, 41, 37, 75, 77, 4, 94, 69, 80, 48, 5, 55, 85, 43, 58, 36, 3, 8, 40, 87], [92, 18, 42, 47, 28, 4, 55, 10, 46, 52, 75, 20, 48, 62, 7, 14, 78, 95, 49, 58, 14, 2, 43, 29, 57, 98, 83, 90, 56, 62, 92, 91, 2, 69, 79, 44, 1, 5, 43, 54, 34, 88, 67, 60, 42, 37, 56, 51, 3], [28, 31, 22, 14, 75, 56, 68, 57, 39, 10, 73, 69, 72, 27, 79, 2, 99, 99, 10, 24, 48, 56, 19, 9, 21, 80, 36, 43, 11, 49, 85, 49, 84, 84, 28, 48, 13, 80, 39, 94, 8, 19, 97, 73, 3, 12, 29, 34, 34], [99, 50, 58, 74, 49, 22, 2, 84, 94, 89, 94, 38, 68, 86, 42, 41, 43, 69, 49, 17, 17, 96, 78, 18, 93, 48, 18, 32, 87, 16, 6, 70, 97, 72, 55, 20, 40, 56, 51, 54, 3, 57, 69, 71, 74, 18, 64, 31, 39], [23, 18, 26, 32, 12, 65, 32, 90, 98, 14, 8, 79, 44, 56, 52, 33, 34, 31, 92, 95, 99, 11, 90, 65, 59, 95, 49, 27, 77, 64, 21, 33, 2, 69, 11, 67, 65, 89, 40, 12, 66, 60, 65, 10, 62, 48, 32, 84, 43], [87, 26, 33, 4, 89, 44, 32, 68, 19, 61, 35, 74, 56, 55, 82, 66, 79, 76, 10, 64, 95, 33, 87, 89, 88, 67, 11, 14, 85, 99, 56, 78, 72, 51, 43, 44, 76, 11, 77, 14, 83, 70, 44, 58, 2, 46, 75, 61, 31], [93, 73, 8, 30, 6, 84, 16, 28, 43, 47, 80, 29, 89, 86, 91, 83, 98, 42, 91, 65, 20, 77, 34, 1, 24, 57, 77, 96, 66, 61, 55, 63, 7, 1, 52, 67, 85, 47, 32, 74, 88, 34, 94, 73, 7, 59, 78, 47, 42], [90, 35, 30, 1, 10, 96, 62, 91, 53, 13, 6, 33, 44, 6, 62, 49, 40, 35, 55, 30, 96, 98, 51, 57, 83, 45, 52, 51, 64, 70, 92, 99, 91, 2, 7, 95, 50, 77, 82, 23, 2, 56, 39, 97, 86, 55, 72, 69, 92], [45, 12, 56, 49, 85, 32, 64, 91, 3, 47, 10, 82, 50, 33, 71, 53, 94, 32, 57, 63, 59, 65, 83, 85, 73, 94, 28, 95, 76, 11, 51, 17, 87, 12, 69, 65, 58, 31, 76, 94, 13, 42, 15, 43, 34, 14, 60, 88, 24], [75, 34, 12, 19, 35, 60, 73, 5, 33, 74, 27, 12, 68, 58, 69, 94, 31, 99, 86, 32, 35, 78, 56, 6, 43, 71, 30, 56, 88, 14, 46, 41, 12, 6, 52, 15, 84, 52, 6, 13, 60, 49, 61, 45, 42, 72, 51, 82, 99], [95, 81, 81, 39, 93, 29, 96, 7, 99, 11, 94, 42, 1, 16, 99, 74, 68, 49, 15, 6, 15, 80, 68, 25, 86, 69, 76, 6, 64, 96, 87, 57, 94, 99, 39, 71, 3, 92, 68, 30, 5, 91, 49, 40, 5, 26, 58, 82, 90], [4, 57, 97, 16, 67, 90, 23, 89, 24, 84, 90, 66, 76, 51, 21, 44, 41, 52, 54, 71, 14, 64, 80, 49, 88, 2, 94, 76, 10, 71, 78, 1, 59, 39, 18, 56, 45, 43, 95, 13, 30, 93, 86, 78, 21, 14, 31, 98, 76], [40, 86, 5, 71, 50, 83, 56, 89, 56, 6, 75, 48, 16, 31, 65, 10, 90, 63, 84, 63, 1, 81, 6, 21, 89, 58, 70, 18, 72, 49, 10, 68, 2, 99, 10, 51, 86, 63, 55, 77, 90, 32, 53, 48, 99, 76, 45, 31, 52], [99, 19, 61, 12, 65, 15, 53, 96, 50, 46, 9, 32, 91, 55, 84, 30, 59, 58, 92, 99, 37, 68, 94, 78, 59, 47, 51, 4, 89, 10, 84, 84, 43, 83, 95, 2, 54, 81, 22, 60, 11, 30, 98, 59, 57, 37, 88, 43, 9], [14, 75, 98, 81, 61, 53, 54, 7, 97, 68, 98, 21, 92, 20, 12, 26, 14, 69, 52, 59, 36, 37, 89, 82, 13, 57, 26, 34, 12, 72, 12, 63, 91, 10, 21, 73, 46, 60, 8, 17, 5, 50, 30, 10, 83, 53, 97, 90, 39], [64, 61, 79, 7, 82, 31, 35, 88, 41, 39, 61, 54, 15, 67, 50, 86, 79, 58, 54, 9, 51, 83, 47, 8, 43, 6, 53, 61, 51, 45, 90, 42, 38, 35, 70, 7, 1, 18, 26, 87, 51, 76, 34, 82, 76, 66, 10, 66, 7], [62, 86, 31, 83, 51, 75, 40, 72, 22, 4, 42, 47, 56, 77, 36, 55, 36, 36, 74, 55, 67, 3, 96, 88, 38, 68, 2, 34, 92, 83, 16, 97, 70, 13, 36, 65, 73, 20, 49, 53, 49, 13, 32, 47, 42, 29, 26, 81, 44], [44, 18, 97, 11, 67, 31, 23, 89, 39, 31, 82, 62, 55, 55, 15, 83, 66, 6, 13, 58, 88, 97, 62, 21, 37, 75, 27, 18, 78, 11, 52, 47, 33, 9, 87, 49, 38, 67, 12, 14, 3, 5, 60, 63, 13, 22, 2, 31, 45], [55, 47, 20, 4, 13, 45, 34, 25, 95, 4, 13, 19, 1, 36, 74, 85, 51, 23, 35, 95, 23, 65, 63, 58, 67, 12, 18, 51, 21, 23, 38, 87, 92, 65, 69, 14, 48, 62, 86, 73, 41, 52, 12, 55, 85, 46, 88, 44, 38], [83, 29, 86, 98, 92, 66, 4, 69, 74, 50, 78, 75, 3, 44, 78, 34, 12, 54, 17, 90, 23, 97, 21, 96, 6, 3, 73, 5, 58, 93, 45, 64, 2, 97, 33, 93, 14, 62, 68, 19, 53, 66, 78, 5, 52, 94, 84, 60, 54], [15, 44, 11, 54, 64, 99, 91, 94, 57, 73, 95, 25, 24, 4, 66, 11, 84, 83, 50, 89, 31, 83, 27, 75, 98, 49, 15, 3, 59, 20, 67, 67, 4, 67, 23, 97, 87, 17, 67, 57, 91, 34, 81, 99, 90, 29, 55, 88, 28], [18, 89, 80, 81, 71, 51, 19, 14, 63, 18, 10, 40, 7, 64, 41, 55, 51, 75, 30, 89, 7, 18, 18, 89, 46, 98, 25, 1, 71, 6, 43, 89, 88, 30, 90, 30, 37, 57, 99, 3, 37, 91, 45, 69, 46, 32, 19, 51, 83], [11, 5, 99, 30, 60, 57, 35, 66, 16, 60, 93, 22, 7, 20, 58, 29, 91, 80, 59, 81, 52, 1, 51, 79, 88, 26, 92, 40, 12, 59, 9, 57, 42, 94, 24, 17, 79, 36, 48, 71, 83, 48, 88, 50, 69, 12, 62, 27, 22], [50, 91, 58, 61, 4, 65, 8, 12, 10, 67, 97, 24, 59, 37, 57, 29, 58, 43, 66, 25, 7, 97, 93, 73, 98, 24, 86, 31, 8, 30, 64, 93, 66, 4, 91, 78, 70, 67, 33, 5, 63, 41, 16, 39, 7, 42, 21, 22, 75], [2, 16, 31, 71, 84, 77, 39, 36, 83, 7, 14, 43, 53, 3, 76, 98, 29, 68, 75, 3, 5, 94, 73, 21, 2, 97, 73, 48, 6, 66, 45, 85, 27, 99, 62, 67, 34, 66, 13, 39, 18, 11, 4, 35, 62, 55, 91, 86, 63], [1, 57, 15, 25, 30, 61, 83, 28, 24, 17, 60, 56, 58, 7, 68, 10, 76, 6, 35, 18, 28, 55, 82, 52, 19, 18, 63, 40, 49, 95, 82, 76, 78, 85, 61, 79, 31, 48, 49, 40, 60, 67, 65, 86, 71, 44, 45, 58, 33], [64, 70, 88, 84, 20, 95, 73, 14, 2, 56, 94, 73, 83, 25, 93, 58, 49, 91, 76, 72, 10, 42, 73, 35, 49, 88, 12, 87, 78, 87, 78, 38, 57, 81, 12, 19, 14, 75, 71, 24, 78, 32, 23, 61, 8, 68, 61, 54, 4], [22, 20, 70, 20, 61, 33, 74, 38, 14, 2, 88, 96, 31, 86, 10, 34, 61, 59, 92, 47, 92, 70, 52, 1, 39, 47, 62, 17, 92, 95, 7, 5, 56, 73, 86, 36, 25, 73, 10, 90, 38, 25, 42, 88, 3, 75, 44, 71, 61], [90, 36, 14, 93, 21, 25, 23, 58, 5, 43, 65, 53, 93, 76, 93, 25, 48, 20, 73, 42, 28, 2, 92, 13, 24, 28, 20, 88, 53, 90, 52, 86, 33, 31, 39, 58, 19, 80, 54, 24, 19, 48, 11, 17, 41, 13, 63, 56, 48], [87, 89, 92, 89, 55, 51, 31, 4, 3, 3, 8, 39, 23, 32, 25, 74, 83, 66, 79, 54, 45, 97, 33, 22, 89, 1, 7, 91, 97, 2, 55, 18, 32, 69, 12, 71, 94, 85, 56, 47, 16, 27, 99, 80, 32, 15, 50, 79, 25]], [[-94, -78, -30, -16, -14, 22, 44, 44, 54, 60, 68, 72, 92, 94, 98], [-92, -68, -52, -40, -30, -28, -20, -16, 14, 38, 42, 54, 60, 72, 86], [-78, -68, -58, -36, -10, -10, 42, 48, 52, 52, 58, 68, 72, 78, 96], [-94, -86, -84, -60, -40, 0, 0, 22, 48, 56, 70, 72, 80, 90, 96], [-98, -92, -80, -68, -58, 38, 50, 52, 58, 60, 62, 62, 72, 86, 90], [-94, -92, -70, -64, -46, -38, -32, -14, -10, -6, 18, 30, 32, 74, 98], [-72, -60, -52, -50, -26, -24, -6, 4, 10, 40, 46, 86, 88, 98, 98], [-94, -72, -40, -36, -36, -28, 0, 18, 34, 36, 38, 44, 50, 54, 98], [-72, -60, -40, -38, -36, -26, -18, -8, -2, 2, 30, 34, 50, 76, 80], [-96, -74, -46, -38, -26, -16, -10, 2, 2, 20, 28, 48, 48, 60, 90], [-86, -60, -58, -58, -46, -40, -4, 2, 16, 18, 26, 62, 64, 78, 98], [-98, -50, -12, -10, -2, 12, 20, 40, 60, 66, 76, 78, 84, 90, 92], [-72, -68, -68, -52, -8, -6, 10, 20, 42, 52, 54, 56, 72, 86, 90], [-80, -74, -32, 10, 18, 54, 62, 74, 76, 78, 86, 86, 88, 94, 96], [-98, -78, -76, -72, -56, -30, -26, 0, 36, 42, 44, 76, 84, 88, 94]], [[0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0], [0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1], [1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0], [1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0], [1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0], [1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0], [1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1], [1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0], [0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1], [0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1], [1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1], [0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1], [1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0], [1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0], [1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1], [0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0], [1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1], [1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0], [1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0], [1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0], [0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1], [1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1], [1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1], [0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0]], [[2, 21, 39, 67, 70, 73, 83, 86, 87, 93], [31, 42, 53, 56, 64, 65, 85, 89, 94, 98], [3, 15, 17, 50, 52, 67, 73, 82, 91, 94], [12, 15, 16, 21, 23, 30, 33, 38, 50, 89], [5, 7, 25, 28, 38, 43, 43, 58, 64, 86], [24, 26, 29, 33, 46, 47, 52, 71, 86, 96], [7, 10, 23, 24, 36, 39, 47, 61, 77, 89], [1, 10, 26, 27, 61, 62, 64, 80, 85, 94], [3, 8, 16, 32, 37, 48, 54, 58, 77, 82], [43, 52, 70, 76, 81, 84, 84, 85, 95, 99]], [[62, -24, -62, -18, 46, 14, 90, -42, -98, -52, 36, 96, 26, -26, 38, -88, 88, -98, -86], [-24, 58, -70, -56, 68, -66, -24, 30, -86, -74, 98, -24, -48, -28, 24, -64, 22, 46, 40], [2, -30, -94, 6, -24, -42, -70, -20, -80, 14, 74, 72, -68, 58, 36, 40, 88, -80, 54], [-24, -50, -96, -36, 36, 30, -58, 64, 98, -86, -74, -18, -64, 74, -46, -24, 68, 34, 24], [-34, 96, 14, -50, -68, -72, -38, -52, 56, 4, 60, -90, -70, 16, -4, 0, -82, 2, -16], [22, 10, 54, -86, 14, 12, 64, -54, 92, 2, 88, 50, -24, -86, -32, 46, -66, -26, -90], [-22, 26, 44, 2, 70, -94, -78, 32, -30, -64, 90, -16, 68, -60, -10, -18, -64, 20, -18], [72, -14, -98, -54, 72, 18, 24, 4, -16, -26, 78, -80, 26, -10, 18, 20, 22, 68, 20], [-32, 74, 14, -18, 88, 42, 6, -6, -16, -30, 80, -16, 24, -96, -96, -52, -38, -34, -46], [-12, -72, -48, 52, -64, -30, 26, 64, 0, 34, 52, -66, 98, -96, -52, -96, 38, -56, -32], [-2, 18, -60, -52, -46, 62, -10, 82, -24, 34, 72, 50, -98, -96, 78, 86, 6, 32, -60], [-44, -52, -66, -46, 24, 80, -68, 92, -32, 26, -44, 30, 72, -56, -56, 28, -26, 22, -92], [82, -58, -60, -30, -68, -18, -72, 98, 92, -28, -30, 44, 78, 10, 54, 56, 2, -92, 24], [4, 96, -84, 68, 14, -86, 6, 22, -6, -60, 2, -38, -48, 48, -74, -52, -44, -68, -96], [46, 4, 16, 20, -12, 86, -56, 88, 8, -68, 56, 14, 2, -38, -20, -42, -64, 86, 30], [96, 68, -74, 14, 66, -20, 72, 60, 56, -78, -14, 2, 60, 16, -2, -90, -46, 24, 68], [-80, 40, 72, -88, -2, 12, -96, -34, -88, 94, 46, -62, 84, -68, 14, -62, -26, -94, -66], [24, -60, -30, -22, -42, -2, -52, 76, -16, 26, -82, 64, 88, 6, -42, -46, 36, 50, 98], [-30, -16, -80, -16, -42, -6, 60, -78, -94, -42, -20, 44, -78, 70, 48, -84, -52, -22, 46]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [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], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], [[58, 85, 97, 21, 67, 89, 63, 21, 3, 59, 28, 4, 57, 94, 75, 40, 26, 76, 91, 6, 64, 58, 31, 26, 69, 56], [61, 73, 86, 49, 29, 98, 33, 19, 25, 73, 53, 43, 38, 38, 35, 8, 76, 31, 86, 93, 82, 13, 22, 28, 38, 88], [36, 22, 61, 11, 68, 82, 29, 74, 11, 31, 71, 46, 70, 47, 91, 56, 26, 34, 52, 41, 82, 3, 21, 59, 15, 3], [67, 75, 36, 39, 7, 71, 38, 63, 36, 73, 77, 63, 61, 19, 58, 96, 24, 71, 76, 5, 92, 80, 56, 51, 57, 11], [81, 94, 93, 62, 55, 71, 63, 25, 30, 12, 82, 98, 12, 57, 44, 59, 67, 18, 56, 20, 37, 80, 66, 57, 34, 64], [69, 90, 68, 50, 46, 79, 27, 12, 24, 37, 33, 24, 2, 33, 50, 3, 21, 20, 30, 30, 27, 8, 82, 99, 71, 83], [4, 52, 66, 74, 99, 99, 10, 51, 25, 84, 50, 37, 10, 56, 36, 42, 92, 89, 70, 67, 17, 89, 44, 63, 1, 34], [78, 19, 58, 40, 15, 68, 31, 14, 96, 72, 74, 34, 10, 64, 69, 91, 12, 65, 82, 30, 20, 76, 73, 22, 49, 65], [11, 46, 64, 46, 13, 96, 43, 95, 47, 18, 45, 16, 69, 36, 53, 50, 24, 68, 43, 91, 31, 48, 47, 1, 91, 44], [86, 37, 91, 17, 78, 5, 39, 37, 62, 68, 26, 91, 19, 64, 42, 55, 65, 56, 85, 33, 90, 70, 97, 51, 61, 42], [47, 84, 97, 98, 53, 58, 83, 86, 30, 42, 4, 72, 67, 32, 50, 37, 43, 92, 40, 6, 1, 98, 25, 16, 36, 18], [5, 15, 23, 78, 81, 92, 74, 55, 30, 59, 43, 27, 48, 24, 33, 90, 79, 61, 16, 76, 13, 75, 13, 91, 86, 97], [50, 81, 63, 53, 30, 92, 83, 19, 43, 90, 40, 66, 2, 92, 72, 35, 87, 11, 26, 55, 26, 92, 80, 79, 68, 73], [2, 55, 80, 76, 99, 98, 8, 31, 23, 87, 99, 75, 72, 45, 79, 70, 84, 36, 9, 78, 44, 45, 38, 96, 66, 39], [78, 28, 1, 62, 38, 69, 48, 57, 89, 60, 15, 7, 67, 99, 63, 37, 65, 27, 1, 8, 17, 15, 1, 39, 11, 49], [20, 70, 15, 29, 42, 31, 49, 87, 50, 11, 66, 55, 21, 35, 77, 7, 65, 3, 92, 86, 52, 36, 16, 55, 25, 59], [24, 90, 55, 67, 66, 96, 58, 49, 21, 1, 39, 30, 65, 55, 57, 64, 98, 27, 90, 65, 43, 26, 10, 77, 86, 9], [40, 44, 98, 40, 1, 40, 6, 30, 39, 41, 10, 55, 44, 38, 44, 86, 95, 80, 86, 41, 40, 94, 35, 46, 87, 36], [30, 21, 73, 92, 41, 17, 19, 71, 53, 19, 80, 65, 93, 1, 69, 48, 95, 54, 81, 52, 50, 72, 91, 9, 73, 74], [42, 87, 8, 31, 39, 47, 35, 29, 70, 42, 94, 53, 27, 53, 67, 51, 28, 86, 27, 77, 8, 84, 48, 34, 71, 2], [84, 68, 18, 85, 35, 63, 98, 68, 95, 24, 85, 10, 23, 88, 15, 70, 15, 46, 46, 52, 4, 72, 21, 75, 11, 21], [21, 1, 28, 27, 46, 61, 52, 56, 43, 9, 88, 19, 41, 40, 12, 90, 49, 56, 92, 65, 3, 46, 16, 46, 45, 64], [65, 27, 31, 4, 16, 63, 97, 48, 45, 39, 37, 7, 89, 99, 19, 93, 57, 16, 25, 43, 80, 27, 70, 63, 50, 69], [97, 69, 6, 27, 72, 96, 13, 62, 99, 28, 63, 5, 85, 45, 67, 97, 60, 65, 21, 24, 85, 46, 21, 6, 31, 19], [89, 76, 25, 93, 74, 3, 97, 44, 8, 25, 95, 57, 65, 17, 32, 72, 31, 85, 38, 53, 76, 1, 58, 41, 87, 76], [42, 30, 40, 72, 77, 45, 71, 43, 39, 3, 8, 52, 99, 92, 80, 1, 83, 60, 29, 93, 9, 96, 50, 73, 32, 92]]]; int [] param1 = [14, 28, 28, 48, 14, 19, 6, 11, 8, 25]; int [] param2 = [17, 27, 16, 37, 7, 20, 5, 18, 10, 14]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
ADD_TWO_NUMBERS_WITHOUT_USING_ARITHMETIC_OPERATORS
static int f_filled ( int x , int y ) { while ( y != 0 ) { int carry = x & y ; x = x ^ y ; y = carry << 1 ; } return x ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [116, 61, 169, 78, 81, 62, 128, 41, 70, 120]; int [] param0 = [56, 17, 73, 75, 27, 61, 65, 22, 61, 97]; int [] param1 = [60, 44, 96, 3, 54, 1, 63, 19, 9, 23]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
FIND_MINIMUM_NUMBER_DIVIDED_MAKE_NUMBER_PERFECT_SQUARE
static int f_filled ( int n ) { int count = 0 , ans = 1 ; while ( n % 2 == 0 ) { count ++ ; n /= 2 ; } if ( count % 2 == 1 ) ans *= 2 ; for ( int i = 3 ; i <= Math . sqrt ( n ) ; i += 2 ) { count = 0 ; while ( n % i == 0 ) { count ++ ; n /= i ; } if ( count % 2 == 1 ) ans *= i ; } if ( n > 2 ) ans *= n ; return ans ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [95, 3, 3, 10, 82, 1, 77, 11, 23, 61]; int [] param0 = [95, 48, 3, 10, 82, 1, 77, 99, 23, 61]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
ANALYSIS_OF_ALGORITHMS_SET_2_ASYMPTOTIC_ANALYSIS
static int f_filled ( int arr [ ] , int n , int x ) { int i ; for ( i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == x ) { return i ; } } return - 1 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, -1, 0, 2, -1, -1, 1, -1, -1, -1]; int [] [] param0 = [[4, 5, 5, 11, 13, 14, 15, 19, 22, 22, 23, 26, 29, 29, 36, 44, 48, 49, 65, 65, 67, 68, 70, 76, 79, 79, 81, 85, 88, 91, 91, 92, 92, 97], [-24, -78, -32, -48, 0, 4, -42], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [38, 14, 75, 16, 91, 11, 98, 43, 67, 9, 21, 10, 82, 72, 32, 81, 48, 60, 2, 91, 10, 90, 12, 83], [-92, -92, -82, -80, -76, -66, -64, -64, -56, -48, -38, -38, -34, -32, -32, -10, -8, -6, -2, 0, 8, 10, 18, 20, 22, 22, 30, 34, 38, 38, 38, 44, 50, 52, 56, 64, 64, 66, 70, 76, 88], [0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1], [1, 4, 4, 4, 4, 8, 12, 13, 14, 14, 22, 25, 25, 27, 29, 33, 36, 38, 40, 40, 40, 41, 47, 47, 47, 48, 48, 50, 51, 52, 52, 52, 55, 56, 59, 59, 62, 64, 66, 77, 82, 84, 90, 91, 91, 93], [-90, -60, -58, -72, 92, 54, -32, -70, -94, 18, 64, -90, -90, -56, 82, -14, -74, -96, -90, -8, -48, 76, -28, 10, -52, -8, -46, -32, 82, 46, 58, 92, 4, 48, -96, -66, 60, 60, 62, -68], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [42, 17, 77, 96, 72, 36, 74, 97, 7, 94, 80, 7, 27, 58, 49, 81, 51, 9]]; int [] param1 = [17, 4, 6, 17, 25, 11, 38, 22, 8, 16]; int [] param2 = [5, 0, 0, 75, 25, -1, 4, 22, 8, 11]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
COUNT_DISTINCT_NON_NEGATIVE_PAIRS_X_Y_SATISFY_INEQUALITY_XX_YY_N_2
static int f_filled ( 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 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [54, 41, 50, 4, 73, 79, 35, 43, 71, 45]; int [] param0 = [61, 45, 53, 4, 82, 86, 37, 48, 81, 50]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
AREA_OF_A_HEXAGON
static double f_filled ( double s ) { return ( ( 3 * Math . sqrt ( 3 ) * ( s * s ) ) / 2 ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ double [] results = [8163986.207300422, 934487.9989101035, 2997804.1448343466, 3632345.696441302, 169746524.38794258, 97513471.98905805, 74922068.46663411, 125386010.4299519, 11572495.990484647, 108379966.88267714]; double [] param0 = [1772.6589509256596, -599.737107809315, 1074.1765931782, -1182.4087746714795, 8083.035797247716, -6126.414356565494, 5370.057504189614, -6947.020794285176, 2110.5107873533325, -6458.751326919488]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
DISTRIBUTING_M_ITEMS_CIRCLE_SIZE_N_STARTING_K_TH_POSITION
static int f_filled ( int n , int m , int k ) { if ( m <= n - k + 1 ) return m + k - 1 ; m = m - ( n - k + 1 ) ; return ( m % n == 0 ) ? n : ( m % n ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [9, 9, 33, 2, 6, 64, 53, 53, 71, 9]; int [] param0 = [19, 23, 92, 9, 20, 68, 66, 77, 90, 26]; int [] param1 = [14, 51, 10, 50, 67, 25, 30, 22, 1, 34]; int [] param2 = [34, 5, 24, 34, 20, 40, 24, 32, 71, 54]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
AREA_OF_THE_CIRCLE_THAT_HAS_A_SQUARE_AND_A_CIRCLE_INSCRIBED_IN_IT
static float f_filled ( int a ) { float area = ( float ) ( Math . PI * a * a ) / 4 ; return area ; }
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]; int [] param0 = [77, 18, 83, 39, 68, 28, 71, 14, 21, 73]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
DOUBLE_FACTORIAL_1
static int f_filled ( int n ) { int res = 1 ; for ( int i = n ; i >= 0 ; i = i - 2 ) { if ( i == 0 || i == 1 ) return res ; else res *= i ; } return res ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 8, 105, 3840, 135135, 10321920, 654729075]; int [] param0 = [1, 4, 7, 10, 13, 16, 19]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
AREA_SQUARE_CIRCUMSCRIBED_CIRCLE
static int f_filled ( int r ) { return ( 2 * r * r ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [392, 12168, 4050, 8712, 648, 2048, 7200, 512, 19602, 8450]; int [] param0 = [14, 78, 45, 66, 18, 32, 60, 16, 99, 65]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
EFFICIENT_SEARCH_IN_AN_ARRAY_WHERE_DIFFERENCE_BETWEEN_ADJACENT_IS_1
static int f_filled ( int arr [ ] , int n , int x ) { int i = 0 ; while ( i <= n - 1 ) { if ( arr [ i ] == x ) return i ; i += Math . abs ( arr [ i ] - x ) ; } return - 1 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [3, 6, 14, 5, -1, -1, -1, -1, 21, -1]; int [] [] param0 = [[5, 4, 5, 6, 5, 4, 3, 2], [5, 4, 5, 6, 5, 4, 3, 2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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], [50, 51, 52, 51, 50, 49, 48], [-86, -68, -32, -6, 6, 10, 30, 34, 58, 92], [1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0], [58], [-64, 78, 58, 36, 48, 80, -80, 74, -98, 46, -48, 24, 80, 72, 90, -46, 14, 68, 38, 58, -54, 80, 44, -62, 34, -28, 92, 84, 90, 44, -26, 88, 18, 22, -32, 54, 58, 92], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [5]]; int [] param1 = [29, 19, 37, 17, 6, 27, 0, 24, 35, 0]; int [] param2 = [6, 3, 1, 49, 6, 22, 0, 34, 1, 0]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
ARRAY_ELEMENT_MOVED_K_USING_SINGLE_MOVES
static int f_filled ( int a [ ] , int n , int k ) { if ( k >= n - 1 ) return n ; int best = 0 , times = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] > best ) { best = a [ i ] ; if ( i == 1 ) times = 1 ; } else times += 1 ; if ( times >= k ) return best ; } return best ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [33, 14, 7, 4, 64, 1, 14, 26, 1, 1]; int [] [] param0 = [[2, 5, 5, 9, 10, 10, 11, 14, 23, 27, 31, 32, 33, 33, 33, 37, 39, 41, 41, 42, 42, 43, 47, 60, 61, 68, 73, 73, 73, 78, 80, 80, 82, 83, 86, 87, 89, 92, 94, 98], [80, -58, 64, 48, -16, 60, -50, -52, 62, -86, -96, 52, 26, -30, 14], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [90, 23, 43, 42, 7, 71, 79], [-96, -96, -90, -84, -68, -64, -56, -56, -50, -50, -48, -46, -28, -18, 0, 0, 6, 32, 32, 34, 42, 42, 46, 50, 50, 52, 64, 64, 70, 76, 84, 88], [1, 1, 1], [2, 9, 15, 19, 26, 29, 42, 45, 46, 47, 55, 60, 60, 61, 62, 64, 68, 69, 74, 79, 96], [-32, 12, 80, 42, 80, 8, 58, -76, -42, -98, 22, -90, -16, -4, -62, -32, 28, 12, 78, -52, -84, 78, 88, -76, -52, 68, -34, -16, -4, 2, -78, -94, -22, 34, 6, -62, 72], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [52, 19]]; int [] param1 = [33, 14, 7, 4, 28, 1, 14, 26, 26, 1]; int [] param2 = [37, 13, 6, 4, 21, 2, 17, 31, 14, 1]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
N_TH_NUMBER_WHOSE_SUM_OF_DIGITS_IS_TEN_1
static int f_filled ( int n ) { int count = 0 ; for ( int curr = 19 ; ; curr += 9 ) { int sum = 0 ; for ( int x = curr ; x > 0 ; x = x / 10 ) sum = sum + x % 10 ; if ( sum == 10 ) count ++ ; if ( count == n ) return curr ; } }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1324, 109, 703, 1333, 28, 55, 406, 46, 118, 523]; int [] param0 = [93, 10, 55, 94, 2, 5, 37, 4, 11, 46]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
ARRAY_RANGE_QUERIES_ELEMENTS_FREQUENCY_VALUE
static int f_filled ( 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 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [3, 2, 1, 0, 0, 1, 0, 0, 0, 0]; int [] param0 = [0, 1, 3, 10, 2, 0, 14, 29, 31, 21]; int [] param1 = [31, 25, 4, 15, 3, 6, 18, 33, 19, 32]; 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]]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
BASIC_AND_EXTENDED_EUCLIDEAN_ALGORITHMS
static int f_filled ( int a , int b ) { if ( a == 0 ) return b ; return f_filled ( b % a , a ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 2, 4, 2, 1, 1, 1, 3, 2, 1]; int [] param0 = [46, 26, 40, 58, 25, 2, 8, 21, 82, 17]; int [] param1 = [89, 82, 12, 4, 44, 87, 65, 87, 10, 61]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
MAXIMUM_POSSIBLE_SUM_WINDOW_ARRAY_ELEMENTS_WINDOW_ARRAY_UNIQUE
static int f_filled ( int A [ ] , int B [ ] , int n ) { Set < Integer > mp = new HashSet < Integer > ( ) ; int result = 0 ; int curr_sum = 0 , curr_begin = 0 ; for ( int i = 0 ; i < n ; ++ i ) { while ( mp . contains ( A [ i ] ) ) { mp . remove ( A [ curr_begin ] ) ; curr_sum -= B [ curr_begin ] ; curr_begin ++ ; } mp . add ( A [ i ] ) ; curr_sum += B [ i ] ; result = Integer . max ( result , curr_sum ) ; } return result ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [852, 240, 0, 734, 0, 2, 377, 122, 1, 1024]; int [] [] param0 = [[4, 8, 10, 10, 16, 23, 33, 36, 43, 47, 50, 55, 56, 72, 84, 85, 86, 86, 88, 90, 92, 99], [48, -22, 84, 76, 50, -14, -82, 28, 86, -50, -40, 10, 48, 20, -48, -84, -64, -48, -32, -84, -32, 10, 42, -10, -68, -16, -94, -76, 42, -96, 16, -64, 60, 8, -88, -62, 82, -24, -28, 40, 18, 8], [0, 0, 0, 1], [74, 64, 93, 72, 75, 90, 46, 72, 91, 98, 57, 58, 76, 29, 88, 3, 86, 1, 78, 74, 56, 54, 57, 3, 94, 2, 14, 32, 67, 62, 1, 30, 78, 95, 40], [-94, -88, -68, -24, 60, 94], [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0], [3, 7, 12, 15, 17, 23, 31, 31, 32, 37, 41, 54, 57, 60, 62, 62, 64, 70, 71, 74, 75, 83, 97, 98], [-2, 26, -74, 96, -70, 56, 92, -74, -38, -18, 36, 44, -10, -26, 26, -22, -58, 78, 86, 22, 76, 50, 88, -86, -80, -36, -48, 90, -34, 62, 46, -56, -32], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [86, 30, 87, 99, 8, 1, 24, 46, 12, 21, 43, 73, 28, 3, 35, 49, 14, 37, 63, 98, 65, 43, 86, 69, 27, 60, 45, 88, 25, 86, 11, 9, 86, 73, 40, 70, 49, 50, 95, 69, 94]]; int [] [] param1 = [[8, 26, 30, 35, 45, 47, 55, 56, 59, 61, 64, 66, 67, 69, 73, 77, 78, 81, 82, 85, 86, 99], [82, 94, 34, 12, 18, -68, 14, -16, -30, -16, 6, 74, -68, 76, -76, 52, -32, -38, 78, 64, -60, -46, 82, -60, 98, -70, -52, -96, -6, -44, 66, -66, 22, -42, -66, 4, -2, -48, -94, 72, 56, 88], [0, 0, 1, 1], [9, 50, 22, 60, 36, 46, 76, 48, 90, 64, 16, 24, 41, 12, 36, 36, 93, 52, 26, 38, 68, 5, 55, 19, 35, 5, 7, 96, 67, 64, 24, 85, 6, 33, 7], [-80, -72, -60, -42, -24, -6], [1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0], [3, 10, 10, 12, 12, 14, 15, 19, 19, 20, 25, 27, 27, 28, 40, 41, 50, 51, 53, 57, 60, 65, 75, 99], [76, 42, 0, 4, -96, -24, -50, -54, 26, -8, -38, -46, 42, -50, 16, -2, -6, 2, -8, 56, 64, -58, -96, 2, -64, -66, -14, 58, -76, -26, 78, -96, 48], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [27, 66, 77, 34, 98, 75, 43, 27, 79, 32, 54, 40, 29, 47, 63, 15, 23, 33, 59, 76, 27, 31, 92, 43, 12, 20, 97, 67, 11, 12, 83, 79, 52, 46, 51, 36, 87, 96, 90, 6, 62]]; int [] param2 = [20, 30, 2, 20, 4, 22, 22, 17, 39, 34]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
BASIC_AND_EXTENDED_EUCLIDEAN_ALGORITHMS_1
static int f_filled ( 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_filled ( b % a , a , x1 , y1 ) ; x = y1 - ( b / a ) * x1 ; y = x1 ; return gcd ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 3, 1, 4, 16, 1, 1, 1, 1, 1]; int [] param0 = [44, 33, 39, 52, 64, 45, 53, 86, 57, 11]; int [] param1 = [17, 81, 77, 96, 48, 32, 88, 19, 67, 86]; int [] param2 = [10, 67, 21, 23, 17, 89, 24, 29, 30, 96]; int [] param3 = [65, 20, 34, 97, 33, 3, 74, 21, 32, 81]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i], param3[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
DYNAMIC_PROGRAMMING_SET_37_BOOLEAN_PARENTHESIZATION_PROBLEM
static int f_filled ( char symb [ ] , char oper [ ] , int n ) { int F [ ] [ ] = new int [ n ] [ n ] ; int T [ ] [ ] = new int [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { F [ i ] [ i ] = ( symb [ i ] == 'F' ) ? 1 : 0 ; T [ i ] [ i ] = ( symb [ i ] == 'T' ) ? 1 : 0 ; } for ( int gap = 1 ; gap < n ; ++ gap ) { for ( int i = 0 , j = gap ; j < n ; ++ i , ++ j ) { T [ i ] [ j ] = F [ i ] [ j ] = 0 ; for ( int g = 0 ; g < gap ; g ++ ) { int k = i + g ; int tik = T [ i ] [ k ] + F [ i ] [ k ] ; int tkj = T [ k + 1 ] [ j ] + F [ k + 1 ] [ j ] ; if ( oper [ k ] == '&' ) { T [ i ] [ j ] += T [ i ] [ k ] * T [ k + 1 ] [ j ] ; F [ i ] [ j ] += ( tik * tkj - T [ i ] [ k ] * T [ k + 1 ] [ j ] ) ; } if ( oper [ k ] == '|' ) { F [ i ] [ j ] += F [ i ] [ k ] * F [ k + 1 ] [ j ] ; T [ i ] [ j ] += ( tik * tkj - F [ i ] [ k ] * F [ k + 1 ] [ j ] ) ; } if ( oper [ k ] == '^' ) { T [ i ] [ j ] += F [ i ] [ k ] * T [ k + 1 ] [ j ] + T [ i ] [ k ] * F [ k + 1 ] [ j ] ; F [ i ] [ j ] += T [ i ] [ k ] * T [ k + 1 ] [ j ] + F [ i ] [ k ] * F [ k + 1 ] [ j ] ; } } } } return T [ 0 ] [ n - 1 ] ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [4, 2, 2, 5, 0, 5, 2, 5, 3, 4]; char [] [] param0 = [['t', 't', 'f', 't'], ['t', 'f', 't'], ['t', 'f', 'f'], ['t', 't', 'f', 't'], ['t', 't', 'f', 't'], ['t', 't', 'f', 't'], ['t', 't', 'f', 't'], ['t', 't', 'f', 't'], ['t', 't', 'f', 't'], ['t', 't', 'f', 't']]; char [] [] param1 = [['|', '&', '^'], ['^', '&'], ['^', '|'], ['|', '|', '|'], ['&', '&', '&'], ['&', '&', '^'], ['^', '&', '|'], ['^', '^', '^'], ['^', '|', '|'], ['|', '^', '|']]; int [] param2 = [4, 3, 3, 4, 4, 4, 4, 4, 4, 4]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
BELL_NUMBERS_NUMBER_OF_WAYS_TO_PARTITION_A_SET
static int f_filled ( int n ) { int [ ] [ ] bell = new int [ n + 1 ] [ n + 1 ] ; bell [ 0 ] [ 0 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { bell [ i ] [ 0 ] = bell [ i - 1 ] [ i - 1 ] ; for ( int j = 1 ; j <= i ; j ++ ) bell [ i ] [ j ] = bell [ i - 1 ] [ j - 1 ] + bell [ i ] [ j - 1 ] ; } return bell [ n ] [ 0 ] ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 2, 5, 15, 52, 203, 877, 4140, 21147, 115975, 678570, 4213597, 27644437, 190899322, 1382958545]; int [] param0 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_GIVEN_CIRCLE_LIES_COMPLETELY_INSIDE_RING_FORMED_TWO_CONCENTRIC_CIRCLES
static boolean f_filled ( int r , int R , int r1 , int x1 , int y1 ) { int dis = ( int ) Math . sqrt ( x1 * x1 + y1 * y1 ) ; return ( dis - r1 >= R && dis + r1 <= r ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, false, true, false, false, false, false, false, false]; int [] param0 = [8, 400, 1, 61, 60, 88, 60, 26, 33, 70]; int [] param1 = [4, 1, 400, 40, 49, 10, 79, 88, 65, 57]; int [] param2 = [2, 10, 10, 2, 68, 69, 92, 75, 57, 77]; int [] param3 = [6, 74, 74, 50, 77, 71, 29, 84, 21, 52]; int [] param4 = [0, 38, 38, 0, 71, 26, 38, 10, 61, 87]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i], param3[i], param4[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
BINARY_REPRESENTATION_OF_NEXT_NUMBER
static String f_filled ( String num ) { int l = num . length ( ) ; int i ; for ( i = l - 1 ; i >= 0 ; i -- ) { if ( num . charAt ( i ) == '0' ) { num = num . substring ( 0 , i ) + '1' + num . substring ( i + 1 ) ; break ; } else { num = num . substring ( 0 , i ) + '0' + num . substring ( i + 1 ) ; } } if ( i < 0 ) { num = "1" + num ; } return num ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ string [] results = ["1000", "48710000000000", "0010", "10000000000", "8410000000", "10", "10000000000", "100000000", "001110", "1000000000"]; string [] param0 = ["dxh", "48703586411816", "0001", "ywg wvjnks", "8408568459", "01", "dfecz cwtn", "37742236", "001101", "ldxerlmyn"]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
NUMBER_SUBSEQUENCES_FORM_AI_BJ_CK
static int f_filled ( String s ) { int aCount = 0 ; int bCount = 0 ; int cCount = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == 'a' ) aCount = ( 1 + 2 * aCount ) ; else if ( s . charAt ( i ) == 'b' ) bCount = ( aCount + 2 * bCount ) ; else if ( s . charAt ( i ) == 'c' ) cCount = ( bCount + 2 * cCount ) ; } return cCount ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [0, 3, 7, 1, 0, 0, 111, 0, 0, 0]; string [] param0 = ["", "abbc", "abcabc", "agsdbkfdc ", "ababab", "aaaaaaa", "aabaaabcc", "19", "1001100", "dtanuqbu"]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
BINARY_SEARCH
static int f_filled ( int arr [ ] , int l , int r , int x ) { if ( r >= l ) { int mid = l + ( r - l ) / 2 ; if ( arr [ mid ] == x ) return mid ; if ( arr [ mid ] > x ) return f_filled ( arr , l , mid - 1 , x ) ; return f_filled ( arr , mid + 1 , r , x ) ; } return - 1 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [-1, -1, 1, -1, -1, -1, -1, -1, -1, -1]; int [] [] param0 = [[3, 4, 4, 8, 9, 13, 13, 15, 18, 27, 30, 32, 42, 48, 50, 52, 56, 66, 69, 69, 77, 84, 84, 93], [52, -58, -22, -80, 44, -52, -34, 94, -34, -74, 42, 60, -62, 70, 98, 32, 10, 94, 26, 56, -48, -50, 42, 2, 46, 28, -68, -16, -96, -12, 66, -46, 74, -60, -52, 28, -92, -78, 32, 28, 16, 34, 30, -60, -14], [0, 1], [28, 84, 40, 81], [-66, -62, -60, -56, -56, -2, 40, 44, 50, 74, 82, 94], [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1], [15, 26, 31, 36, 36, 61, 68, 72, 75, 79, 82, 98], [0, -82, -94, 48, 48, -96, 14, 66, 76, -30, 86, 28, -28, -66, -64, 92, -94, -66, 86, 26, 8, 94, -82, -80, 4, -26, 76, -46, 72, 88, -6, 8, -30, 40, -88, 2, -40, -98, -22, -20, 4, -12, 54, -20, -36, 12], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [81, 47]]; int [] param1 = [19, 40, 1, 2, 8, 7, 6, 38, 12, 1]; int [] param2 = [12, 35, 1, 2, 6, 7, 7, 33, 10, 1]; int [] param3 = [22, 44, 1, 2, 8, 10, 8, 39, 6, 1]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i], param3[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
FIND_REPETITIVE_ELEMENT_1_N_1
static int f_filled ( int [ ] arr , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += arr [ i ] ; return sum - ( ( ( n - 1 ) * n ) / 2 ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [287, -575, -115, 1705, -407, -366, 1132, -56, -446, 753]; int [] [] param0 = [[4, 8, 27, 34, 39, 42, 43, 54, 72], [-38, -66, -38, -48, -96, 74, -32, -62, -34, -32, -88, -12, -8, -4], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1], [88, 86, 23, 81, 76, 16, 94, 64, 59, 50, 71, 62, 10, 89, 73, 64, 65, 96, 83, 40, 99, 40, 77, 33, 14, 62, 6, 89, 74, 96, 93, 29, 15, 93, 9, 58, 98, 76, 23, 23, 70, 99], [-96, -94, -82, -64, -56, -40, -36, -34, -32, -24, -24, -22, -20, -20, -20, -18, -18, -12, -10, -6, 16, 20, 20, 22, 26, 30, 36, 46, 46, 50, 50, 52, 64, 64, 64, 68, 72, 74, 76, 92, 96, 98], [0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1], [2, 6, 7, 13, 19, 23, 37, 39, 42, 42, 43, 45, 52, 53, 55, 56, 59, 63, 66, 71, 76, 85, 86, 89, 92, 94, 96, 99], [52, -56, -12, 78, 6, 32, 0, 36, 34, -54, -74, -32], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [10, 42, 50, 5, 74, 81, 30, 76, 6, 34, 86, 4, 77, 71, 96, 22, 34, 50, 35, 16, 60, 11, 21, 38]]; int [] param1 = [9, 14, 16, 42, 42, 28, 28, 12, 31, 24]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
BREAKING_NUMBER_FIRST_PART_INTEGRAL_DIVISION_SECOND_POWER_10
static int f_filled ( String N ) { int len = N . length ( ) ; int l = ( len ) / 2 ; int count = 0 ; for ( int i = 1 ; i <= l ; i ++ ) { String s = N . substring ( 0 , i ) ; int l1 = s . length ( ) ; String t = N . substring ( i , l1 + i ) ; if ( s . charAt ( 0 ) == '0' || t . charAt ( 0 ) == '0' ) continue ; if ( s . compareTo ( t ) == 0 ) count ++ ; } return count ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [0, 0, 1, 0, 0, 2, 0, 0, 1, 2]; string [] param0 = ["zcoqhum", "2674377254", "11", "lbuglvrywapbpo", "26382426486138", "111010111010", "huinqjxndbfp", "5191", "1110101101", "2202200"]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
FRIENDS_PAIRING_PROBLEM
static int f_filled ( int n ) { int dp [ ] = new int [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) { if ( i <= 2 ) dp [ i ] = i ; else dp [ i ] = dp [ i - 1 ] + ( i - 1 ) * dp [ i - 2 ] ; } return dp [ n ] ; }
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[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
BREAK_NUMBER_THREE_PARTS
static long f_filled ( long n ) { long count = 0 ; for ( int i = 0 ; i <= n ; i ++ ) for ( int j = 0 ; j <= n ; j ++ ) for ( int k = 0 ; k <= n ; k ++ ) if ( i + j + k == n ) count ++ ; return count ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ long [] results = [1431, 1176, 2926, 703, 2415, 153, 5050, 780, 3655, 1081]; long [] param0 = [52, 47, 75, 36, 68, 16, 99, 38, 84, 45]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
POSSIBLE_TO_MAKE_A_DIVISIBLE_BY_3_NUMBER_USING_ALL_DIGITS_IN_AN_ARRAY
static boolean f_filled ( int arr [ ] , int n ) { int remainder = 0 ; for ( int i = 0 ; i < n ; i ++ ) remainder = ( remainder + arr [ i ] ) % 3 ; return ( remainder == 0 ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [false, false, true, true, true, false, false, false, false, false]; int [] [] param0 = [[2, 4, 9, 11, 12, 15, 16, 19, 21, 21, 23, 23, 24, 30, 31, 31, 32, 34, 37, 41, 41, 43, 45, 46, 47, 54, 58, 60, 62, 66, 66, 74, 74, 75, 75, 77, 77, 85, 89, 90, 92, 92, 93, 95, 98], [0, 66, 92, 24, -8, 88, -92, 86, 80, 82, 42, -20, -56, -2, -84, 32], [0, 0, 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], [99, 83, 11, 99, 80, 76, 32, 12, 94, 66, 76], [-88, -84, -80, -80, -80, -80, -72, -68, -64, -62, -60, -52, -48, -44, -36, -24, -20, -18, -14, -8, -6, -6, -4, 6, 10, 14, 18, 24, 26, 26, 50, 50, 52, 60, 76, 90, 96, 98], [0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1], [6, 6, 8, 8, 10, 24, 24, 26, 27, 30, 34, 34, 36, 36, 39, 40, 41, 44, 45, 50, 52, 53, 57, 62, 64, 64, 70, 71, 72, 78, 78, 79, 80, 82, 89, 95, 96], [-28, -84, -14, -20, -14, -26, 28, -66, 48, 82, -46, -10, -94, 76, 56, -6, 72, -92, -32, 66, 50, -72, 64, 12, 48, 88, -36, -12, -6, -18, -36, -34, 44, 40, -54], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [17, 47, 89, 75, 57, 69, 70, 57, 83, 79, 57, 49]]; int [] param1 = [30, 14, 29, 5, 19, 14, 28, 25, 19, 8]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
BREAK_NUMBER_THREE_PARTS_1
static long f_filled ( long n ) { long count = 0 ; count = ( n + 1 ) * ( n + 2 ) / 2 ; return count ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ long [] results = [2628, 2628, 703, 10, 4851, 2485, 136, 1225, 3081, 28]; long [] param0 = [71, 71, 36, 3, 97, 69, 15, 48, 77, 6]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
NUMBER_JUMP_REQUIRED_GIVEN_LENGTH_REACH_POINT_FORM_D_0_ORIGIN_2D_PLANE
static int f_filled ( int a , int b , int d ) { int temp = a ; a = Math . min ( a , b ) ; b = Math . max ( temp , b ) ; if ( d >= b ) return ( d + b - 1 ) / b ; if ( d == 0 ) return 0 ; if ( d == a ) return 1 ; return 2 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [3, 2, 3, 2, 2, 2, 2, 2, 3, 2]; int [] param0 = [35, 85, 22, 8, 12, 58, 65, 10, 23, 5]; int [] param1 = [8, 55, 23, 43, 64, 25, 4, 95, 13, 50]; int [] param2 = [77, 33, 64, 29, 11, 26, 28, 55, 54, 71]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CALCULATE_ANGLE_HOUR_HAND_MINUTE_HAND
static int f_filled ( 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 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [-180831, -15630, -251193, -111919, -208740, -268510, -287700, -138167, -10289, -32987]; double [] param0 = [7322.337365895532, -0.5025472034247969, 8735.336068205026, -5478.862697905712, 8264.126919165505, -9671.311773842834, 9995.328351000411, -5274.574323066984, 1310.8711644223736, -2829.678131972794]; double [] param1 = [6996.326968156217, -2910.070017192333, 1910.3752934680874, -9470.18148108585, 7058.937313484608, -3867.070379361206, 2145.339179488316, -3583.7503371694124, 5214.059687285893, -9371.556600288217]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
MULTIPLY_LARGE_INTEGERS_UNDER_LARGE_MODULO
static long f_filled ( long a , long b , long mod ) { long res = 0 ; a %= mod ; while ( b > 0 ) { if ( ( b & 1 ) > 0 ) { res = ( res + a ) % mod ; } a = ( 2 * a ) % mod ; b >>= 1 ; } return res ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ long [] results = [48, 6, 58, 1, 43, 1, 19, 19, 34, 25]; long [] param0 = [60, 46, 4, 67, 93, 89, 8, 53, 96, 38]; long [] param1 = [24, 43, 50, 1, 35, 97, 78, 73, 92, 64]; long [] param2 = [58, 29, 71, 66, 73, 8, 55, 22, 83, 83]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CALCULATE_AREA_TETRAHEDRON
static double f_filled ( int side ) { double volume = ( Math . pow ( side , 3 ) / ( 6 * Math . sqrt ( 2 ) ) ) ; return volume ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ double [] results = [22994.17, 20696.54, 5052.87, 114350.83, 258.92, 10739.18, 7542.47, 91769.26, 40.42, 258.92]; int [] param0 = [58, 56, 35, 99, 13, 45, 40, 92, 7, 13]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
MAXIMUM_SUBARRAY_SUM_USING_PREFIX_SUM
static int f_filled ( int arr [ ] , int n ) { int min_prefix_sum = 0 ; int res = Integer . MIN_VALUE ; int prefix_sum [ ] = new int [ n ] ; prefix_sum [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) prefix_sum [ i ] = prefix_sum [ i - 1 ] + arr [ i ] ; for ( int i = 0 ; i < n ; i ++ ) { res = Math . max ( res , prefix_sum [ i ] - min_prefix_sum ) ; min_prefix_sum = Math . min ( min_prefix_sum , prefix_sum [ i ] ) ; } return res ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [633, 114, 8, 999, -24, 7, 811, 204, 0, 1971]; int [] [] param0 = [[8, 9, 11, 17, 18, 19, 23, 24, 27, 30, 31, 31, 35, 44, 46, 47, 49, 51, 55, 58, 59, 61, 65, 67, 71, 71, 71, 71, 78, 78, 82, 91, 98], [-82, -28, -66, -52, -36, 36, -88, 52, -62, 46, 42, 26, -60, 18, -52, 38, 94, -68, 44, -94, 14, 36, -70], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [28, 36, 42, 42, 5, 52, 74, 86, 55, 82, 59, 81, 4, 90, 24, 34, 20, 99, 86, 25, 52, 48, 62, 5, 67, 83, 60, 72, 80, 73, 38, 55, 8, 70, 95], [-92, -52, -24, 36, 56], [0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0], [1, 1, 4, 4, 7, 7, 17, 18, 20, 26, 26, 32, 37, 38, 42, 44, 44, 46, 50, 53, 57, 58, 58, 60, 61, 61, 64, 74, 75, 77, 83, 83, 84, 84, 85, 87, 88, 90, 95, 96, 97, 98, 99, 99], [-86, 2, 26, 54, -16, 16, 48, 24, 50, -10, -32, -62, 48, -12, -66], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [58, 14, 79, 11, 31, 28, 61, 86, 25, 27, 75, 78, 32, 55, 86, 48, 15, 51, 6, 78, 23, 82, 16, 62, 35, 51, 91, 16, 79, 38, 97, 30, 23, 58, 95, 57, 82, 35, 57, 43, 22, 41, 58, 69, 25, 65, 13, 79]]; int [] param1 = [20, 15, 19, 19, 3, 13, 25, 13, 14, 39]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CALCULATE_MAXIMUM_VALUE_USING_SIGN_TWO_NUMBERS_STRING
static int f_filled ( String str ) { int res = str . charAt ( 0 ) - '0' ; for ( int i = 1 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == '0' || str . charAt ( i ) == '1' || res < 2 ) res += ( str . charAt ( i ) - '0' ) ; else res *= ( str . charAt ( i ) - '0' ) ; } return res ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [2176, 368, 1, 25621500, 6272, 4, -303, 5670, 0, 66]; string [] param0 = ["pr", "9518", "1", "nnmci", "3170487", "0100101010", "z roncuqwb", "00419297", "00", "r"]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
MAXIMUM_SUM_BITONIC_SUBARRAY
static int f_filled ( int arr [ ] , int n ) { int [ ] msis = new int [ n ] ; int [ ] msds = new int [ n ] ; int max_sum = Integer . MIN_VALUE ; msis [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) if ( arr [ i ] > arr [ i - 1 ] ) msis [ i ] = msis [ i - 1 ] + arr [ i ] ; else msis [ i ] = arr [ i ] ; msds [ n - 1 ] = arr [ n - 1 ] ; for ( int i = n - 2 ; i >= 0 ; i -- ) if ( arr [ i ] > arr [ i + 1 ] ) msds [ i ] = msds [ i + 1 ] + arr [ i ] ; else msds [ i ] = arr [ i ] ; for ( int i = 0 ; i < n ; i ++ ) if ( max_sum < ( msis [ i ] + msds [ i ] - arr [ i ] ) ) max_sum = msis [ i ] + msds [ i ] - arr [ i ] ; return max_sum ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [315, 230, 1, 228, 312, 1, 610, 68, 1, 13]; int [] [] param0 = [[7, 12, 16, 23, 26, 27, 39, 39, 40, 44, 57, 58, 77, 78, 81, 82, 84, 86, 91, 94, 94, 95, 97], [72, 38, -60, 98, -52, -38, -2, 94, 34, 56, 90, 46, 6, -2, 30, -96, -76, -96, -76, 32, 68, 64, -32, -4, 72, -62, 58, 20, -84, 0, -96, 70, -22, -56, 70, -74, -90, -86, -14, 82, -90, 40, -64, 94], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [69, 31, 85, 84, 28, 28], [-80, -74, -24, -22, -22, 4, 20, 28, 30, 32, 36, 58, 58, 68, 92, 94, 98], [1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1], [2, 2, 2, 4, 6, 7, 8, 10, 15, 17, 19, 20, 21, 27, 28, 29, 32, 32, 40, 44, 46, 47, 49, 50, 50, 52, 55, 56, 58, 59, 64, 69, 73, 74, 74, 77, 80, 80, 84, 89, 91, 95, 96, 96, 97, 98, 98, 99], [26, -86, 8, 64, -40, 64, 60, -16, 54, -42, -86, 14, -48, -20, -42, -4, -34, -52, -74, 22, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [8, 5, 5, 56, 5, 38]]; int [] param1 = [13, 37, 33, 5, 16, 10, 46, 18, 27, 3]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CALCULATE_VOLUME_DODECAHEDRON
static double f_filled ( int side ) { return ( ( ( 15 + ( 7 * ( Math . sqrt ( 5 ) ) ) ) / 4 ) * ( Math . pow ( side , 3 ) ) ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ double [] results = [1345766.2993890555, 2981083.5487053124, 81596.89069273109, 7663.118960624633, 4541961.260438062, 61304.95168499706, 1016520.3932458181, 5774704.218276865, 7663.118960624633, 4381671.801138677]; int [] param0 = [56, 73, 22, 10, 84, 20, 51, 91, 10, 83]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
NEXT_HIGHER_NUMBER_WITH_SAME_NUMBER_OF_SET_BITS
static int f_filled ( int x ) { int rightOne , nextHigherOneBit , rightOnesPattern , next = 0 ; if ( x > 0 ) { rightOne = x & - x ; nextHigherOneBit = x + rightOne ; rightOnesPattern = x ^ nextHigherOneBit ; rightOnesPattern = ( rightOnesPattern ) / rightOne ; rightOnesPattern >>= 2 ; next = nextHigherOneBit | rightOnesPattern ; } return next ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [44, 77, 103, 6, 56, 25, 78, 49, 86, 61]; int [] param0 = [42, 75, 94, 5, 52, 22, 77, 44, 85, 59]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
PROGRAM_CHECK_ARRAY_SORTED_NOT_ITERATIVE_RECURSIVE_1
static boolean f_filled ( int arr [ ] , int n ) { if ( n == 0 || n == 1 ) return true ; for ( int i = 1 ; i < n ; i ++ ) if ( arr [ i - 1 ] > arr [ i ] ) return false ; return true ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, true, false, true, false, true, false, true, false]; int [] [] param0 = [[6, 8, 8, 16, 19, 19, 21, 23, 26, 33, 34, 36, 38, 39, 41, 41, 45, 47, 52, 52, 55, 57, 60, 60, 60, 61, 69, 69, 70, 70, 72, 73, 73, 75, 78, 81, 84, 84, 85, 88, 88, 89, 90, 91, 97], [2, -90, 66, 24, -18, 70, 34, 18, 84, -62], [1, 1], [12, 88, 65, 82, 23, 39, 60, 27, 57, 44, 70, 28, 23, 34, 25, 11, 48, 65, 10, 73, 26, 10, 18, 60, 73, 45, 26, 9, 36, 15, 24, 40, 2, 4, 95, 20, 39, 45], [-38, 38, 40, 72], [1, 0, 0, 0, 1], [11, 15, 16, 17, 17, 17, 22, 23, 23, 25, 27, 28, 28, 31, 33, 36, 38, 40, 42, 44, 46, 49, 51, 51, 52, 60, 62, 65, 67, 71, 74, 77, 77, 78, 78, 79, 83, 83, 86, 86, 87, 87, 87, 88, 91, 92, 97, 97, 97], [-26, -90, -78, -76, -58, -64, -72, -34, -58, -48, 78, -50, -30, 26, -60, 26], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [56, 51, 63, 30, 10, 88, 23, 1, 48, 4, 28, 44]]; int [] param1 = [22, 9, 1, 23, 2, 3, 44, 9, 23, 10]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CASSINIS_IDENTITY
static int f_filled ( int n ) { return ( n & 1 ) != 0 ? - 1 : 1 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [-1, 1, 1, 1, 1, -1, -1, 1, -1, 1]; int [] param0 = [67, 2, 58, 6, 42, 17, 37, 44, 23, 40]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
NUMBER_OF_TRIANGLES_IN_A_PLANE_IF_NO_MORE_THAN_TWO_POINTS_ARE_COLLINEAR
static int f_filled ( int n ) { return n * ( n - 1 ) * ( n - 2 ) / 6 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [47905, 30856, 47905, 34220, 4, 147440, 84, 560, 91881, 105995]; int [] param0 = [67, 58, 67, 60, 4, 97, 9, 16, 83, 87]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CEILING_IN_A_SORTED_ARRAY
static int f_filled ( int arr [ ] , int low , int high , int x ) { int i ; if ( x <= arr [ low ] ) return low ; for ( i = low ; i < high ; i ++ ) { if ( arr [ i ] == x ) return i ; if ( arr [ i ] < x && arr [ i + 1 ] >= x ) return i + 1 ; } return - 1 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [28, 36, -1, 23, 9, -1, 9, -1, -1, 46]; int [] [] param0 = [[2, 3, 4, 6, 8, 9, 9, 10, 11, 16, 19, 20, 21, 21, 21, 24, 24, 25, 28, 30, 30, 30, 32, 34, 35, 39, 41, 42, 49, 52, 57, 59, 61, 62, 66, 68, 71, 73, 76, 79, 83, 84, 85, 86, 87, 87], [92, 50, -84, 60, 32, -54, 84, -82, -42, -72, -64, -28, -48, 66, 92, -42, 42, -66, 52, -30, 48, 42, 36, -4, 64, 62, -16, 0, 20, 26, 78, 78, 12, -6, -30, -14, 76, 72, 70, -34, 98, 32], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [26, 68, 73, 76, 14, 19, 56, 80, 17, 7, 15, 64, 99, 98, 21, 21, 72, 12, 14, 10, 44, 82, 25, 42, 46, 86, 79, 43, 91], [-90, -86, -84, -50, -30, -24, -12, -2, 8, 22, 30, 44, 58, 58, 60, 60, 62, 90], [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1], [2, 2, 29, 31, 34, 39, 48, 50, 56, 61, 66, 66, 69, 73, 88], [-98, 48, -58, 8, 70, 62, 92, 84, -58, -46, -26, -92, 18, -88, 40, -12, 60, 14, 54, -64, 88, 52, -44, 88, -46, -8, 36, -22, 28, -20, -50, 58, -82, -44, -44, 54, -86, 40, 10, 0, -24, -84, -10, 62, 58, 0, -88], [0, 0, 0, 0, 1, 1], [56, 30, 33, 5, 67, 35, 22, 54, 36, 55, 94, 89, 40, 65, 29, 76, 17, 14, 14, 49, 40, 44, 35, 69, 63, 2, 81, 78, 19, 67, 12, 14, 68, 30, 82, 85, 12, 2, 94, 33, 85, 75, 97, 31, 69, 31, 85, 26]]; int [] param1 = [23, 36, 11, 23, 9, 12, 9, 40, 5, 46]; int [] param2 = [37, 35, 9, 27, 16, 15, 12, 29, 5, 47]; int [] param3 = [44, 34, 13, 26, 10, 18, 10, 24, 5, 47]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i], param3[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
FIND_MAXIMUM_DOT_PRODUCT_TWO_ARRAYS_INSERTION_0S
static int f_filled ( int A [ ] , int B [ ] , int m , int n ) { int dp [ ] [ ] = new int [ n + 1 ] [ m + 1 ] ; for ( int [ ] row : dp ) Arrays . fill ( row , 0 ) ; for ( int i = 1 ; i <= n ; i ++ ) for ( int j = i ; j <= m ; j ++ ) dp [ i ] [ j ] = Math . max ( ( dp [ i - 1 ] [ j - 1 ] + ( A [ j - 1 ] * B [ i - 1 ] ) ) , dp [ i ] [ j - 1 ] ) ; return dp [ n ] [ m ] ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [610, 7952, 0, 50904, 31016, 0, 2307, 492, 0, 0]; int [] [] param0 = [[7, 9, 22, 68], [24, 40, 98, 58, -24, 24, 76, 48, -92, -16, -46, -48, -70, 88, 66, 2, 44, 36, 34, 34, 46, 90, -80, -24, -58, 68, 72, -20, -62, -40], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [32, 15, 41, 41, 4, 42, 22, 33, 33, 11, 68, 5, 41, 80, 39, 15, 36, 75, 41, 11, 25, 40, 50, 19, 39, 12, 75, 28, 52, 20, 63, 5, 27, 53, 19, 62, 98, 72, 10, 90, 74, 93, 52, 81, 91, 65, 90, 93], [-94, -76, -68, -50, -28, -20, 18, 24, 30, 54, 74, 84, 98], [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0], [14, 27, 43, 49], [78, -26, -12, 38, -90], [0, 1, 1, 1], [12, 69, 57, 7, 52, 14, 15, 83, 67, 57, 15, 86, 81, 43, 1, 64, 45, 68, 30, 23, 14, 70, 13, 51, 23, 33, 98, 68, 24, 43, 12, 82, 46]]; int [] [] param1 = [[14, 22, 54, 58], [30, -88, 6, -26, -76, 14, -80, -30, -58, 76, 40, -28, -54, 38, -60, -60, 88, -80, -22, 90, 50, -48, 68, -26, 26, -2, 68, -16, 88, -72], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [80, 18, 9, 29, 62, 89, 4, 40, 47, 15, 35, 82, 22, 97, 63, 54, 7, 58, 64, 73, 54, 79, 21, 21, 20, 19, 56, 42, 6, 97, 7, 34, 55, 35, 57, 86, 73, 88, 20, 29, 48, 52, 8, 77, 2, 12, 6, 47], [-88, -80, -78, -68, -44, -38, 42, 50, 62, 68, 70, 80, 92], [1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1], [51, 59, 76, 83], [14, 50, -6, -38, 80], [0, 0, 0, 1], [12, 48, 57, 40, 47, 36, 22, 50, 68, 98, 77, 78, 39, 55, 87, 75, 65, 27, 33, 27, 70, 34, 67, 71, 84, 33, 7, 61, 3, 9, 67, 92, 60]]; int [] param2 = [3, 22, 22, 30, 11, 21, 2, 3, 3, 17]; int [] param3 = [2, 22, 19, 25, 8, 33, 2, 2, 2, 32]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i], param3[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CEILING_IN_A_SORTED_ARRAY_1
static int f_filled ( int arr [ ] , int low , int high , int x ) { int mid ; if ( x <= arr [ low ] ) return low ; if ( x > arr [ high ] ) return - 1 ; mid = ( low + high ) / 2 ; if ( arr [ mid ] == x ) return mid ; else if ( arr [ mid ] < x ) { if ( mid + 1 <= high && x <= arr [ mid + 1 ] ) return mid + 1 ; else return f_filled ( arr , mid + 1 , high , x ) ; } else { if ( mid - 1 >= low && x > arr [ mid - 1 ] ) return mid ; else return f_filled ( arr , low , mid - 1 , x ) ; } }
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, 18, -92, -74, 14, 28, 52, 64, 72, 16, -76, 46], [0, 1], [51, 98, 25, 10, 43, 91, 33, 25, 85, 51, 94, 6, 35, 48, 11, 97, 67, 21, 50, 9, 11, 51, 86, 61, 22, 88, 89, 11], [-94, -92, -88, -74, -52, -50, -48, -44, -40, -36, -32, -26, 20, 22, 30, 32, 46, 56, 56, 60, 62, 64, 80, 84, 86, 94, 96, 96], [1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [4, 5, 5, 13, 26, 40, 46, 51, 58, 60, 64, 66, 68, 69, 71, 74, 78, 81, 83, 88, 88, 90, 98, 99], [92, 6, -54, 84, -10, 32, 50, 40, -38, 64, -64, -10, 70, -68, -6, -16, 68, 34, -66, -82, 84, 98, 50, 82, 78, 4, 34, -34, 78, 64, 32, 58, -94, 40, 50, 0, -92, -36, 10, -54, 58, -78, -88, 32, 6], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [80, 67, 30, 35, 9]]; int [] param1 = [13, 11, 1, 20, 20, 15, 12, 23, 24, 2]; int [] param2 = [11, 18, 1, 20, 15, 17, 17, 28, 17, 3]; int [] param3 = [18, 21, 1, 15, 15, 22, 14, 28, 22, 2]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i], param3[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
FIND_THE_ELEMENT_THAT_APPEARS_ONCE
static int f_filled ( int arr [ ] , int n ) { int ones = 0 , twos = 0 ; int common_bit_mask ; for ( int i = 0 ; i < n ; i ++ ) { twos = twos | ( ones & arr [ i ] ) ; ones = ones ^ arr [ i ] ; common_bit_mask = ~ ( ones & twos ) ; ones &= common_bit_mask ; twos &= common_bit_mask ; } return ones ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [72, -28, 1, 25, 104, 0, 10, 34, 0, 1]; int [] [] param0 = [[7, 26, 26, 48, 59, 62, 66, 70, 72, 75, 76, 81, 97, 98], [-42, -48, -64, -74, 56, -34, 20, 16, 34, -84, 86, 38, 56, -86, 30, -74, -96, 96, 12, 10, -46, 10, -36, 38, 34, -46, -20, 14, 12, 62, -54, 20, -82, 24, 96], [0, 0, 1, 1], [68, 91, 61, 6, 32, 47, 76, 69, 44, 71, 29, 79, 74, 33, 44, 33, 45, 75, 43, 82, 83, 81, 95, 16, 86, 33, 69, 61, 73, 21, 54, 17, 98, 62, 14, 72, 80, 31, 56, 82, 14, 48, 76], [-98, -96, -92, -62, -52, -42, -42, -26, 4, 10, 14, 38, 64, 66, 72, 74, 82], [0, 1, 1, 1, 0, 0, 0, 1, 0, 1], [53, 63, 63], [-96, -38, -26, -46, 68, -36, 20, -18, -10, 52, 40, 94, -8, -64, 82, -22], [0, 0, 0, 0, 0, 1, 1], [99, 46, 48, 81, 27, 97, 26, 50, 77, 32, 45, 99, 46]]; int [] param1 = [7, 27, 3, 38, 14, 5, 2, 15, 3, 12]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CENTER_ELEMENT_OF_MATRIX_EQUALS_SUMS_OF_HALF_DIAGONALS
static boolean f_filled ( 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 ] ) ; }
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, false]; int [] [] [] param0 = [[[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]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], [[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]], [[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]], [[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]], [[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]], [[76, 7, 58], [20, 79, 65], [74, 14, 79]], [[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]], [[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,
CHANGE_BITS_CAN_MADE_ONE_FLIP
static boolean f_filled ( String str ) { int zeros = 0 , ones = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { char ch = str . charAt ( i ) ; if ( ch == '0' ) ++ zeros ; else ++ ones ; } return ( zeros == 1 || ones == 1 ) ; }
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"]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
NUMBER_DIGITS_PRODUCT_TWO_NUMBERS
static int f_filled ( int a , int b ) { int count = 0 ; int p = Math . abs ( a * b ) ; if ( p == 0 ) return 1 ; while ( p > 0 ) { count ++ ; p = p / 10 ; } return count ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [4, 4, 4, 4, 4, 3, 3, 4, 3, 4]; int [] param0 = [86, 81, 48, 64, 56, 5, 25, 94, 5, 46]; int [] param1 = [39, 87, 84, 80, 20, 70, 13, 83, 55, 46]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_ARRAY_CONTAINS_CONTIGUOUS_INTEGERS_DUPLICATES_ALLOWED
static boolean f_filled ( int arr [ ] , int n ) { int max = Integer . MIN_VALUE ; int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { max = Math . max ( max , arr [ i ] ) ; min = Math . min ( min , arr [ i ] ) ; } int m = max - min + 1 ; if ( m > n ) return false ; boolean visited [ ] = new boolean [ n ] ; for ( int i = 0 ; i < n ; i ++ ) visited [ arr [ i ] - min ] = true ; for ( int i = 0 ; i < m ; i ++ ) if ( visited [ i ] == false ) return false ; return true ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [false, false, true, false, false, true, false, false, true, false]; int [] [] param0 = [[2, 4, 19, 25, 65, 72, 75, 83, 90, 92], [46, 2, 28, -44, 74, -36, -8, 30, -96, 60, 52, -58, 16, -38, 78, 38, -28, 16, 26, -42, 48, 40, 6, 72], [0, 1, 1, 1], [50, 21, 9, 29, 86, 2, 82, 49, 34, 18, 77, 83, 44, 67, 85, 58, 15, 85, 22, 3, 39, 67, 42, 37, 6, 35, 18, 57, 41, 32, 39, 30, 41, 68, 84, 36, 64, 36], [-92, -82, -80, -78, -66, -66, -62, -58, -54, -52, -48, -30, -26, -22, -20, -20, -18, -14, -2, 12, 20, 24, 26, 26, 28, 28, 32, 36, 42, 48, 50, 52, 56, 64, 70, 72, 72, 80, 82, 84, 86, 92], [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0], [18, 19, 21, 23, 30, 33, 38, 40, 45, 56, 63, 68, 93, 96], [20, -90, -42, 48, 18, -46, 82, -12, -88, 82, 62, 24, 20, 64, -68, -34, -38, 8, -54, -20, -92, 34, -90, 78, 18, 8, -6, 10, 98, -24, 72, -92, 76, -22, 12, -44, 2, 68, -72, 42, 34, 20, -48], [0, 0, 0, 0, 0, 1, 1, 1, 1], [81, 25, 50, 48, 35, 38, 49, 21, 47, 94, 94, 55, 23, 45, 92, 23, 93, 33, 64, 9, 90, 64, 81, 17, 2, 73, 8, 7, 35, 36, 72]]; int [] param1 = [8, 14, 2, 23, 26, 43, 8, 34, 8, 27]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
RECURSIVELY_BREAK_NUMBER_3_PARTS_GET_MAXIMUM_SUM_1
static int f_filled ( int n ) { int dp [ ] = new int [ n + 1 ] ; dp [ 0 ] = 0 ; dp [ 1 ] = 1 ; for ( int i = 2 ; i <= n ; i ++ ) dp [ i ] = Math . max ( dp [ i / 2 ] + dp [ i / 3 ] + dp [ i / 4 ] , i ) ; return dp [ n ] ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [57, 93, 19, 27, 32, 41, 104, 27, 13, 57]; int [] param0 = [50, 83, 18, 24, 31, 38, 94, 24, 13, 53]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
PERMUTE_TWO_ARRAYS_SUM_EVERY_PAIR_GREATER_EQUAL_K
static boolean f_filled ( Integer a [ ] , int b [ ] , int n , int k ) { Arrays . sort ( a , Collections . reverseOrder ( ) ) ; Arrays . sort ( b ) ; for ( int i = 0 ; i < n ; i ++ ) if ( a [ i ] + b [ i ] < k ) return false ; return true ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, false, true, false, false, true, false, false, true]; int [] [] param0 = [[99, 97, 90, 88, 87, 70, 52, 52, 43, 40, 27, 25, 16, 12, 9], [94, 92, 92, 88, 74, 72, 70, 56, 42, 42, 30, 30, 20, 18, 14, 12, 10, 8, 6, -14, -26, -28, -42, -44, -48, -68, -74, -74, -76, -78, -80, -84, -86, -90, -90, -90, -92, -94, -96, -96, -98, -98], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [97, 77, 75, 72, 71, 70, 69, 65, 59, 55, 51, 48, 47, 42, 35, 31, 26, 18, 16, 15, 15, 13, 11, 6, 3, 2], [94, 92, 90, 90, 84, 84, 74, 72, 68, 58, 56, 56, 54, 52, 36, 32, 18, 18, 16, 16, 4, 2, -2, -4, -4, -20, -34, -40, -42, -46, -48, -52, -52, -52, -64, -66, -70, -72], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [98, 96, 96, 94, 93, 92, 87, 82, 80, 80, 80, 79, 72, 72, 66, 66, 64, 58, 53, 48, 44, 37, 34, 32, 23, 21, 18, 17, 8], [94, 80, 78, 62, 52, 50, 32, 28, 24, 24, 22, 18, 18, 14, 14, 10, 10, -8, -14, -14, -16, -20, -22, -28, -38, -48, -50, -66, -78, -78, -80, -82, -88, -88, -98], [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], [92, 91, 85, 75, 72, 67, 65, 58, 53, 45, 39, 33, 31, 13, 10, 10]]; int [] [] param1 = [[4, 7, 11, 20, 34, 35, 36, 44, 46, 71, 72, 78, 85, 85, 91], [-98, -86, -84, -80, -80, -78, -76, -76, -74, -72, -56, -50, -48, -44, -44, -42, -32, -32, -32, -22, -20, -18, -14, 8, 16, 16, 18, 24, 30, 40, 44, 50, 60, 62, 62, 68, 70, 76, 84, 94, 94, 96], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [4, 11, 12, 12, 14, 15, 20, 21, 36, 37, 38, 44, 45, 46, 48, 51, 60, 62, 65, 73, 78, 79, 81, 88, 89, 98], [-94, -76, -74, -56, -54, -50, -46, -38, -26, -24, -24, -22, -16, -10, -6, -4, -4, 0, 0, 6, 12, 12, 18, 20, 38, 50, 52, 52, 54, 64, 64, 72, 72, 72, 76, 90, 96, 96], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [11, 15, 17, 19, 23, 23, 26, 27, 36, 43, 46, 47, 55, 59, 63, 66, 77, 79, 79, 82, 85, 86, 86, 91, 91, 94, 94, 97, 99], [-96, -82, -80, -80, -66, -54, -46, -44, -40, -30, -16, -14, 2, 6, 12, 20, 24, 32, 36, 38, 42, 46, 52, 56, 62, 66, 70, 88, 88, 90, 90, 96, 96, 98, 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, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [7, 12, 19, 21, 28, 34, 39, 40, 41, 69, 71, 71, 74, 78, 91, 92]]; int [] param2 = [10, 40, 11, 25, 26, 13, 20, 31, 31, 14]; int [] param3 = [7, 38, 15, 16, 30, 13, 14, 24, 30, 8]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i], param3[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_ARRAY_REPRESENTS_INORDER_BINARY_SEARCH_TREE_NOT
static boolean f_filled ( int [ ] arr , int n ) { if ( n == 0 || n == 1 ) { return true ; } for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i - 1 ] > arr [ i ] ) { return false ; } } return true ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, true, true, true, false, true, false, true, false]; int [] [] param0 = [[2, 3, 4, 10, 11, 13, 17, 19, 23, 26, 28, 29, 30, 34, 35, 37, 38, 38, 43, 49, 49, 50, 52, 53, 55, 55, 57, 58, 58, 59, 64, 66, 67, 70, 72, 72, 75, 77, 77, 87, 89, 89, 90, 91, 98, 99, 99, 99], [56, -94, -26, -52, 58, -66, -52, -66, -94, 44, 38, -66, 70, -70, -80, -78, -72, -60, -76, 68, -50, 32, -16, 84, 74, -42, 98, -8, 72, 26, 24, 6, 24, 86, 86, 78, -92, 80, 32, -74, 26, 50, 92, 4, 2, -34, -2, -18, -10], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [38, 79, 76, 92, 92], [-42, -28, 2, 32, 50, 56, 86, 96, 98], [1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [1, 9, 12, 21, 21, 24, 34, 55, 60, 63, 67, 68, 88, 89, 91, 94, 98, 99], [-96, 96, -98, -42, -74, 40, 42, 50, -46, -52, 8, -46, 48, 88, -78, -72, -10, -20, 98, -40, -18, 36, 4, 46, 52, 28, -88, -28, -28, -86], [0, 0, 0, 0, 1, 1], [66, 12, 48, 82, 33, 77, 99, 98, 14, 92]]; int [] param1 = [46, 30, 13, 2, 7, 11, 9, 29, 3, 7]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
GIVEN_A_SORTED_AND_ROTATED_ARRAY_FIND_IF_THERE_IS_A_PAIR_WITH_A_GIVEN_SUM
static boolean f_filled ( int arr [ ] , int n , int x ) { int i ; for ( i = 0 ; i < n - 1 ; i ++ ) if ( arr [ i ] > arr [ i + 1 ] ) break ; int l = ( i + 1 ) % n ; int r = i ; while ( l != r ) { if ( arr [ l ] + arr [ r ] == x ) return true ; if ( arr [ l ] + arr [ r ] < x ) l = ( l + 1 ) % n ; else r = ( n + r - 1 ) % n ; } return false ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, true, false, true, false, false, false, false, false]; int [] [] param0 = [[3, 8, 10, 15, 18, 19, 20, 20, 21, 22, 26, 30, 32, 34, 43, 45, 50, 50, 51, 52, 53, 56, 57, 58, 62, 63, 65, 82, 86, 91, 91, 92, 92, 93, 97], [30, -34, 86, -30, -26, 2, 90, 8, 26, -8, -8, 0, -86, 68, 22, 72, -76, 48, -24, 90, -22, -58, -54, 90, -12, -12, 88, 72, -58, 68, 84, 22, 60, 66, -52, -38, -90, 62, 30, -26, 88, -36, 92, 32, -32, -42, -90, -40, -10], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [20, 68, 40, 19, 74, 69], [-98, -94, -94, -94, -90, -88, -88, -78, -74, -70, -68, -66, -64, -62, -54, -50, -40, -40, -40, -40, -28, -22, -22, -18, -14, -12, 0, 6, 6, 8, 12, 20, 22, 26, 28, 36, 42, 44, 48, 52, 56, 60, 68, 84], [1, 1, 0], [12, 22, 38, 76, 80, 86], [-36, -10, -26, 34, -50, 66, -2, -14, -62, 60, -48, 94, -70, 6, -60, -90, 28, -4, -20, -52, 40, -76, -92, -14, 54, 4, -58, 38, -74, -96, -88, 86, -54, 98, 48, 68, 78, -28, -80, -46], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], [69, 99, 25, 52, 41, 51, 7, 33, 42, 91, 85, 57, 91, 89, 86, 11, 70, 67, 30, 92, 81, 23, 51, 98, 85, 5, 50, 44]]; int [] param1 = [35, 49, 37, 6, 44, 3, 6, 40, 21, 28]; int [] param2 = [30, 10, 1, 88, 94, 60, 3, 37, 20, 27]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
PRODUCT_NODES_K_TH_LEVEL_TREE_REPRESENTED_STRING
static int f_filled ( String tree , int k ) { int level = - 1 ; int product = 1 ; int n = tree . length ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( tree . charAt ( i ) == '(' ) level ++ ; else if ( tree . charAt ( i ) == ')' ) level -- ; else { if ( level == k ) product *= ( tree . charAt ( i ) - '0' ) ; } } return product ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [72, 15, 35, 0, 1, 1, 9, 0, 1, 1]; string [] param0 = ["(0(5(6()())(4()(9()())))(7(1()())(3()())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(8(3(2()())(6(5()())()))(5(10()())(7(13()())())))", "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "(0(5(6()())(4()(9()())))(7(1()())(3()())))", "0010", "kjtdgmy"]; int [] param1 = [2, 3, 1, 2, 4, 100, 3, 0, 12, 97]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
NUMBER_OF_SUBSTRINGS_WITH_ODD_DECIMAL_VALUE_IN_A_BINARY_STRING
static int f_filled ( String s ) { int n = s . length ( ) ; int [ ] auxArr = new int [ n ] ; if ( s . charAt ( 0 ) == '1' ) auxArr [ 0 ] = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( s . charAt ( i ) == '1' ) auxArr [ i ] = auxArr [ i - 1 ] + 1 ; else auxArr [ i ] = auxArr [ i - 1 ] ; } int count = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) if ( s . charAt ( i ) == '1' ) count += auxArr [ i ] ; return count ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [0, 1, 3, 0, 1, 15, 0, 0, 21, 0]; string [] param0 = ["ogiokjf", "517376", "11", "ze", "8763644247018", "00111010001", "hgwkbkuovu", "652", "101000011110", "kvdpg "]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_EXIST_TWO_ELEMENTS_ARRAY_WHOSE_SUM_EQUAL_SUM_REST_ARRAY
static boolean f_filled ( int arr [ ] , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum += arr [ i ] ; } if ( sum % 2 != 0 ) { return false ; } sum = sum / 2 ; HashSet < Integer > s = new HashSet < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int val = sum - arr [ i ] ; if ( s . contains ( val ) && val == ( int ) s . toArray ( ) [ s . size ( ) - 1 ] ) { System . out . printf ( "Pair elements are %d and %d\n" , arr [ i ] , val ) ; return true ; } s . add ( arr [ i ] ) ; } return false ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, true, false, false, false, false, false, true, false]; int [] [] param0 = [[2, 11, 5, 1, 4, 7], [2, 4, 2, 1, 11, 15], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [69, 6, 24, 30, 75, 37, 61, 76, 19, 18, 90, 9, 49, 24, 58, 97, 18, 85, 24, 93, 71, 98, 92, 59, 75, 75, 75, 70, 35, 58, 50, 1, 64, 66, 33], [-94, -94, -92, -74, -60, -58, -56, -44, -42, -40, -28, -14, 2, 4, 14, 20, 24, 28, 40, 42, 42, 66, 78, 78, 80, 82, 96], [1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1], [21, 26, 26, 27, 61, 62, 96], [-54, 86, 20, 26], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [44, 35, 26, 15, 56, 6, 36, 53, 15, 66, 20, 53, 99, 96, 51, 12, 61, 19, 79, 40, 99, 42, 86, 8, 11, 54, 93, 46, 23, 47, 41, 26, 66, 5, 86, 52, 64, 51, 4, 21, 63, 14, 7, 53, 31, 8, 9, 63]]; int [] param1 = [6, 6, 13, 18, 26, 10, 6, 3, 4, 31]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_IF_STRING_REMAINS_PALINDROME_AFTER_REMOVING_GIVEN_NUMBER_OF_CHARACTERS
static boolean f_filled ( String str , int n ) { int len = str . length ( ) ; if ( len >= n ) return true ; return false ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, false, true, false, true, false, false, false, true]; string [] param0 = ["zcoqhum", "7437725", "11", "buglvr", "9", "101101010110", "yguim", "8198", "11101", "huinqjxndbfp"]; int [] param1 = [2, 53, 30, 1, 92, 3, 18, 90, 71, 4]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
FIND_SUM_EVEN_INDEX_BINOMIAL_COEFFICIENTS_1
static int f_filled ( int n ) { return ( 1 << ( n - 1 ) ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [536870912, 67108864, 8388608, 1048576, 131072, 16384, 2048, 256, 32, 4]; int [] param0 = [30, 27, 24, 21, 18, 15, 12, 9, 6, 3]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_GIVEN_MATRIX_SPARSE_NOT
static boolean f_filled ( int array [ ] [ ] , int m , int n ) { int counter = 0 ; for ( int i = 0 ; i < m ; ++ i ) for ( int j = 0 ; j < n ; ++ j ) if ( array [ i ] [ j ] == 0 ) ++ counter ; return ( counter > ( ( m * n ) / 2 ) ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, true, false, true, false, true, false, true, false]; int [] [] [] param0 = [[[79, 0, 59, 0, 0, 0, 0, 47, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 0, 0, 0, 47, 0], [95, 0, 0, 19, 0, 0, 0, 0, 0, 55, 5, 0, 0, 97, 0, 61, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0], [0, 83, 0, 0, 55, 85, 23, 83, 0, 0, 5, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 73], [0, 0, 97, 0, 65, 0, 11, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 11, 0, 1, 0], [0, 83, 0, 0, 0, 0, 0, 23, 0, 1, 0, 97, 0, 0, 47, 41, 23, 0, 1, 0, 0, 0, 71, 0, 0, 0], [0, 0, 71, 85, 0, 0, 0, 0, 0, 0, 0, 25, 0, 97, 13, 0, 0, 0, 37, 0, 37, 0, 0, 23, 31, 53], [37, 67, 0, 0, 0, 0, 0, 0, 65, 0, 0, 49, 91, 0, 13, 0, 0, 0, 0, 0, 0, 41, 91, 59, 0, 85], [65, 0, 25, 0, 0, 0, 0, 0, 0, 43, 67, 97, 0, 91, 0, 0, 71, 0, 95, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 71, 0, 0, 0, 43, 37, 0, 71, 37, 89, 0, 85, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0], [77, 5, 0, 0, 0, 0, 0, 0, 49, 0, 0, 97, 0, 53, 83, 0, 0, 0, 0, 11, 0, 0, 11, 0, 0, 0], [0, 83, 0, 0, 0, 13, 85, 41, 0, 0, 67, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 71, 0], [0, 0, 1, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 5, 0, 0], [0, 43, 0, 0, 0, 0, 79, 41, 0, 0, 0, 73, 0, 65, 0, 0, 85, 0, 77, 37, 89, 0, 0, 0, 0, 0], [53, 0, 0, 0, 61, 0, 0, 0, 0, 0, 65, 59, 0, 0, 0, 31, 0, 0, 13, 61, 31, 0, 43, 0, 0, 0], [53, 0, 0, 0, 0, 67, 0, 53, 0, 37, 85, 0, 29, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 0], [0, 0, 0, 0, 0, 25, 13, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0], [0, 79, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 31, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 11], [0, 0, 0, 73, 0, 0, 0, 97, 0, 7, 0, 59, 91, 17, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 17, 17], [67, 0, 0, 0, 0, 29, 0, 0, 0, 25, 25, 79, 47, 31, 0, 55, 0, 0, 59, 0, 89, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 11, 0, 79, 37, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 89], [0, 0, 0, 0, 35, 0, 13, 49, 0, 0, 0, 41, 91, 0, 29, 0, 0, 0, 73, 0, 95, 61, 0, 0, 91, 0], [0, 0, 0, 0, 37, 85, 0, 0, 0, 17, 0, 0, 61, 89, 79, 55, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0], [95, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 77], [89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 67, 0, 0, 0, 0, 19, 0, 0, 89, 91, 7, 1, 0, 37, 0], [0, 0, 0, 29, 0, 11, 0, 0, 11, 65, 13, 97, 0, 0, 1, 37, 25, 0, 0, 0, 95, 0, 0, 47, 0, 91], [0, 0, 0, 79, 0, 0, 0, 0, 7, 31, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 1, 95, 0, 0, 0]], [[67, 41, 95, 96, 46, 82, 5, 44, 41, 3, 55, 19, 1, 18, 59, 62, 56, 37, 60, 49, 5, 79, 68], [85, 12, 82, 41, 38, 52, 33, 75, 11, 46, 3, 21, 13, 93, 20, 42, 52, 95, 74, 69, 93, 1, 81], [95, 24, 13, 91, 41, 41, 85, 4, 98, 89, 97, 25, 13, 33, 18, 51, 54, 58, 24, 7, 33, 7, 65], [60, 17, 53, 18, 95, 76, 49, 84, 61, 35, 53, 48, 45, 88, 73, 51, 51, 8, 61, 97, 76, 15, 38], [30, 58, 80, 23, 72, 21, 10, 98, 40, 36, 54, 67, 79, 97, 94, 59, 86, 77, 93, 36, 77, 84, 5], [89, 42, 17, 26, 96, 26, 88, 89, 86, 21, 97, 39, 96, 57, 83, 24, 6, 85, 68, 12, 15, 92, 16], [45, 85, 17, 37, 50, 90, 60, 57, 3, 31, 32, 44, 66, 61, 32, 47, 2, 49, 38, 99, 21, 43, 95], [46, 50, 98, 39, 76, 81, 51, 16, 48, 63, 37, 54, 73, 30, 3, 41, 74, 61, 13, 4, 66, 92, 49], [25, 60, 8, 35, 12, 70, 77, 66, 35, 88, 40, 57, 38, 97, 31, 44, 6, 13, 3, 68, 28, 58, 72], [68, 78, 45, 66, 58, 8, 25, 90, 77, 1, 55, 60, 98, 54, 71, 60, 18, 86, 29, 48, 78, 75, 4], [56, 95, 41, 62, 43, 81, 32, 55, 95, 35, 61, 11, 34, 70, 27, 99, 59, 90, 27, 33, 71, 16, 35], [68, 16, 57, 90, 76, 38, 11, 75, 31, 81, 12, 62, 9, 3, 58, 51, 88, 25, 80, 72, 44, 14, 15], [99, 24, 44, 97, 54, 95, 80, 78, 12, 1, 86, 77, 27, 55, 54, 40, 65, 87, 6, 16, 14, 36, 87], [53, 8, 42, 68, 29, 57, 22, 34, 4, 87, 69, 56, 6, 81, 15, 83, 81, 31, 61, 7, 18, 2, 81], [26, 43, 12, 57, 23, 79, 80, 26, 70, 36, 33, 28, 27, 72, 97, 52, 13, 90, 45, 1, 44, 81, 38], [43, 82, 40, 76, 62, 67, 88, 72, 93, 2, 18, 87, 14, 1, 15, 88, 32, 39, 68, 31, 44, 54, 16], [99, 50, 21, 42, 96, 76, 40, 78, 48, 32, 66, 65, 10, 62, 39, 16, 41, 78, 59, 50, 50, 5, 83], [92, 92, 66, 22, 29, 40, 40, 16, 41, 61, 64, 13, 63, 76, 63, 10, 91, 12, 20, 88, 79, 54, 47], [61, 68, 76, 59, 98, 25, 18, 44, 3, 95, 61, 77, 12, 39, 79, 83, 92, 13, 75, 39, 6, 5, 65], [49, 12, 1, 19, 6, 19, 8, 86, 44, 61, 23, 88, 6, 52, 85, 67, 13, 74, 64, 46, 54, 96, 86], [2, 39, 65, 66, 43, 54, 6, 96, 27, 88, 90, 65, 26, 65, 23, 89, 26, 78, 76, 94, 37, 83, 3], [46, 32, 63, 18, 68, 16, 40, 27, 77, 56, 92, 52, 14, 6, 15, 3, 22, 48, 40, 51, 13, 95, 21], [28, 13, 95, 35, 18, 71, 3, 37, 46, 77, 61, 89, 52, 94, 46, 90, 59, 3, 19, 49, 79, 14, 49]], [[0, 0, 0, 13, 0, 0, 0, 0, 35, 0, 0, 77, 0, 67, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0], [91, 0, 0, 0, 0, 71, 0, 65, 0, 0, 0, 0, 0, 1, 0, 0, 0, 41, 0, 0, 0, 0, 5, 0, 0, 0, 89, 85], [47, 0, 0, 0, 0, 0, 0, 35, 7, 0, 0, 0, 97, 0, 0, 41, 0, 0, 0, 0, 0, 73, 79, 73, 73, 0, 17, 0], [7, 0, 59, 11, 0, 0, 79, 0, 0, 0, 0, 0, 0, 91, 0, 0, 5, 35, 0, 73, 0, 0, 0, 0, 0, 0, 73, 0], [0, 35, 37, 0, 0, 55, 13, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 61, 0, 0, 0, 0, 65], [71, 0, 0, 0, 73, 49, 79, 0, 0, 73, 0, 0, 0, 35, 47, 0, 73, 19, 0, 37, 95, 73, 0, 0, 29, 19, 0, 0], [0, 0, 0, 35, 0, 13, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 49, 0, 0, 31, 0, 95, 65, 0, 0, 0, 59, 0], [55, 0, 65, 0, 0, 0, 0, 0, 71, 0, 35, 0, 0, 19, 25, 0, 0, 77, 0, 0, 0, 55, 35, 0, 0, 0, 0, 0], [7, 7, 61, 0, 0, 0, 0, 91, 47, 37, 0, 23, 0, 0, 65, 85, 1, 85, 0, 61, 61, 0, 0, 0, 0, 0, 85, 35], [0, 0, 0, 0, 0, 7, 0, 0, 49, 0, 49, 0, 67, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 0, 0, 0, 0, 47], [0, 5, 47, 13, 0, 79, 0, 0, 0, 41, 0, 0, 0, 43, 0, 0, 0, 0, 29, 83, 59, 23, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 89, 0, 0, 79, 55, 0], [0, 0, 0, 0, 89, 97, 0, 0, 0, 0, 19, 25, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 61, 0, 0, 5, 83, 91], [0, 0, 0, 19, 0, 7, 0, 0, 29, 0, 35, 11, 0, 41, 0, 65, 41, 0, 0, 0, 0, 11, 0, 0, 0, 71, 0, 0], [0, 0, 49, 0, 0, 31, 67, 0, 91, 0, 23, 0, 43, 5, 47, 0, 0, 0, 0, 19, 0, 0, 77, 0, 31, 0, 7, 0], [0, 55, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 55, 67, 0, 61, 29, 0, 0, 0, 0, 0, 0], [17, 23, 25, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 43, 17, 0, 0, 0, 0, 47, 0, 11, 0, 0, 0], [0, 0, 0, 41, 65, 0, 49, 0, 0, 0, 49, 0, 19, 0, 5, 47, 47, 71, 23, 13, 0, 0, 43, 0, 49, 61, 83, 97], [0, 97, 29, 0, 77, 0, 0, 71, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 13, 0, 37, 49, 0, 0, 0, 43, 0], [23, 0, 73, 0, 0, 0, 0, 61, 0, 0, 31, 73, 97, 0, 0, 0, 31, 55, 0, 0, 0, 0, 0, 0, 0, 35, 47, 0], [0, 0, 0, 0, 7, 0, 17, 77, 0, 0, 0, 0, 0, 73, 17, 29, 0, 0, 19, 0, 71, 0, 0, 0, 55, 0, 85, 0], [0, 0, 0, 49, 0, 0, 0, 0, 61, 0, 0, 0, 0, 19, 0, 49, 0, 0, 0, 0, 19, 0, 0, 59, 0, 0, 0, 0], [13, 0, 0, 0, 0, 0, 0, 77, 0, 0, 97, 0, 0, 71, 0, 0, 11, 71, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0], [0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 31, 0, 23, 0, 0, 0, 0, 91, 43, 97, 0, 0, 65, 0, 0, 5, 0, 0], [17, 29, 0, 0, 95, 0, 0, 37, 0, 0, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 49], [79, 0, 0, 43, 95, 0, 13, 0, 0, 0, 0, 65, 59, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 19, 0, 0, 5], [0, 0, 0, 89, 77, 0, 0, 0, 73, 0, 5, 0, 0, 0, 0, 0, 7, 49, 0, 0, 0, 0, 0, 59, 0, 49, 0, 0], [0, 79, 0, 65, 95, 0, 0, 59, 0, 0, 0, 5, 47, 0, 0, 17, 0, 17, 0, 0, 0, 35, 0, 1, 0, 13, 0, 0]], [[39, 82, 13, 38, 88, 30, 51, 34, 53, 58, 54, 87, 30, 72, 77, 48, 55, 34, 87], [70, 86, 28, 68, 52, 48, 78, 42, 68, 21, 27, 35, 41, 53, 76, 18, 39, 24, 61], [16, 38, 21, 46, 59, 52, 95, 97, 88, 90, 43, 83, 11, 25, 40, 18, 37, 47, 3], [53, 9, 6, 43, 54, 79, 86, 88, 68, 7, 79, 21, 70, 88, 77, 63, 90, 45, 64], [99, 16, 85, 5, 92, 38, 81, 26, 48, 18, 1, 43, 8, 59, 28, 47, 51, 31, 90], [4, 87, 14, 14, 97, 51, 81, 65, 25, 1, 22, 32, 46, 85, 90, 21, 85, 42, 44], [8, 96, 27, 63, 63, 65, 73, 66, 9, 54, 89, 93, 26, 72, 58, 71, 25, 67, 22], [76, 76, 64, 6, 24, 23, 29, 82, 7, 76, 93, 28, 54, 79, 47, 45, 53, 93, 24], [13, 30, 78, 6, 4, 21, 75, 30, 78, 42, 11, 19, 36, 4, 40, 35, 64, 19, 56], [61, 15, 99, 3, 59, 34, 15, 16, 3, 74, 70, 81, 11, 56, 24, 79, 31, 95, 30], [86, 49, 28, 58, 35, 14, 20, 83, 59, 88, 68, 16, 29, 74, 54, 64, 39, 89, 34], [79, 40, 23, 60, 79, 43, 88, 1, 21, 5, 51, 30, 20, 72, 63, 28, 56, 80, 2], [46, 70, 71, 17, 9, 12, 98, 70, 89, 72, 99, 25, 10, 9, 58, 67, 91, 97, 55], [84, 89, 11, 89, 91, 37, 34, 88, 35, 68, 92, 53, 90, 40, 12, 56, 16, 51, 32], [18, 89, 27, 59, 9, 86, 56, 35, 70, 5, 30, 5, 53, 42, 75, 63, 28, 14, 20], [21, 83, 86, 48, 24, 16, 5, 97, 65, 79, 51, 42, 2, 36, 2, 70, 64, 31, 19], [94, 81, 22, 39, 33, 76, 10, 41, 94, 25, 33, 15, 78, 17, 42, 53, 46, 69, 50], [45, 90, 30, 89, 62, 86, 37, 35, 8, 38, 64, 17, 6, 20, 92, 83, 84, 28, 41], [51, 97, 5, 17, 16, 93, 15, 74, 74, 98, 24, 25, 66, 71, 95, 44, 47, 39, 41]], [[0, 0, 0, 0, 0, 0, 11, 67, 0, 0, 0, 47, 0, 0, 0, 55, 85, 0, 0, 0], [49, 0, 79, 0, 0, 0, 91, 0, 91, 0, 0, 11, 0, 0, 0, 0, 31, 73, 0, 0], [0, 0, 0, 0, 85, 0, 0, 0, 47, 67, 0, 13, 29, 0, 53, 71, 0, 0, 0, 0], [0, 0, 0, 0, 71, 83, 0, 0, 0, 0, 31, 0, 0, 89, 0, 0, 59, 0, 19, 91], [23, 0, 17, 0, 0, 0, 79, 0, 0, 37, 91, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 83, 0, 0, 25, 0, 0, 0, 0, 41, 0, 1, 17, 0, 0, 0, 0, 0, 0, 1], [0, 0, 59, 97, 5, 0, 41, 0, 95, 0, 0, 0, 0, 0, 83, 0, 0, 83, 0, 0], [0, 55, 0, 85, 0, 11, 0, 0, 71, 61, 97, 0, 0, 0, 0, 0, 0, 0, 0, 37], [0, 25, 0, 41, 31, 0, 0, 1, 0, 0, 0, 0, 19, 23, 5, 0, 0, 0, 0, 0], [37, 17, 0, 0, 0, 0, 49, 0, 89, 0, 23, 0, 0, 47, 0, 0, 77, 11, 67, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 13, 0], [0, 11, 25, 0, 65, 0, 0, 73, 67, 0, 0, 43, 0, 55, 0, 0, 49, 0, 97, 41], [0, 0, 0, 0, 59, 0, 1, 35, 0, 0, 0, 29, 0, 0, 0, 0, 41, 83, 0, 0], [0, 35, 0, 0, 0, 53, 11, 0, 43, 67, 0, 95, 0, 0, 29, 0, 0, 0, 83, 0], [0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 29, 13, 0, 95, 0, 0, 0, 31, 0, 0], [0, 0, 0, 0, 95, 0, 19, 0, 0, 53, 0, 55, 0, 73, 85, 47, 85, 0, 0, 0], [67, 79, 0, 0, 0, 0, 0, 1, 0, 13, 0, 0, 0, 7, 85, 0, 0, 0, 0, 55], [55, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, 49, 0, 79, 0, 7], [0, 0, 47, 0, 0, 83, 0, 31, 91, 83, 0, 0, 43, 91, 0, 23, 0, 0, 0, 0], [0, 65, 0, 13, 0, 0, 0, 0, 79, 29, 0, 0, 77, 95, 47, 0, 0, 17, 0, 0]], [[42, 12, 11, 27, 59, 79, 58, 6, 82, 98, 65, 11, 95, 88, 36, 77, 61, 28, 50, 28, 70, 14, 95, 80, 20, 65, 34, 20, 88, 46, 82], [1, 96, 71, 86, 2, 9, 74, 20, 86, 87, 24, 96, 26, 21, 1, 69, 81, 31, 10, 37, 36, 39, 1, 27, 75, 69, 30, 36, 72, 28, 98], [18, 65, 21, 19, 89, 33, 81, 88, 43, 82, 73, 24, 95, 93, 47, 28, 17, 84, 14, 83, 26, 60, 11, 59, 10, 88, 15, 56, 70, 87, 6], [66, 16, 52, 35, 8, 58, 36, 40, 75, 53, 58, 99, 56, 22, 72, 14, 68, 44, 41, 64, 8, 50, 37, 36, 15, 19, 45, 15, 43, 53, 88], [73, 21, 71, 14, 86, 73, 13, 23, 69, 2, 31, 46, 92, 48, 21, 1, 90, 16, 38, 69, 86, 43, 49, 64, 6, 67, 78, 26, 55, 14, 57], [82, 84, 40, 95, 26, 69, 81, 37, 37, 83, 31, 49, 24, 25, 55, 95, 60, 16, 31, 51, 68, 54, 21, 67, 88, 72, 67, 88, 60, 43, 52], [44, 44, 36, 89, 17, 72, 6, 53, 12, 96, 46, 89, 63, 84, 33, 17, 61, 24, 53, 7, 51, 32, 98, 74, 86, 38, 31, 72, 95, 97, 81], [85, 45, 94, 87, 79, 71, 68, 12, 22, 58, 22, 85, 14, 7, 37, 88, 36, 92, 47, 34, 5, 72, 97, 54, 65, 46, 12, 66, 25, 46, 8], [58, 48, 97, 83, 67, 99, 28, 41, 80, 28, 94, 82, 76, 16, 59, 78, 65, 11, 28, 7, 95, 29, 58, 68, 14, 38, 47, 12, 69, 66, 18], [53, 14, 30, 70, 31, 44, 10, 1, 79, 76, 33, 79, 65, 54, 25, 96, 51, 80, 53, 66, 10, 42, 46, 57, 41, 39, 51, 13, 4, 28, 44], [54, 45, 31, 12, 11, 54, 5, 58, 36, 27, 84, 18, 78, 61, 49, 31, 31, 88, 10, 13, 19, 43, 28, 9, 34, 51, 17, 83, 15, 49, 62], [71, 83, 64, 18, 74, 48, 19, 52, 99, 50, 98, 49, 8, 73, 43, 85, 52, 19, 77, 83, 81, 43, 73, 63, 80, 45, 43, 80, 63, 6, 52], [47, 20, 16, 17, 59, 58, 56, 14, 39, 1, 66, 15, 76, 22, 23, 53, 97, 17, 76, 24, 66, 62, 46, 63, 87, 9, 31, 72, 14, 68, 50], [64, 94, 13, 2, 45, 48, 57, 13, 11, 31, 34, 7, 24, 90, 24, 66, 26, 61, 9, 15, 8, 28, 86, 76, 37, 4, 92, 35, 72, 93, 93], [58, 80, 95, 77, 7, 36, 55, 28, 37, 2, 85, 62, 43, 9, 46, 14, 29, 63, 16, 14, 40, 80, 94, 86, 32, 1, 45, 48, 43, 44, 47], [94, 14, 6, 63, 92, 78, 80, 77, 40, 19, 74, 67, 13, 14, 25, 74, 76, 76, 62, 25, 55, 23, 61, 98, 32, 39, 61, 86, 4, 47, 69], [20, 46, 96, 16, 79, 16, 86, 10, 30, 20, 25, 69, 74, 88, 15, 91, 74, 97, 2, 5, 13, 37, 92, 8, 99, 14, 46, 19, 19, 74, 67], [26, 34, 34, 85, 1, 51, 34, 55, 91, 6, 24, 45, 7, 94, 21, 77, 88, 14, 36, 59, 10, 26, 6, 33, 18, 40, 9, 13, 53, 42, 24], [46, 40, 59, 19, 6, 86, 68, 5, 55, 32, 75, 24, 8, 90, 1, 58, 83, 20, 23, 33, 5, 76, 13, 52, 87, 6, 35, 28, 2, 1, 94], [42, 82, 23, 86, 81, 20, 39, 5, 51, 50, 92, 87, 74, 50, 40, 87, 39, 9, 82, 71, 15, 81, 8, 99, 36, 16, 40, 8, 10, 74, 96], [5, 36, 89, 45, 15, 98, 24, 17, 30, 40, 27, 73, 31, 71, 56, 30, 92, 84, 18, 29, 22, 32, 41, 22, 54, 94, 87, 93, 78, 87, 75], [59, 94, 45, 80, 53, 46, 25, 43, 26, 66, 24, 35, 93, 77, 76, 88, 48, 63, 86, 59, 84, 12, 50, 91, 30, 51, 33, 95, 56, 91, 73], [90, 74, 86, 27, 96, 47, 7, 33, 42, 67, 94, 71, 10, 49, 19, 46, 49, 12, 91, 86, 43, 34, 87, 35, 71, 24, 10, 89, 6, 19, 48], [50, 66, 60, 59, 81, 36, 45, 77, 60, 2, 24, 89, 58, 34, 38, 90, 92, 63, 80, 85, 47, 1, 1, 35, 21, 11, 78, 39, 42, 65, 74], [1, 87, 40, 86, 74, 21, 38, 82, 16, 26, 8, 16, 44, 92, 83, 64, 79, 2, 75, 95, 40, 35, 57, 56, 55, 12, 59, 94, 94, 35, 94], [35, 64, 13, 52, 28, 88, 14, 55, 63, 81, 51, 1, 98, 97, 42, 13, 24, 33, 40, 85, 88, 4, 86, 63, 34, 82, 70, 42, 76, 57, 36], [82, 10, 12, 74, 92, 50, 4, 74, 42, 91, 76, 86, 97, 6, 92, 64, 83, 2, 64, 15, 59, 43, 24, 48, 95, 16, 36, 69, 21, 11, 88], [23, 19, 93, 9, 85, 70, 28, 44, 28, 79, 48, 78, 38, 24, 77, 41, 46, 73, 97, 50, 81, 7, 44, 66, 98, 7, 17, 99, 27, 98, 16], [98, 24, 28, 57, 76, 91, 95, 14, 27, 87, 68, 78, 75, 5, 61, 43, 86, 36, 1, 48, 11, 36, 92, 5, 4, 44, 32, 72, 18, 61, 82], [74, 52, 92, 80, 86, 94, 3, 63, 40, 42, 69, 93, 95, 57, 55, 88, 47, 23, 92, 24, 92, 16, 35, 73, 40, 76, 98, 25, 29, 18, 99], [54, 18, 49, 72, 31, 41, 51, 75, 72, 54, 76, 74, 42, 72, 63, 89, 4, 3, 19, 34, 63, 25, 93, 77, 45, 46, 5, 85, 30, 93, 18]], [[31, 83, 0, 0, 5, 89, 29, 61, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 89], [0, 0, 0, 0, 0, 95, 49, 0, 65, 0, 0, 71, 0, 0, 95, 0, 1, 0, 0, 65, 17, 35, 5, 0, 0, 53, 79, 0], [0, 89, 0, 91, 97, 0, 0, 0, 43, 0, 0, 41, 0, 41, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 55, 0, 0, 79], [0, 71, 53, 0, 0, 0, 97, 5, 0, 0, 91, 0, 0, 0, 0, 67, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 29, 0, 0, 0, 35, 0, 0, 0], [41, 71, 71, 83, 67, 0, 0, 0, 0, 65, 0, 0, 19, 11, 19, 0, 0, 0, 0, 19, 67, 0, 0, 41, 17, 29, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 29, 59, 71, 53, 0, 0, 0, 17, 0, 0, 0, 97, 95, 0, 89, 0, 1, 0], [65, 0, 7, 0, 73, 61, 0, 0, 0, 55, 0, 0, 19, 0, 47, 61, 0, 0, 0, 0, 91, 0, 0, 0, 0, 77, 0, 53], [0, 19, 71, 37, 53, 0, 29, 0, 0, 0, 0, 0, 0, 59, 97, 0, 0, 83, 0, 0, 0, 0, 0, 83, 43, 53, 49, 0], [83, 71, 91, 0, 0, 91, 19, 23, 0, 0, 77, 0, 0, 67, 0, 0, 0, 0, 5, 1, 0, 0, 0, 73, 0, 0, 85, 0], [0, 0, 0, 0, 19, 0, 0, 17, 23, 0, 83, 0, 0, 0, 0, 0, 91, 0, 0, 0, 53, 0, 0, 0, 0, 0, 13, 25], [83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 37, 0, 0, 0, 0, 0, 25, 0, 83, 53, 95, 0, 0, 0], [37, 59, 5, 5, 0, 95, 23, 0, 55, 77, 0, 0, 23, 0, 0, 83, 89, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 19, 11, 23, 73, 83, 23, 53, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 23, 83, 65, 0, 0, 0, 0, 0], [79, 0, 79, 55, 0, 0, 0, 0, 55, 31, 83, 17, 0, 0, 0, 55, 0, 49, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0], [0, 29, 0, 29, 91, 23, 0, 41, 0, 1, 0, 43, 0, 43, 0, 0, 0, 53, 0, 85, 25, 0, 95, 0, 0, 0, 71, 0], [0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 59, 71, 0, 0, 0, 0, 71, 95, 0, 0], [0, 0, 77, 0, 0, 0, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 59, 0, 23, 0, 89, 0, 0, 0, 0, 0, 97, 0], [85, 0, 0, 0, 0, 41, 0, 0, 0, 31, 41, 79, 0, 49, 0, 0, 0, 0, 37, 0, 77, 0, 0, 77, 0, 41, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 89, 0], [0, 0, 29, 0, 59, 89, 83, 0, 0, 11, 0, 0, 0, 91, 0, 0, 0, 73, 91, 89, 89, 1, 95, 61, 19, 65, 0, 0], [0, 0, 79, 0, 0, 53, 77, 49, 0, 1, 0, 0, 71, 77, 0, 25, 0, 91, 0, 0, 0, 0, 0, 65, 19, 0, 95, 43], [0, 0, 31, 83, 0, 97, 0, 0, 0, 73, 0, 47, 47, 19, 0, 0, 85, 61, 0, 0, 83, 0, 0, 29, 0, 0, 0, 0], [0, 0, 0, 0, 55, 0, 0, 0, 71, 29, 83, 95, 0, 5, 0, 0, 61, 0, 55, 47, 0, 0, 79, 1, 49, 0, 11, 0], [19, 0, 0, 25, 29, 0, 41, 0, 13, 0, 5, 0, 97, 0, 71, 89, 0, 89, 0, 0, 0, 31, 0, 53, 0, 1, 0, 0], [0, 47, 0, 0, 0, 11, 0, 0, 0, 25, 0, 0, 0, 0, 0, 19, 31, 0, 0, 0, 0, 0, 0, 0, 0, 97, 25, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 25, 0, 0, 35, 23, 0, 19, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 17, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 19, 0, 19, 0, 0, 0]], [[86, 39, 88, 64, 64, 37, 73, 80, 25, 79, 52, 51, 19, 48, 70, 73, 48, 63, 88, 16, 65, 48, 18, 28, 86, 68, 39, 5, 55, 72, 32, 80, 36, 99, 34], [48, 65, 65, 73, 63, 75, 55, 30, 69, 9, 72, 86, 91, 97, 40, 82, 5, 27, 81, 60, 14, 1, 26, 40, 66, 25, 90, 67, 99, 91, 72, 58, 90, 15, 32], [23, 80, 72, 57, 90, 2, 90, 95, 85, 57, 31, 8, 50, 43, 82, 6, 52, 75, 80, 62, 45, 2, 12, 63, 85, 70, 26, 16, 70, 81, 7, 32, 37, 94, 98], [15, 21, 54, 26, 33, 81, 87, 40, 92, 3, 85, 11, 78, 60, 22, 41, 52, 56, 59, 35, 32, 46, 52, 94, 7, 87, 37, 97, 93, 62, 28, 5, 49, 82, 22], [76, 57, 20, 20, 21, 61, 42, 5, 77, 98, 55, 66, 19, 93, 10, 63, 95, 65, 56, 79, 97, 53, 34, 6, 10, 40, 40, 31, 85, 64, 41, 69, 13, 87, 53], [6, 47, 51, 40, 50, 99, 74, 22, 81, 41, 4, 80, 4, 43, 91, 22, 21, 15, 63, 17, 34, 66, 39, 55, 36, 66, 97, 38, 55, 87, 18, 97, 31, 89, 65], [75, 45, 99, 54, 56, 42, 4, 40, 26, 96, 88, 36, 81, 33, 95, 53, 81, 39, 28, 25, 75, 8, 69, 40, 16, 30, 37, 78, 71, 31, 87, 42, 22, 36, 17], [40, 19, 21, 62, 43, 32, 10, 82, 99, 29, 95, 44, 95, 94, 16, 14, 1, 50, 32, 96, 88, 83, 15, 1, 84, 6, 45, 63, 14, 11, 83, 74, 76, 96, 53], [78, 42, 30, 64, 97, 13, 16, 42, 44, 61, 2, 67, 81, 11, 51, 80, 99, 2, 42, 54, 51, 51, 96, 3, 16, 49, 5, 44, 75, 56, 74, 48, 72, 43, 7], [30, 13, 90, 78, 1, 17, 42, 50, 87, 19, 86, 72, 78, 4, 86, 39, 8, 43, 49, 48, 19, 60, 27, 24, 74, 73, 13, 59, 32, 34, 55, 93, 24, 84, 56], [71, 81, 10, 4, 78, 71, 76, 75, 47, 17, 8, 27, 67, 21, 59, 79, 47, 26, 30, 40, 80, 44, 54, 37, 11, 9, 94, 73, 42, 82, 49, 19, 47, 75, 59], [59, 76, 5, 83, 49, 4, 17, 80, 90, 96, 52, 83, 24, 8, 81, 92, 32, 77, 76, 70, 34, 47, 63, 68, 15, 66, 20, 92, 55, 81, 77, 17, 8, 81, 73], [42, 41, 17, 73, 48, 41, 60, 14, 37, 36, 68, 95, 62, 2, 48, 41, 85, 76, 85, 91, 11, 4, 18, 24, 71, 25, 27, 57, 81, 80, 62, 4, 18, 72, 8], [38, 10, 4, 2, 15, 22, 30, 4, 70, 25, 43, 60, 74, 55, 1, 50, 1, 20, 99, 52, 27, 42, 12, 51, 10, 3, 91, 27, 69, 82, 98, 21, 70, 1, 36], [11, 38, 88, 76, 14, 36, 99, 12, 60, 88, 12, 30, 57, 95, 77, 4, 74, 43, 20, 3, 15, 30, 26, 91, 88, 21, 96, 31, 22, 65, 79, 32, 38, 97, 20], [91, 68, 2, 42, 32, 36, 69, 28, 59, 46, 34, 14, 94, 2, 13, 60, 38, 54, 14, 30, 2, 83, 99, 20, 65, 77, 61, 1, 27, 14, 15, 26, 38, 65, 4], [94, 68, 94, 65, 13, 26, 89, 89, 27, 10, 22, 34, 32, 84, 91, 6, 97, 95, 53, 88, 53, 77, 54, 35, 61, 52, 29, 25, 88, 35, 73, 83, 95, 13, 11], [12, 14, 83, 83, 42, 39, 88, 9, 99, 11, 13, 11, 78, 75, 96, 30, 3, 76, 68, 78, 15, 98, 46, 92, 71, 64, 45, 22, 71, 80, 4, 91, 60, 66, 22], [10, 29, 19, 7, 13, 42, 4, 98, 67, 72, 47, 42, 54, 72, 3, 6, 58, 55, 12, 96, 62, 46, 83, 78, 22, 16, 98, 36, 25, 92, 67, 32, 11, 15, 2], [39, 67, 9, 76, 60, 65, 51, 86, 92, 15, 34, 71, 79, 34, 76, 71, 69, 38, 88, 26, 17, 85, 91, 85, 6, 18, 96, 7, 6, 71, 95, 49, 98, 78, 5], [89, 10, 38, 46, 2, 86, 85, 95, 58, 25, 7, 14, 61, 61, 82, 75, 78, 32, 28, 84, 74, 64, 1, 2, 99, 54, 29, 8, 67, 29, 96, 95, 76, 83, 94], [16, 74, 25, 21, 88, 17, 42, 20, 7, 10, 85, 58, 88, 82, 14, 47, 87, 59, 23, 53, 34, 50, 51, 84, 32, 98, 50, 40, 25, 31, 74, 35, 58, 43, 89], [5, 35, 15, 66, 10, 31, 80, 97, 78, 68, 70, 1, 30, 19, 73, 2, 61, 77, 37, 72, 59, 3, 97, 99, 16, 68, 24, 35, 33, 60, 28, 17, 11, 27, 92], [39, 7, 84, 66, 13, 77, 85, 75, 47, 93, 22, 38, 11, 24, 13, 88, 42, 29, 14, 23, 68, 95, 41, 30, 43, 73, 91, 16, 37, 18, 14, 51, 46, 22, 39], [23, 80, 42, 44, 50, 99, 71, 76, 57, 68, 10, 39, 4, 25, 24, 53, 15, 31, 64, 84, 50, 87, 61, 3, 34, 82, 81, 4, 59, 35, 7, 46, 32, 20, 56], [81, 91, 69, 77, 25, 97, 84, 86, 33, 18, 24, 71, 98, 70, 66, 41, 36, 92, 65, 4, 12, 25, 19, 19, 49, 30, 20, 90, 30, 67, 11, 12, 5, 27, 54], [36, 75, 39, 62, 33, 96, 58, 29, 40, 24, 58, 25, 78, 3, 30, 99, 26, 82, 62, 77, 62, 81, 14, 34, 26, 29, 13, 34, 65, 21, 99, 61, 33, 24, 12], [23, 36, 37, 10, 68, 81, 51, 93, 63, 32, 8, 2, 58, 68, 39, 59, 54, 45, 31, 52, 95, 18, 61, 50, 4, 42, 2, 48, 84, 51, 62, 36, 1, 75, 16], [51, 30, 65, 41, 21, 92, 69, 37, 82, 90, 94, 83, 58, 69, 15, 70, 76, 53, 26, 33, 68, 21, 7, 29, 57, 75, 23, 49, 54, 14, 85, 93, 45, 3, 66], [11, 77, 15, 97, 25, 31, 51, 21, 51, 45, 28, 85, 69, 24, 81, 54, 14, 30, 37, 83, 59, 40, 15, 29, 49, 61, 90, 47, 81, 46, 86, 36, 50, 69, 87], [37, 31, 92, 34, 89, 71, 27, 44, 82, 49, 16, 10, 66, 50, 66, 83, 61, 7, 16, 13, 56, 84, 87, 71, 84, 25, 92, 2, 24, 53, 44, 14, 30, 58, 51], [44, 46, 26, 61, 98, 73, 52, 50, 29, 62, 67, 4, 16, 14, 96, 64, 58, 51, 62, 45, 90, 59, 59, 76, 17, 94, 65, 69, 7, 98, 36, 79, 6, 88, 79], [31, 74, 85, 47, 10, 66, 82, 98, 24, 16, 63, 86, 6, 15, 96, 33, 45, 6, 39, 8, 23, 83, 46, 11, 35, 26, 1, 41, 10, 11, 45, 65, 49, 49, 14], [38, 49, 34, 11, 77, 96, 90, 2, 3, 18, 14, 32, 14, 86, 13, 55, 66, 86, 28, 47, 88, 40, 8, 51, 28, 76, 95, 22, 9, 70, 99, 98, 71, 78, 25], [59, 83, 92, 82, 62, 79, 88, 91, 65, 45, 82, 96, 99, 72, 63, 35, 89, 96, 93, 83, 11, 89, 33, 3, 54, 62, 71, 65, 67, 71, 69, 30, 79, 6, 16]], [[0, 31, 0, 23, 0, 0, 0, 83, 0, 47, 0], [79, 0, 0, 0, 0, 0, 0, 0, 41, 97, 0], [11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0], [53, 5, 0, 0, 85, 29, 0, 0, 0, 0, 0], [41, 43, 0, 0, 0, 0, 0, 0, 35, 97, 0], [0, 0, 0, 61, 11, 0, 47, 0, 0, 85, 0], [0, 0, 0, 55, 0, 0, 67, 0, 0, 0, 11], [0, 47, 0, 0, 0, 0, 71, 0, 0, 0, 0], [0, 0, 53, 67, 0, 0, 0, 0, 73, 0, 0], [0, 0, 0, 0, 17, 0, 73, 0, 0, 0, 0]], [[65]]]; int [] param1 = [25, 22, 27, 11, 14, 22, 24, 20, 10, 0]; int [] param2 = [16, 12, 20, 9, 14, 20, 19, 22, 8, 0]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
NEXT_POWER_OF_2_1
static int f_filled ( int n ) { int p = 1 ; if ( n > 0 && ( n & ( n - 1 ) ) == 0 ) return n ; while ( p < n ) p <<= 1 ; return p ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [8, 128, 32, 64, 32, 2, 8, 128, 32, 8]; int [] param0 = [8, 79, 31, 63, 18, 2, 6, 85, 29, 8]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_GIVEN_SENTENCE_GIVEN_SET_SIMPLE_GRAMMER_RULES
static boolean f_filled ( char [ ] str ) { int len = str . length ; if ( str [ 0 ] < 'A' || str [ 0 ] > 'Z' ) return false ; if ( str [ len - 1 ] != '.' ) return false ; int prev_state = 0 , curr_state = 0 ; int index = 1 ; while ( index <= str . length ) { if ( str [ index ] >= 'A' && str [ index ] <= 'Z' ) curr_state = 0 ; else if ( str [ index ] == ' ' ) curr_state = 1 ; else if ( str [ index ] >= 'a' && str [ index ] <= 'z' ) curr_state = 2 ; else if ( str [ index ] == '.' ) curr_state = 3 ; if ( prev_state == curr_state && curr_state != 2 ) return false ; if ( prev_state == 2 && curr_state == 0 ) return false ; if ( curr_state == 3 && prev_state != 1 ) return ( index + 1 == str . length ) ; index ++ ; prev_state = curr_state ; } return false ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, true, false, false, false, true, false, false, false]; char [] [] param0 = [['i', ' ', 'l', 'o', 'v', 'e', ' ', 'c', 'i', 'n', 'e', 'm', 'a', '.'], ['t', 'h', 'e', ' ', 'v', 'e', 'r', 't', 'e', 'x', ' ', 'i', 's', ' ', 's', '.'], ['i', ' ', 'a', 'm', ' ', 's', 'i', 'n', 'g', 'l', 'e', '.'], ['m', 'y', ' ', 'n', 'a', 'm', 'e', ' ', 'i', 's', ' ', 'k', 'g', '.'], ['i', ' ', 'l', 'o', 'v', 'e', ' ', 'c', 'i', 'n', 'e', 'm', 'a', '.'], ['g', 'e', 'e', 'k', 's', 'q', 'u', 'i', 'z', '.', ' ', 'i', 's', ' ', 'a', ' ', 'q', 'u', 'i', 'z', ' ', 's', 'i', 't', 'e', '.'], ['i', ' ', 'l', 'o', 'v', 'e', ' ', 'g', 'e', 'e', 'k', 's', 'q', 'u', 'i', 'z', ' ', 'a', 'n', 'd', ' ', 'g', 'e', 'e', 'k', 's', 'f', 'o', 'r', 'g', 'e', 'e', 'k', 's', '.'], [' ', ' ', 'y', 'o', 'u', ' ', 'a', 'r', 'e', ' ', 'm', 'y', ' ', 'f', 'r', 'i', 'e', 'n', 'd', '.'], ['i', ' ', 'l', 'o', 'v', 'e', ' ', 'c', 'i', 'n', 'e', 'm', 'a'], ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', ' ', '!']]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
MAXIMUM_DISTANCE_TWO_OCCURRENCES_ELEMENT_ARRAY
static int f_filled ( 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 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 30, 10, 0, 0, 28, 1, 0, 20, 0]; 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]]; int [] param1 = [27, 34, 11, 1, 12, 29, 9, 2, 22, 10]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_GIVEN_STRING_ROTATION_PALINDROME
static boolean f_filled ( String str ) { int l = 0 ; int h = str . length ( ) - 1 ; while ( h > l ) if ( str . charAt ( l ++ ) != str . charAt ( h -- ) ) return false ; return true ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, false, true, false, false, false, true, false, false, false]; string [] param0 = ["aadaa", "2674377254", "11", "0011000", "26382426486138", "111010111010", "abccba", "5191", "1110101101", "abcdecbe"]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
MINIMUM_OPERATIONS_MAKE_GCD_ARRAY_MULTIPLE_K
static int f_filled ( int a [ ] , int n , int k ) { int result = 0 ; for ( int i = 0 ; i < n ; ++ i ) { if ( a [ i ] != 1 && a [ i ] > k ) { result = result + Math . min ( a [ i ] % k , k - a [ i ] % k ) ; } else { result = result + k - a [ i ] ; } } return result ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [19, 130, 661, 43, 778, 1096, 28, 479, 413, 51]; int [] [] param0 = [[3, 7, 27, 32, 36, 37, 44, 48, 50, 64, 86], [-22, 6, -20, 60, -74, 98, 52, -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], [77, 11, 51, 11, 84, 79, 43, 12, 14, 50, 15, 6, 85, 32, 74, 49, 7, 2, 58], [-90, -66, -64, -58, -46, -44, -32, -30, -30, -22, -18, -14, 12, 12, 18, 34, 44, 60, 70, 70, 74, 76, 86, 98, 98], [1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1], [9, 22, 27, 27, 37, 53, 53, 56, 63, 73, 76, 81, 82], [-46, 60, 80, 80, 42, -98, 30, -48, 4, -32, -78, 40, 52, 26, 88, 4, 22, 62, 88, -94, 2, 0, 58, 38, 52, -50, -52, 58, -62, 30, -38, -8, -82, -66], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [42, 69, 93, 82, 8, 23, 73, 1, 77, 39, 49, 4, 95, 85]]; int [] param1 = [5, 5, 23, 9, 12, 36, 10, 18, 19, 12]; int [] param2 = [10, 4, 29, 17, 22, 31, 11, 19, 22, 13]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_IF_ALL_THE_ELEMENTS_CAN_BE_MADE_OF_SAME_PARITY_BY_INVERTING_ADJACENT_ELEMENTS
static boolean f_filled ( int [ ] a , int n ) { int count_odd = 0 , count_even = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( a [ i ] & 1 ) == 1 ) count_odd ++ ; else count_even ++ ; } if ( count_odd % 2 == 1 && count_even % 2 == 1 ) return false ; else return true ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, false, true, true, true, true, true, true, true]; int [] [] param0 = [[1, 1, 1, 7, 7, 8, 10, 10, 10, 14, 15, 18, 20, 23, 24, 24, 26, 30, 32, 32, 33, 36, 42, 43, 46, 48, 51, 51, 52, 53, 58, 58, 59, 59, 59, 60, 67, 71, 72, 74, 76, 77, 83, 84, 86, 90, 91], [-90, -20, -60, -64, -24, 84, -2, -32, 28, -54, 44, -96, 52, 88, 20, -56, -2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [98, 70, 24, 18, 7, 4, 78, 19, 70, 56, 99, 54, 69, 15, 88, 20, 40, 13, 19, 56, 62], [-72, -66, -58, -20, 36, 80, 92], [0, 1], [6, 13, 14, 16, 21, 26, 26, 28, 29, 35, 38, 42, 47, 47, 62, 67, 77, 81, 81, 83, 84, 88, 90, 96, 97, 98], [-48, -8, 20, 32, -90, -42, -6, -88, -72, 42, 66, -62, 82, -4, 8, 12, -22, 82, 56, 96, -54, 92, -42, 30, -18, 14, -6, -66, 34, 16, -84, -94, 48, -48, 52, -60, -92, -16], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], [45, 86, 53, 80, 27, 45, 1, 85, 91, 93, 92, 43, 75, 86, 81, 48, 21, 34, 5, 10, 88, 42, 7, 15, 96, 85, 62, 86, 52, 37]]; int [] param1 = [30, 12, 36, 19, 6, 1, 17, 35, 14, 29]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
COUNT_DIGITS_FACTORIAL_SET_1
static int f_filled ( int n ) { if ( n < 0 ) return 0 ; if ( n <= 1 ) return 1 ; double digits = 0 ; for ( int i = 2 ; i <= n ; i ++ ) digits += Math . log10 ( i ) ; return ( int ) ( Math . floor ( digits ) ) + 1 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [93, 4, 74, 44, 112, 14, 15, 149, 102, 139]; int [] param0 = [66, 7, 55, 37, 76, 16, 17, 95, 71, 90]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
MINIMUM_TIME_TO_FINISH_TASKS_WITHOUT_SKIPPING_TWO_CONSECUTIVE
static int f_filled ( int arr [ ] , int n ) { if ( n <= 0 ) return 0 ; int incl = arr [ 0 ] ; int excl = 0 ; for ( int i = 1 ; i < n ; i ++ ) { int incl_new = arr [ i ] + Math . min ( excl , incl ) ; int excl_new = incl ; incl = incl_new ; excl = excl_new ; } return Math . min ( incl , excl ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [93, -834, 5, 359, -1152, 1, 28, -314, 1, 397]; int [] [] param0 = [[5, 17, 25, 27, 29, 30, 34, 49, 72, 75, 90, 93, 93, 94], [-70, -32, 62, 0, -10, 92, -94, -86, 52, 6, -26, -92, -10, 70, -82, 28, 86, 58, 86, -58, 84, -80, -18, -92, -34, 6, 34, 36, 70, -50, -6, -54, 84, 22, 30, -96, -84, 72, 2, 26, -20, 4, 48, -98, 62, -28, -68], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [34, 40, 92, 35, 29, 26, 12, 66, 7, 28, 86, 4, 35, 79, 1, 48, 41, 47, 15, 75, 45, 6, 3, 94, 39, 50, 20, 8, 58, 51, 83, 44, 53, 76, 19, 84, 68, 54, 36, 53], [-98, -98, -92, -92, -88, -82, -74, -70, -68, -68, -64, -60, -52, -52, -42, -42, -38, -36, -36, -34, -26, -24, -22, -12, -2, -2, 4, 6, 44, 44, 48, 54, 62, 62, 64, 74, 78, 82, 86, 86, 90, 90, 94], [1, 1, 0, 0, 1, 0, 0, 1, 1, 1], [9, 15, 19, 29, 30, 39, 40, 61], [92, 0, 46, 70, -60, -50, 58, -56, 8, -90, 84, 16, 40, -62, 50, 78, 26, -42, -40, 98, -52, 62, 16, -62, -76, -70, -60, 32, 4, -68, 52, -64, 70, 12, -10], [0, 0, 0, 1, 1, 1, 1], [32, 96, 63, 93, 53, 1, 22, 19, 50, 74, 6, 94, 81, 85, 4, 86, 88, 75, 94]]; int [] param1 = [8, 36, 21, 29, 36, 5, 4, 21, 5, 18]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_IF_A_NUMBER_IS_JUMBLED_OR_NOT
static boolean f_filled ( int num ) { if ( num / 10 == 0 ) return true ; while ( num != 0 ) { if ( num / 10 == 0 ) return true ; int digit1 = num % 10 ; int digit2 = ( num / 10 ) % 10 ; if ( Math . abs ( digit2 - digit1 ) > 1 ) return false ; num = num / 10 ; } return true ; }
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++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_IF_A_NUMBER_IS_POWER_OF_ANOTHER_NUMBER
static boolean f_filled ( int x , int y ) { if ( x == 1 ) return ( y == 1 ) ; int pow = 1 ; while ( pow < y ) pow = pow * x ; return ( pow == y ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, false, true, true, true, false, false, false, false]; int [] param0 = [57, 3, 10, 10, 6, 2, 1, 20, 96, 25]; int [] param1 = [1, 9, 101, 10000, 46656, 2048, 40, 79, 98, 5]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
COMPUTE_AVERAGE_TWO_NUMBERS_WITHOUT_OVERFLOW
static int f_filled ( int a , int b ) { return ( a + b ) / 2 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [22, 33, 47, 34, 22, 90, 46, 44, 14, 60]; int [] param0 = [1, 6, 75, 51, 19, 82, 72, 48, 12, 41]; int [] param1 = [44, 61, 20, 17, 25, 98, 21, 41, 17, 80]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_IF_A_NUMBER_IS_POWER_OF_ANOTHER_NUMBER_1
static boolean f_filled ( int x , int y ) { int res1 = ( int ) Math . log ( y ) / ( int ) Math . log ( x ) ; double res2 = Math . log ( y ) / Math . log ( x ) ; return ( res1 == res2 ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [true, true, false, true, false, false, false, false, false, false]; int [] param0 = [57, 3, 10, 10, 6, 3, 3, 20, 96, 25]; int [] param1 = [1, 9, 101, 10000, 46656, 2048, 40, 79, 98, 5]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
COUNT_NUMBER_PAIRS_N_B_N_GCD_B_B
static int f_filled ( int n ) { int k = n ; int imin = 1 ; int ans = 0 ; while ( imin <= n ) { int imax = n / k ; ans += k * ( imax - imin + 1 ) ; imin = imax + 1 ; k = n / imin ; } return ans ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [52, 326, 170, 231, 267, 74, 52, 300, 66, 103]; int [] param0 = [17, 72, 43, 55, 62, 22, 17, 68, 20, 29]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_IF_X_CAN_GIVE_CHANGE_TO_EVERY_PERSON_IN_THE_QUEUE
static int f_filled ( int notes [ ] , int n ) { int fiveCount = 0 ; int tenCount = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( notes [ i ] == 5 ) fiveCount ++ ; else if ( notes [ i ] == 10 ) { if ( fiveCount > 0 ) { fiveCount -- ; tenCount ++ ; } else return 0 ; } else { if ( fiveCount > 0 && tenCount > 0 ) { fiveCount -- ; tenCount -- ; } else if ( fiveCount >= 3 ) { fiveCount -= 3 ; } else return 0 ; } } return 1 ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 0, 1, 0, 1, 0, 0, 0, 0, 0]; int [] [] param0 = [[5, 5, 5, 10, 20], [5, 5, 5, 20, 10], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 18], [5, 5, 20], [10, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [5, 10, 20, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [-82, -10, -78, -84, 68, 62, 10, 20, -86, -98, 92, 70, 40, -12, -20, -36, 8, -70, 6, 8, 44, -24, 8, -18, 76, -54, -14, -94, -68, -62, -24, -36, -74, 92, 92, -80, 48, 56, 94], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [46, 46, 93, 57, 82, 34, 83, 80, 77, 36, 80, 85, 69, 28, 9, 56, 49, 27, 83, 25, 1, 80, 99, 14, 69, 82, 79, 71, 74, 34]]; int [] param1 = [4, 5, 27, 12, 2, 17, 7, 31, 25, 20]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
C_PROGRAM_FACTORIAL_NUMBER
static int f_filled ( int n ) { if ( n == 0 ) return 1 ; return n * f_filled ( n - 1 ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600]; int [] param0 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_INTEGER_OVERFLOW_MULTIPLICATION
static Boolean f_filled ( long a , long b ) { if ( a == 0 || b == 0 ) return false ; long result = a * b ; if ( a == result / b ) return false ; else return true ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [false, true, true, false, false, false, false, false, false, false]; long [] param0 = [37, 10000000000, 10000000000, 999999999, 39, 92, 14, 19, 14, 88]; long [] param1 = [80, -10000000000, 10000000000, 999999999, 36, 56, 21, 38, 82, 41]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
COUNT_NUMBER_OF_WAYS_TO_COVER_A_DISTANCE_1
static int f_filled ( int dist ) { int [ ] count = new int [ dist + 1 ] ; count [ 0 ] = 1 ; count [ 1 ] = 1 ; count [ 2 ] = 2 ; for ( int i = 3 ; i <= dist ; i ++ ) count [ i ] = count [ i - 1 ] + count [ i - 2 ] + count [ i - 3 ] ; return count [ dist ] ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [2, 7, 81, 10609, 181997601]; int [] param0 = [2, 4, 8, 16, 32]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
FIND_REPETITIVE_ELEMENT_1_N_1_2
static int f_filled ( int arr [ ] , int n ) { int res = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) res = res ^ ( i + 1 ) ^ arr [ i ] ; res = res ^ arr [ n - 1 ] ; return res ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ int [] results = [52, 46, 1, 28, -32, 16, 25, 103, 21, 9]; int [] [] param0 = [[2, 2, 4, 5, 5, 7, 7, 7, 8, 11, 14, 15, 18, 19, 20, 25, 25, 29, 29, 31, 32, 32, 33, 38, 42, 48, 52, 55, 60, 61, 63, 71, 74, 78, 82, 82, 84, 84, 87, 87, 88, 90, 93, 94, 94], [46, 2, 62, 60, 92, 4, 26, 66, 66, 90, 26, -14, 76, -20, -68], [0, 0, 0, 1, 1, 1, 1, 1], [87, 67, 11, 47, 64, 81, 94, 75, 58, 77, 18, 2, 85, 26, 6, 44, 55, 19, 46, 49, 5, 69, 44, 12, 42, 66, 46, 9, 26, 49, 68, 95, 6, 9, 11, 72, 5, 67], [-98, -94, -92, -82, -78, -64, -62, -58, -52, -44, -40, -38, -8, 6, 10, 20, 22, 28, 30, 30, 36, 54, 54, 58, 64, 68, 76, 78, 84, 88, 90, 94, 96], [1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1], [1, 14, 15, 15, 21, 34, 38, 39, 41, 50, 60, 74, 96, 97], [96, -12, -16, -52], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [66, 21, 21, 59, 78, 8, 46, 41, 16, 32, 97, 93, 32, 86, 91, 61, 67, 61, 97, 49, 66, 35, 24, 35, 65, 45, 83]]; int [] param1 = [31, 8, 4, 34, 29, 17, 7, 3, 21, 25]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
CHECK_LARGE_NUMBER_DIVISIBLE_13_NOT
static boolean f_filled ( 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 ) ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ bool [] results = [false, false, false, false, true, true, false, false, false, false]; string [] param0 = ["vztuaitpcplnjy", "33855", "0011110101011", "mmq", "439340517954", "000000000", "uugaurrjbjegl", "6406553695441", "011001", "yjfqeevginjex"]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
LONGEST_REPEATED_SUBSEQUENCE_1
static String f_filled ( String str ) { int n = str . length ( ) ; int [ ] [ ] dp = new int [ n + 1 ] [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) for ( int j = 0 ; j <= n ; j ++ ) dp [ i ] [ j ] = 0 ; for ( int i = 1 ; i <= n ; i ++ ) for ( int j = 1 ; j <= n ; j ++ ) if ( str . charAt ( i - 1 ) == str . charAt ( j - 1 ) && i != j ) dp [ i ] [ j ] = 1 + dp [ i - 1 ] [ j - 1 ] ; else dp [ i ] [ j ] = Math . max ( dp [ i ] [ j - 1 ] , dp [ i - 1 ] [ j ] ) ; String res = "" ; int i = n , j = n ; while ( i > 0 && j > 0 ) { if ( dp [ i ] [ j ] == dp [ i - 1 ] [ j - 1 ] + 1 ) { res = res + str . charAt ( i - 1 ) ; i -- ; j -- ; } else if ( dp [ i ] [ j ] == dp [ i - 1 ] [ j ] ) i -- ; else j -- ; } String reverse = "" ; for ( int k = res . length ( ) - 1 ; k >= 0 ; k -- ) { reverse = reverse + res . charAt ( k ) ; } return reverse ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ string [] results = ["x", "7733007", "0000111111", "", "", "10", "", "", "0000010", ""]; string [] param0 = ["qnqxjorx", "27473733400077", "000010111111", "tnvwgrwslu", "9537", "1100", "lycoiqfzn", "52", "00100001100", "rkxe"]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
FIND_WHETHER_AN_ARRAY_IS_SUBSET_OF_ANOTHER_ARRAY_SET_1_1
static boolean f_filled ( int arr1 [ ] , int arr2 [ ] , int m , int n ) { int i = 0 , j = 0 ; if ( m < n ) return false ; Arrays . sort ( arr1 ) ; Arrays . sort ( arr2 ) ; while ( i < n && j < m ) { if ( arr1 [ j ] < arr2 [ i ] ) j ++ ; else if ( arr1 [ j ] == arr2 [ i ] ) { j ++ ; i ++ ; } else if ( arr1 [ j ] > arr2 [ i ] ) return false ; } if ( i < n ) return false ; else return true ; }
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, 85, 85, 94, 96], [-94, -94, -92, -92, -90, -88, -86, -80, -76, -76, -68, -62, -58, -56, -54, -50, -42, -42, -20, -18, -18, -14, -8, -2, 0, 0, 0, 2, 6, 8, 8, 12, 18, 18, 30, 44, 44, 56, 56, 56, 58, 62, 62, 62, 74, 82, 86, 94], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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], [9, 10, 12, 12, 19, 20, 24, 26, 26, 30, 32, 36, 38, 45, 46, 51, 51, 52, 55, 56, 57, 57, 64, 65, 68, 80, 80, 82, 85, 86, 90, 92, 93, 94], [-98, -90, -86, -86, -84, -84, -82, -80, -78, -72, -70, -68, -66, -64, -52, -52, -50, -38, -28, -26, -24, -14, -8, 16, 26, 26, 28, 34, 36, 40, 42, 44, 44, 46, 50, 60, 68, 78, 80, 86, 90, 92, 98], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [6, 8, 11, 13, 14, 26, 26, 41, 48, 70, 82, 83, 84, 88, 96], [-94, -90, -88, -84, -62, -54, -50, -46, -38, -16, 0, 2, 2, 4, 14, 16, 18, 18, 26, 26, 30, 32, 48, 50, 62, 64, 68, 70, 76, 76, 76, 80, 80, 88, 90, 92, 94, 98], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [5, 7, 8, 13, 19, 26, 27, 27, 33, 38, 43, 44, 54, 54, 55, 59, 64, 65, 66, 68, 70, 77, 84, 92, 97]]; int [] [] param1 = [[10, 13, 17, 63], [-18, 12, 44], [0, 0, 0], [2, 32, 58, 80], [-99, -90, -90, -86], [0, 0, 1, 1], [1, 9, 12, 16], [-76, -54, 4, 78], [0, 0, 1, 1], [5, 9, 13, 93]]; int [] param2 = [31, 48, 44, 34, 43, 18, 15, 38, 12, 25]; int [] param3 = [4, 3, 3, 4, 4, 4, 4, 4, 4, 4]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i], param1[i], param2[i], param3[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
NUMBER_N_DIGIT_STEPPING_NUMBERS
static long f_filled ( int n ) { int dp [ ] [ ] = new int [ n + 1 ] [ 10 ] ; if ( n == 1 ) return 10 ; for ( int j = 0 ; j <= 9 ; j ++ ) dp [ 1 ] [ j ] = 1 ; for ( int i = 2 ; i <= n ; i ++ ) { for ( int j = 0 ; j <= 9 ; j ++ ) { if ( j == 0 ) dp [ i ] [ j ] = dp [ i - 1 ] [ j + 1 ] ; else if ( j == 9 ) dp [ i ] [ j ] = dp [ i - 1 ] [ j - 1 ] ; else dp [ i ] [ j ] = dp [ i - 1 ] [ j - 1 ] + dp [ i - 1 ] [ j + 1 ] ; } } long sum = 0 ; for ( int j = 1 ; j <= 9 ; j ++ ) sum += dp [ n ] [ j ] ; return sum ; }
import std.stdio; import std.math; import std.conv; import std.algorithm; //TOFILL// void main(){ long [] results = [17, 116, 424, 2986, 61, 1556, 32, 5721, 10982, 222]; int [] param0 = [2, 5, 7, 10, 4, 9, 3, 11, 12, 6]; int n_success = 0; for (int i = 0; i < param0.length; i++) { if (results[i] == f_filled(param0[i])) { n_success += 1; }} writefln("#Results:%d, %d", n_success, param0.length); }
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
5