#include #include using namespace std; int n; int m; int* result; void message(int** matrix, int from, int to, int turing){ if (turing > 0) matrix[from][to] = 2; else matrix[from][to] = 1; } void zeros(int** matrix){ for (int i=0; i 0){ int* temp = matrix[i]; matrix[i] = NULL; if (findShip(matrix, col+1) > 0){ result[i] = col; return 1; } matrix[i] = temp; } } return 0; } void alternativeMatching(int** matrix){ char * res = (char*) malloc(7*m * sizeof(char)); ofstream fout("output.txt"); for (int i=0; i 0){ for (int k=0; k> n; fin >> m; int** matrix = construct_matrix(n, n); result = (int*) malloc(m * sizeof(int)); zeros(matrix); int from, to; for (int k=0; k> from; fin >> to; if (k