#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cstring>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
using namespace std;
#define ff first
#define sc second
#define pb push_back
#define ll long long
#define pll pair<ll, ll>
#define pii pair <int, int>
#define ull unsigned long long
// #define int long long
// #define int unsigned long long
const ll inf = 1e9 + 7;
const ll weirdMod = 998244353;
char arr[5][5];
// dir = 0, down
// dir = 1, right
int dfs(int x, int y, int dir) {
if (x > 4 || y > 4) return 1;
if (arr[x][y] == 'X') return dfs(x + 1, y, 0) + dfs(x, y + 1, 1);
if (dir == 0) return dfs(x + 1, y, 0);
return dfs(x, y + 1, 1);
}
void solve() {
ll n; cin >> n;
for (int i = 0; i < (1 << 16); i++) {
for (int j = 1; j <= 16; j++) {
if ((i >> (j - 1)) % 2 == 1) {
if (j % 4 == 0) arr[j / 4][4] = 'X';
else arr[j / 4 + 1][j % 4] = 'X';
} else {
if (j % 4 == 0) arr[j / 4][4] = '.';
else arr[j / 4 + 1][j % 4] = '.';
}
} if (arr[1][1] != 'X') continue;
if (dfs(1, 1, 0) == n) {
for (int j = 1; j <= 5; j++) {
for (int k = 1; k <= 5; k++) {
if (j == 5 && k == 5) cout << '.';
else if (j == 5) cout << 'r';
else if (k == 5) cout << 'd';
else cout << arr[j][k];
} cout << '\n';
} return;
}
}
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
int t = 1;
// cin >> t;
while (t--) {
solve();
cout << '\n';
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Expected integer, but "XX..d" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |