这题使用了0点算法喵,简单的语法题嗷,学过二维数组的语法就能做了
开三个二维数组表示三种平面的情况
输入完以后就给对应的数组打上标记
记得yz平面和yx平面,要把标记的y坐标沿水平线对称一下,这样才是题目要求的输出,就是说本来如果是i现在变成y - i + 1
代码如下:
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define debug(x) cerr << #x << ": " << x << '\n';
// #define int long long
#define ctz __builtin_ctzll // 返回二进制表示中末尾连续0的个数
#define clz __builtin_clzll // 返回二进驻表示中先导0的个数
#define count1 __builtin_popcountll // 返回二进制表示中1的个数
// 上面仨不是ll的时候记得调整
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 lll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int hash_base = 881;
const int N = 1e8 + 10;
const double EPS = 1e-8;
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 0x3f3f3f3f3f3f3f3f;
ll dir[4][2] = {{1, 0}, {-1, 0}, {0, -1}, {0, 1}};
ll dirr[8][2] = {{1, 0}, {-1, 0}, {0, -1}, {0, 1}, {1, 1}, {1, -1}, {-1, -1}, {-1, 1}};
void LiangBaiKai()
{
}
void Aiden()
{
ll m, n, k, sum = 0, ans = 0, num = 0, mi = INF, ma = -INF, cnt = 0, x, y, z, len, t, l, r, cur;
string s1, s2;
cin >> x >> y >> z >> n;
vector yx(y + 1, vector<ll>(x + 1)), yz(y + 1, vector<ll>(z + 1)), zx(z + 1, vector<ll>(x + 1));
for (ll i = 1; i <= n;i++)
{
ll a, b, c;
cin >> a >> b >> c;
yx[b][a] = 1;
yz[b][c] = 1;
zx[c][a] = 1;
}
for (ll i = 1; i <= y;i++)
{
for (ll j = 1; j <= x;j++)
cout << (yx[y - i + 1][j] ? 'x' : '.');
cout << ' ';
for (ll j = 1; j <= z;j++)
cout << (yz[y - i + 1][j] ? 'x' : '.');
cout << endl;
}
cout << endl;
for (ll i = 1; i <= z; i++)
{
for (ll j = 1; j <= x; j++)
cout << (zx[i][j] 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