为数不多,靠打表过的
这题有个特殊点就是4,剩4个的时候有特殊移动,其他的就是找规律
// Problem: P1990 覆盖墙壁
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P1990
// Memory Limit: 125 MB
// Time Limit: 1000 ms
// Date: 2024-03-25 17:56:53
//
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
#define endl '\n'
#define int int64_t
#define ld long double
using namespace std;
int dx[] = { -1,0,1,0 };
int dy[] = { 0,1,0,-1 };
const int NC = 2e3 + 10;
char ches[NC][NC];
const int mod = 1e4;
const int N = 1e6 + 10;
int a[N], b[N], n, m;
int f[N], k[N];
string s;
void move() {
int pos = s.find('-');
if (pos == 8) {
// cout << "oooo****--";
// for (int i = pos / 2; i < n; ++i)
// cout << "o*";
// cout << endl;
cout << "ooo--***";
for (int i = pos / 2; i <= n; ++i)
cout << "o*";
cout << endl;
cout << "ooo*o**--*";
for (int i = pos / 2; i < n; ++i)
cout << "o*";
cout << endl;
cout << "o--*o**o";
for (int i = pos / 2; i <= n; ++i)
cout << "o*";
cout << endl;
cout << "o*o*o*--";
for (int i = pos / 2; i <= n; ++i)
cout << "o*";
cout << endl;
cout << "--";
for (int i = 1; i <= n; ++i)
cout << "o*";
cout << endl;
return;
}
else {
string t = "", ts = "";
for (int i = 1; i <= pos / 2 - 1; ++i)
t += 'o', ts += 'o';
t += '-';
t += '-';
for (int i = 1; i <= pos / 2 - 1; ++i)
t += '*', ts += '*';
ts += '-';
ts += '-';
for (int i = pos / 2; i <= n; ++i)
t += "o*", ts += "o*";
cout << t << endl;
cout << ts << endl;
s = ts;
}
move();
}
void solve() {
cin >> n;
for (int i = 1; i <= n; ++i)
s += 'o';
for (int i = 1; i <= n; ++i)
s += '*';
s += '-'; s += '-';
cout << s << endl;
move();
}
signed main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int t = 1;
//cin >> t;
while (t--) {
solve();
}
return 0;
}