#include<bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
char arr[210];
int space,n;
void print1()
{
for(int i = 1; i<= n*2+2; i++)
{
cout << arr[i];
}
cout << endl;
}
void move(int n){
for(int i = 0; i<= 1; i++)
{
arr[space+i] = arr[n+i];
arr[n+i] = '-';
}
space = n;
print1();
}
void search(int k)
{
if(k == 4)
{
move(4);move(8);move(2);move(7);move(1);
}else
{
move(k);move(2*k-1);search(k-1);
}
}
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
cin >> n;
for(int i = 1; i <= n; i++)
{
arr[i] = 'o';
}
for(int i = n+1; i <= 2*n; i++)
{
arr[i] = '*';
}
for(int i = 2*n+1; i <= 2*n+2; i++)
{
arr[i] = '-';
}
space = 2*n+1;
print1();
search(n);
return 0;
}
P1259 黑白棋子的移动
最新推荐文章于 2024-11-07 15:40:17 发布