很好模拟题, 注意到真实三维坐标与数组的是反过来的, 也就是真实的越大, 越在上面, 但是数组的是
越大, 越在下面, 因此需要将
反置, 俯视图的情况和数组相同
#include <bits/stdc++.h>
#define x first
#define y second
#define all(x) x.begin(), x.end()
using namespace std;
using i128 = __int128;
using u128 = unsigned __int128;
using LL = long long;
using LD = long double;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
using PLD = pair<LD, LD>;
const int N = 1e5 + 10, MOD = 998244353;
const int INF = 1e9;
const LL LL_INF = 1e18;
const LD EPS = 1e-8;
const int dx4[] = {-1, 0, 1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {-1, -1, -1, 0, 0, 1, 1, 1}, dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};
istream &operator>>(istream &is, i128 &val) {
string str;
is >> str;
val = 0;
bool flag = false;
if (str[0] == '-') flag = true, str = str.substr(1);
for (char &c: str) val = val * 10 + c - '0';
if (flag) val = -val;
return is;
}
ostream &operator<<(ostream &os, i128 val) {
if (val < 0) os << "-", val = -val;
if (val > 9) os << val / 10;
os << static_cast<char>(val % 10 + '0');
return os;
}
struct Hash {
vector<int> h, p;
int B = 131;
Hash (const string &s) {
int n = s.size();
h.resize(n + 1, 0);
p.resize(n + 1, 1);
for (int i = 0; i < n; ++i) {
p[i + 1] = p[i] * B % MOD;
h[i + 1] = (h[i] * B + s[i]) % MOD;
}
}
LL get_hash(int l, int r) {
LL v = h[r] - h[l - 1] * p[r - l + 1] % MOD;
v = (v % MOD + MOD) % MOD;
return v;
}
};
bool cmp(LD a, LD b) {
if (fabs(a - b) < EPS) return 1;
return 0;
}
void solve() {
int x, y, z, n;
cin >> x >> y >> z >> n;
vector<vector<int>> yx(y + 1, vector<int>(x + 1)), yz(y + 1, vector<int>(z + 1)), zx(z + 1, vector<int>(x + 1));
for (int i = 0; i < n; ++i) {
int a, b, c;
cin >> a >> b >> c;
yx[b][a] = 1;
yz[b][c] = 1;
zx[c][a] = 1;
}
// 这里需要将y反置
for (int i = 1; i <= y; ++i) {
for (int j = 1; j <= x; ++j) {
cout << (yx[y - i + 1][j] ? 'x' : '.');
}
cout << ' ';
for (int j = 1; j <= z; ++j) {
cout << (yz[y - i + 1][j] ? 'x' : '.');
}
cout << '\n';
}
cout << '\n';
for (int i = 1; i <= z; ++i) {
for (int j = 1; j <= x; ++j) {
cout << (zx[i][j] ? 'x' : '.');
}
cout << '\n';
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int T = 1;
while (T--) solve();
cout << fixed << setprecision(15);
return 0;
}

京公网安备 11010502036488号