E求条
  • 板块学术版
  • 楼主suyulong1212
  • 当前回复6
  • 已保存回复6
  • 发布时间2024/3/2 21:50
  • 上次更新2024/3/3 09:26:08
查看原帖
E求条
275790
suyulong1212楼主2024/3/2 21:50

纯暴力挂了两个点/kk

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(a) memset(a, 0, sizeof(a))
#define dbg(x) cout << #x << " = " << x << "\n"
#define rep(i, l, r) for (auto i = (l); i <= (r); i++)
#define per(i, l, r) for (auto i = (l); i >= (r); i--)
inline void YON(bool x) { cout << ((x) ? "Yes\n" : "No\n"); }
array<int, 6> mer(array<int, 6> A, array<int, 6> B)
{
    return {max(A[0], B[0]), max(A[1], B[1]), max(A[2], B[2]), min(A[3], B[3]), min(A[4], B[4]), min(A[5], B[5])};
}
int get(array<int, 6> s)
{
    if (s[3] < s[0] || s[4] < s[1] || s[5] < s[2])
        return 0;
    return (s[3] - s[0]) * (s[4] - s[1]) * (s[5] - s[2]);
}
int got(array<int, 6> A, array<int, 6> B)
{
    return get(mer(A, B));
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int V1, V2, V3;
    cin >> V1 >> V2 >> V3;
    if (V1 + 2 * V2 + 3 * V3 != 3 * 7 * 7 * 7)
    {
        cout << "No";
        return 0;
    }
    cout << "Yes\n";
    cout << "0 0 0 ";
    rep(a, 0, 7) rep(b, 0, 7) rep(c, 0, 7) rep(d, 0, 7) rep(e, 0, 7) rep(f, 0, 7)
    {
        if (got({0, 0, 0, 7, 7, 7}, {a, b, c, a + 7, b + 7, c + 7}) + got({0, 0, 0, 7, 7, 7}, {d, e, f, d + 7, e + 7, f + 7}) + got({a, b, c, a + 7, b + 7, c + 7}, {d, e, f, d + 7, e + 7, f + 7}) - 3 * V3 == V2 && V3 == get(mer(mer({0, 0, 0, 7, 7, 7}, {a, b, c, a + 7, b + 7, c + 7}), {d, e, f, d + 7, e + 7, f + 7})))
        {
            cout << a << " " << b << " " << c << " " << d << " " << e << " " << f;
            return 0;
        }
    }
    return 0;
}
2024/3/2 21:50
加载中...