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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
#include <iostream>
using namespace std;
#include <iomanip>
#include <vector>
#include <ctime>
#include <algorithm>
int check(int n, vector<int> &a);
int move(int arr[10][10], vector<int> b, int current, int i, int j, int count);
void restart(int arr[10][10], vector<int> b);
int equal(vector<int> a, vector<int> b);
int equal(vector<int> a, vector<int> b)
{
if (a == b)
{
return 1;
}
else
return 0;
}
void restart(int arr[10][10], vector<int> b)
{
b.clear();
b.push_back(-1);
b.push_back(0);
int current = 1;
int i = 1, j = 1;
int count = 0;
move(arr, b, current, i, j, count);
}
int move(int arr[10][10], vector<int> b, int current, int i, int j, int count)
{
}
int checkfill(int n, vector<int> &a)
{
auto it = find(a.begin(), a.end(), n);
if (it != a.end())
{
return 0;
}
else
{
a.push_back(n);
return 1;
}
}
int main()
{
vector<int> a{-1, 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};
vector<int> b{-1};
int arr[10][10] = {{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
{-1, 1, 16, 5, 20, 25, 9, 21, 1, -1},
{-1, 18, 12, 27, 26, 11, 17, 12, 32, -1},
{-1, 32, 11, 15, 29, 8, 6, 27, 20, -1},
{-1, 17, 4, 13, 24, 30, 28, 31, 2, -1},
{-1, 25, 10, 2, 26, 4, 28, 22, 13, -1},
{-1, 5, 14, 30, 8, 15, 31, 19, 6, -1},
{-1, 23, 7, 24, 16, 29, 22, 18, 19, -1},
{-1, 3, 12, 9, 3, 7, 14, 23, 33, -1},
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}};
int k;
for (int i = 0; i < 10; i++)
{
cout << endl;
for (int j = 0; j < 10; j++)
{
cout << setw(3) << arr[i][j];
}
}
cout << endl;
restart(arr, b);
return 0;
}
|