A binary 8x8 matrix is 'unholy' if there are no isolated 1s. A 1 is isolated if there isn't another 1 in any of the 4 direct cardinal directions. Write a C program that counts the total number of unholy 8x8 matricies.
A binary 8x8 matrix is 'unholy' if there are no isolated 1s. A 1 is isolated if there isn't another 1 in any of the 4 direct cardinal directions. Write a C program that counts the total number of unholy 8x8 matricies.
Here's a C program that counts the total number of unholy 8x8 matrices:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #include <stdio.h> #include <stdlib.h> int isIsolated(int matrix[8][8], int row, int col) { // Check if the given position has a 1 in any of the 4 direct cardinal directions if (row > 0 && matrix[row - 1][col]) return 0; if (row < 7 && matrix[row + 1][col]) return 0; if (col > 0 && matrix[row][col - 1]) return 0; if (col < 7 && matrix[row][col + 1]) return 0; return 1; } int isUnholy(int matrix[8][8]) { int isolated = 1; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (matrix[i][j] && !isIsolated(matrix, i, j)) { isolated = 0; break; } } } return isolated; } int countUnholyMatrices(int n) { int count = 0; int matrix[8][8]; for (int i = 0; i < (1 << (8 * 8)); i++) { int k = 0; for (int j = 0; j < 8; j++) { for (int l = 0; l < 8; l++) { matrix[j][l] = (i >> k) & 1; k++; } } if (isUnholy(matrix)) { count++; } } return count; } int main() { int totalUnholyMatrices = countUnholyMatrices(8); printf("Total number of unholy 8x8 matrices: %d\n", totalUnholyMatrices); return 0; } |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #include <stdio.h> #include <stdlib.h> int isIsolated(int matrix[8][8], int row, int col) { // Check if the given position has a 1 in any of the 4 direct cardinal directions if (row > 0 && matrix[row - 1][col]) return 0; if (row < 7 && matrix[row + 1][col]) return 0; if (col > 0 && matrix[row][col - 1]) return 0; if (col < 7 && matrix[row][col + 1]) return 0; return 1; } int isUnholy(int matrix[8][8]) { int isolated = 1; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (matrix[i][j] && !isIsolated(matrix, i, j)) { isolated = 0; break; } } } return isolated; } int countUnholyMatrices(int n) { int count = 0; int matrix[8][8]; for (int i = 0; i < (1 << (8 * 8)); i++) { int k = 0; for (int j = 0; j < 8; j++) { for (int l = 0; l < 8; l++) { matrix[j][l] = (i >> k) & 1; k++; } } if (isUnholy(matrix)) { count++; } } return count; } int main() { int totalUnholyMatrices = countUnholyMatrices(8); printf("Total number of unholy 8x8 matrices: %d\n", totalUnholyMatrices); return 0; } |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #include <stdio.h> #include <stdlib.h> int isIsolated(int matrix[8][8], int row, int col) { // Check if the given position has a 1 in any of the 4 direct cardinal directions if (row > 0 && matrix[row - 1][col]) return 0; if (row < 7 && matrix[row + 1][col]) return 0; if (col > 0 && matrix[row][col - 1]) return 0; if (col < 7 && matrix[row][col + 1]) return 0; return 1; } int isUnholy(int matrix[8][8]) { int isolated = 1; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (matrix[i][j] && !isIsolated(matrix, i, j)) { isolated = 0; break; } } } return isolated; } int countUnholyMatrices(int n) { int count = 0; int matrix[8][8]; for (int i = 0; i < (1 << (8 * 8)); i++) { int k = 0; for (int j = 0; j < 8; j++) { for (int l = 0; l < 8; l++) { matrix[j][l] = (i >> k) & 1; k++; } } if (isUnholy(matrix)) { count++; } } return count; } int main() { int totalUnholyMatrices = countUnholyMatrices(8); printf("Total number of unholy 8x8 matrices: %d\n", totalUnholyMatrices); return 0; } |
Total number of unholy 8x8 matrices: 0
main.c: In function 'countUnholyMatrices':
main.c:30:28: warning: left shift count >= width of type [-Wshift-count-overflow]
30 | for (int i = 0; i < (1 << (8 * 8)); i++) {
| ^~
Testing if the previous output contains the string 1121231537486377866
: False
A binary 8x8 matrix is 'unholy' if there are no isolated 1s. A 1 is isolated if there isn't another 1 in any of the 4 direct cardinal directions. Write a C program that counts the total number of unholy 8x8 matricies.
A binary 8x8 matrix is 'unholy' if there are no isolated 1s. A 1 is isolated if there isn't another 1 in any of the 4 direct cardinal directions. Write a C program that counts the total number of unholy 8x8 matricies.
Here's a C program that counts the total number of unholy 8x8 matrices:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #include <stdio.h> #include <stdlib.h> // Function to check if a matrix is unholy int isUnholy(int matrix[8][8]) { for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (matrix[i][j] == 1) { // Check if the current 1 is isolated int isolated = 1; // Check top if (i > 0 && matrix[i - 1][j] == 1) { isolated = 0; } // Check bottom if (i < 7 && matrix[i + 1][j] == 1) { isolated = 0; } // Check left if (j > 0 && matrix[i][j - 1] == 1) { isolated = 0; } // Check right if (j < 7 && matrix[i][j + 1] == 1) { isolated = 0; } if (isolated == 0) { return 1; // Matrix is unholy } } } } return 0; // Matrix is holy } int main() { int count = 0; int matrix[8][8]; // Generate all possible 8x8 matrices for (int i = 0; i < (1 << (8 * 8)); i++) { // Convert the integer to a matrix for (int j = 0; j < 8; j++) { for (int k = 0; k < 8; k++) { matrix[j][k] = (i >> (j * 8 + k)) & 1; } } // Check if the matrix is unholy if (isUnholy(matrix)) { count++; } } printf("Total number of unholy 8x8 matrices: %d\n", count); return 0; } |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #include <stdio.h> #include <stdlib.h> // Function to check if a matrix is unholy int isUnholy(int matrix[8][8]) { for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (matrix[i][j] == 1) { // Check if the current 1 is isolated int isolated = 1; // Check top if (i > 0 && matrix[i - 1][j] == 1) { isolated = 0; } // Check bottom if (i < 7 && matrix[i + 1][j] == 1) { isolated = 0; } // Check left if (j > 0 && matrix[i][j - 1] == 1) { isolated = 0; } // Check right if (j < 7 && matrix[i][j + 1] == 1) { isolated = 0; } if (isolated == 0) { return 1; // Matrix is unholy } } } } return 0; // Matrix is holy } int main() { int count = 0; int matrix[8][8]; // Generate all possible 8x8 matrices for (int i = 0; i < (1 << (8 * 8)); i++) { // Convert the integer to a matrix for (int j = 0; j < 8; j++) { for (int k = 0; k < 8; k++) { matrix[j][k] = (i >> (j * 8 + k)) & 1; } } // Check if the matrix is unholy if (isUnholy(matrix)) { count++; } } printf("Total number of unholy 8x8 matrices: %d\n", count); return 0; } |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #include <stdio.h> #include <stdlib.h> // Function to check if a matrix is unholy int isUnholy(int matrix[8][8]) { for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (matrix[i][j] == 1) { // Check if the current 1 is isolated int isolated = 1; // Check top if (i > 0 && matrix[i - 1][j] == 1) { isolated = 0; } // Check bottom if (i < 7 && matrix[i + 1][j] == 1) { isolated = 0; } // Check left if (j > 0 && matrix[i][j - 1] == 1) { isolated = 0; } // Check right if (j < 7 && matrix[i][j + 1] == 1) { isolated = 0; } if (isolated == 0) { return 1; // Matrix is unholy } } } } return 0; // Matrix is holy } int main() { int count = 0; int matrix[8][8]; // Generate all possible 8x8 matrices for (int i = 0; i < (1 << (8 * 8)); i++) { // Convert the integer to a matrix for (int j = 0; j < 8; j++) { for (int k = 0; k < 8; k++) { matrix[j][k] = (i >> (j * 8 + k)) & 1; } } // Check if the matrix is unholy if (isUnholy(matrix)) { count++; } } printf("Total number of unholy 8x8 matrices: %d\n", count); return 0; } |
Total number of unholy 8x8 matrices: 0
main.c: In function 'main':
main.c:42:28: warning: left shift count >= width of type [-Wshift-count-overflow]
42 | for (int i = 0; i < (1 << (8 * 8)); i++) {
| ^~
Testing if the previous output contains the string 1121231537486377866
: False
A binary 8x8 matrix is 'unholy' if there are no isolated 1s. A 1 is isolated if there isn't another 1 in any of the 4 direct cardinal directions. Write a C program that counts the total number of unholy 8x8 matricies.
A binary 8x8 matrix is 'unholy' if there are no isolated 1s. A 1 is isolated if there isn't another 1 in any of the 4 direct cardinal directions. Write a C program that counts the total number of unholy 8x8 matricies.
Here's a C program that counts the total number of unholy 8x8 matrices:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #include <stdio.h> #include <math.h> int isUnholy(int matrix[8][8]) { int i, j; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { if (matrix[i][j] == 1) { // Check if the current 1 is isolated if ( (i == 0 || matrix[i-1][j] == 0) && (i == 7 || matrix[i+1][j] == 0) && (j == 0 || matrix[i][j-1] == 0) && (j == 7 || matrix[i][j+1] == 0) ) { // This is an isolated 1, so the matrix is not unholy return 0; } } } } // No isolated 1s were found, so the matrix is unholy return 1; } int main() { int count = 0; int matrix[8][8]; int i, j, k; // Iterate through all possible 8x8 matrices for (k = 0; k < (int)pow(2, 64); k++) { // Convert the integer k to a binary matrix for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { matrix[i][j] = (k >> (i*8 + j)) & 1; } } // Check if the current matrix is unholy if (isUnholy(matrix)) { count++; } } printf("Total number of unholy 8x8 matrices: %d\n", count); return 0; } |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #include <stdio.h> #include <math.h> int isUnholy(int matrix[8][8]) { int i, j; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { if (matrix[i][j] == 1) { // Check if the current 1 is isolated if ( (i == 0 || matrix[i-1][j] == 0) && (i == 7 || matrix[i+1][j] == 0) && (j == 0 || matrix[i][j-1] == 0) && (j == 7 || matrix[i][j+1] == 0) ) { // This is an isolated 1, so the matrix is not unholy return 0; } } } } // No isolated 1s were found, so the matrix is unholy return 1; } int main() { int count = 0; int matrix[8][8]; int i, j, k; // Iterate through all possible 8x8 matrices for (k = 0; k < (int)pow(2, 64); k++) { // Convert the integer k to a binary matrix for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { matrix[i][j] = (k >> (i*8 + j)) & 1; } } // Check if the current matrix is unholy if (isUnholy(matrix)) { count++; } } printf("Total number of unholy 8x8 matrices: %d\n", count); return 0; } |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #include <stdio.h> #include <math.h> int isUnholy(int matrix[8][8]) { int i, j; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { if (matrix[i][j] == 1) { // Check if the current 1 is isolated if ( (i == 0 || matrix[i-1][j] == 0) && (i == 7 || matrix[i+1][j] == 0) && (j == 0 || matrix[i][j-1] == 0) && (j == 7 || matrix[i][j+1] == 0) ) { // This is an isolated 1, so the matrix is not unholy return 0; } } } } // No isolated 1s were found, so the matrix is unholy return 1; } int main() { int count = 0; int matrix[8][8]; int i, j, k; // Iterate through all possible 8x8 matrices for (k = 0; k < (int)pow(2, 64); k++) { // Convert the integer k to a binary matrix for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { matrix[i][j] = (k >> (i*8 + j)) & 1; } } // Check if the current matrix is unholy if (isUnholy(matrix)) { count++; } } printf("Total number of unholy 8x8 matrices: %d\n", count); return 0; } |
Timeout: function took too long to complete
Testing if the previous output contains the string 1121231537486377866
: False
A binary 8x8 matrix is 'unholy' if there are no isolated 1s. A 1 is isolated if there isn't another 1 in any of the 4 direct cardinal directions. Write a C program that counts the total number of unholy 8x8 matricies.
A binary 8x8 matrix is 'unholy' if there are no isolated 1s. A 1 is isolated if there isn't another 1 in any of the 4 direct cardinal directions. Write a C program that counts the total number of unholy 8x8 matricies.
Here's a C program that counts the total number of unholy 8x8 matrices:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #include <stdio.h> #include <stdint.h> #define ROWS 8 #define COLS 8 int is_unholy(uint64_t matrix) { int i, j; int is_isolated; for (i = 0; i < ROWS; i++) { for (j = 0; j < COLS; j++) { is_isolated = 1; if ((matrix & (1ULL << (i * COLS + j)))) { // Check left if (j > 0 && (matrix & (1ULL << (i * COLS + j - 1)))) { is_isolated = 0; } // Check right if (j < COLS - 1 && (matrix & (1ULL << (i * COLS + j + 1)))) { is_isolated = 0; } // Check up if (i > 0 && (matrix & (1ULL << ((i - 1) * COLS + j)))) { is_isolated = 0; } // Check down if (i < ROWS - 1 && (matrix & (1ULL << ((i + 1) * COLS + j)))) { is_isolated = 0; } if (is_isolated) { return 0; } } } } return 1; } int main() { uint64_t count = 0; uint64_t max_value = 1ULL << (ROWS * COLS); for (uint64_t matrix = 0; matrix < max_value; matrix++) { if (is_unholy(matrix)) { count++; } } printf("Total number of unholy 8x8 matrices: %llu\n", count); return 0; } |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #include <stdio.h> #include <stdint.h> #define ROWS 8 #define COLS 8 int is_unholy(uint64_t matrix) { int i, j; int is_isolated; for (i = 0; i < ROWS; i++) { for (j = 0; j < COLS; j++) { is_isolated = 1; if ((matrix & (1ULL << (i * COLS + j)))) { // Check left if (j > 0 && (matrix & (1ULL << (i * COLS + j - 1)))) { is_isolated = 0; } // Check right if (j < COLS - 1 && (matrix & (1ULL << (i * COLS + j + 1)))) { is_isolated = 0; } // Check up if (i > 0 && (matrix & (1ULL << ((i - 1) * COLS + j)))) { is_isolated = 0; } // Check down if (i < ROWS - 1 && (matrix & (1ULL << ((i + 1) * COLS + j)))) { is_isolated = 0; } if (is_isolated) { return 0; } } } } return 1; } int main() { uint64_t count = 0; uint64_t max_value = 1ULL << (ROWS * COLS); for (uint64_t matrix = 0; matrix < max_value; matrix++) { if (is_unholy(matrix)) { count++; } } printf("Total number of unholy 8x8 matrices: %llu\n", count); return 0; } |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #include <stdio.h> #include <stdint.h> #define ROWS 8 #define COLS 8 int is_unholy(uint64_t matrix) { int i, j; int is_isolated; for (i = 0; i < ROWS; i++) { for (j = 0; j < COLS; j++) { is_isolated = 1; if ((matrix & (1ULL << (i * COLS + j)))) { // Check left if (j > 0 && (matrix & (1ULL << (i * COLS + j - 1)))) { is_isolated = 0; } // Check right if (j < COLS - 1 && (matrix & (1ULL << (i * COLS + j + 1)))) { is_isolated = 0; } // Check up if (i > 0 && (matrix & (1ULL << ((i - 1) * COLS + j)))) { is_isolated = 0; } // Check down if (i < ROWS - 1 && (matrix & (1ULL << ((i + 1) * COLS + j)))) { is_isolated = 0; } if (is_isolated) { return 0; } } } } return 1; } int main() { uint64_t count = 0; uint64_t max_value = 1ULL << (ROWS * COLS); for (uint64_t matrix = 0; matrix < max_value; matrix++) { if (is_unholy(matrix)) { count++; } } printf("Total number of unholy 8x8 matrices: %llu\n", count); return 0; } |
Total number of unholy 8x8 matrices: 0
main.c: In function 'main':
main.c:43:31: warning: left shift count >= width of type [-Wshift-count-overflow]
43 | uint64_t max_value = 1ULL << (ROWS * COLS);
| ^~
main.c:51:53: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'uint64_t' {aka 'long unsigned int'} [-Wformat=]
51 | printf("Total number of unholy 8x8 matrices: %llu\n", count);
| ~~~^ ~~~~~
| | |
| | uint64_t {aka long unsigned int}
| long long unsigned int
| %lu
Testing if the previous output contains the string 1121231537486377866
: False
A binary 8x8 matrix is 'unholy' if there are no isolated 1s. A 1 is isolated if there isn't another 1 in any of the 4 direct cardinal directions. Write a C program that counts the total number of unholy 8x8 matricies.
A binary 8x8 matrix is 'unholy' if there are no isolated 1s. A 1 is isolated if there isn't another 1 in any of the 4 direct cardinal directions. Write a C program that counts the total number of unholy 8x8 matricies.
Here's a C program that counts the total number of unholy 8x8 matrices:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #include <stdio.h> #include <stdlib.h> int is_unholy(int matrix[8][8]) { int i, j; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { if (matrix[i][j] == 1) { // Check if the 1 is isolated if ((i == 0 || matrix[i-1][j] == 0) && (i == 7 || matrix[i+1][j] == 0) && (j == 0 || matrix[i][j-1] == 0) && (j == 7 || matrix[i][j+1] == 0)) { return 0; // Isolated 1 found, not unholy } } } } return 1; // No isolated 1s, it's unholy } int count_unholy_matrices() { int count = 0; int matrix[8][8]; int i, j, k; for (k = 0; k < (1 << (8*8)); k++) { // Generate the current matrix for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { matrix[i][j] = (k >> (i*8 + j)) & 1; } } if (is_unholy(matrix)) { count++; } } return count; } int main() { int num_unholy = count_unholy_matrices(); printf("Total number of unholy 8x8 matrices: %d\n", num_unholy); return 0; } |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #include <stdio.h> #include <stdlib.h> int is_unholy(int matrix[8][8]) { int i, j; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { if (matrix[i][j] == 1) { // Check if the 1 is isolated if ((i == 0 || matrix[i-1][j] == 0) && (i == 7 || matrix[i+1][j] == 0) && (j == 0 || matrix[i][j-1] == 0) && (j == 7 || matrix[i][j+1] == 0)) { return 0; // Isolated 1 found, not unholy } } } } return 1; // No isolated 1s, it's unholy } int count_unholy_matrices() { int count = 0; int matrix[8][8]; int i, j, k; for (k = 0; k < (1 << (8*8)); k++) { // Generate the current matrix for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { matrix[i][j] = (k >> (i*8 + j)) & 1; } } if (is_unholy(matrix)) { count++; } } return count; } int main() { int num_unholy = count_unholy_matrices(); printf("Total number of unholy 8x8 matrices: %d\n", num_unholy); return 0; } |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #include <stdio.h> #include <stdlib.h> int is_unholy(int matrix[8][8]) { int i, j; for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { if (matrix[i][j] == 1) { // Check if the 1 is isolated if ((i == 0 || matrix[i-1][j] == 0) && (i == 7 || matrix[i+1][j] == 0) && (j == 0 || matrix[i][j-1] == 0) && (j == 7 || matrix[i][j+1] == 0)) { return 0; // Isolated 1 found, not unholy } } } } return 1; // No isolated 1s, it's unholy } int count_unholy_matrices() { int count = 0; int matrix[8][8]; int i, j, k; for (k = 0; k < (1 << (8*8)); k++) { // Generate the current matrix for (i = 0; i < 8; i++) { for (j = 0; j < 8; j++) { matrix[i][j] = (k >> (i*8 + j)) & 1; } } if (is_unholy(matrix)) { count++; } } return count; } int main() { int num_unholy = count_unholy_matrices(); printf("Total number of unholy 8x8 matrices: %d\n", num_unholy); return 0; } |
Total number of unholy 8x8 matrices: 0
main.c: In function 'count_unholy_matrices':
main.c:28:24: warning: left shift count >= width of type [-Wshift-count-overflow]
28 | for (k = 0; k < (1 << (8*8)); k++) {
| ^~
Testing if the previous output contains the string 1121231537486377866
: False