Submission #50823992
Source Code Expand
/**
* @the_hyp0cr1t3
* 02.03.2024 18:03
**/
#include <bits/stdc++.h>
auto isect(int l1, int r1, int l2, int r2) {
return std::max(0, std::min(r1, r2) - std::max(l1, l2));
}
auto isect(int l1, int r1, int l2, int r2, int l3, int r3) {
return std::max(0, std::min({r1, r2, r3}) - std::max({l1, l2, l3}));
}
constexpr int N = 14;
int main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
std::array<int, 3> V;
std::cin >> V[0] >> V[1] >> V[2];
int a1 = 0, b1 = 0, c1 = 0;
for (int a2 = -N; a2 <= N; a2++) {
for (int b2 = -N; b2 <= N; b2++) {
for (int c2 = -N; c2 <= N; c2++) {
for (int a3 = -N; a3 <= N; a3++) {
for (int b3 = -N; b3 <= N; b3++) {
for (int c3 = -N; c3 <= N; c3++) {
auto x3 = isect(a1, a1 + 7, a2, a2 + 7, a3, a3 + 7);
auto y3 = isect(b1, b1 + 7, b2, b2 + 7, b3, b3 + 7);
auto z3 = isect(c1, c1 + 7, c2, c2 + 7, c3, c3 + 7);
auto v3 = x3 * y3 * z3;
auto x12 = isect(a1, a1 + 7, a2, a2 + 7);
auto y12 = isect(b1, b1 + 7, b2, b2 + 7);
auto z12 = isect(c1, c1 + 7, c2, c2 + 7);
auto x23 = isect(a2, a2 + 7, a3, a3 + 7);
auto y23 = isect(b2, b2 + 7, b3, b3 + 7);
auto z23 = isect(c2, c2 + 7, c3, c3 + 7);
auto x13 = isect(a1, a1 + 7, a3, a3 + 7);
auto y13 = isect(b1, b1 + 7, b3, b3 + 7);
auto z13 = isect(c1, c1 + 7, c3, c3 + 7);
auto v2 = x12 * y12 * z12 + x23 * y23 * z23 + x13 * y13 * z13 - 3 * v3;
auto v1 = 1029 - 2 * v2 - 3 * v3;
if (V[2] == v3 and V[1] == v2 and V[0] == v1) {
std::cout << "Yes" << '\n';
std::cout << a1 << ' ' << b1 << ' ' << c1 << ' ';
std::cout << a2 << ' ' << b2 << ' ' << c2 << ' ';
std::cout << a3 << ' ' << b3 << ' ' << c3 << '\n';
return 0;
}
}
}
}
}
}
}
std::cout << "No" << '\n';
}
Submission Info
| Submission Time |
|
| Task |
E - 7x7x7 |
| User |
the_hyp0cr1t3 |
| Language |
C++ 20 (gcc 12.2) |
| Score |
475 |
| Code Size |
2547 Byte |
| Status |
AC |
| Exec Time |
1936 ms |
| Memory |
3632 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
475 / 475 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
00_sample_00.txt, 00_sample_01.txt |
| All |
00_sample_00.txt, 00_sample_01.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 02_random2_08.txt, 02_random2_09.txt, 03_killer_00.txt, 03_killer_01.txt, 04_killer2_00.txt, 04_killer2_01.txt, 05_handmade_00.txt, 05_handmade_01.txt, 05_handmade_02.txt, 05_handmade_03.txt, 05_handmade_04.txt, 05_handmade_05.txt, 05_handmade_06.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_00.txt |
AC |
365 ms |
3428 KiB |
| 00_sample_01.txt |
AC |
1261 ms |
3392 KiB |
| 01_random_00.txt |
AC |
1287 ms |
3512 KiB |
| 01_random_01.txt |
AC |
1278 ms |
3388 KiB |
| 01_random_02.txt |
AC |
1297 ms |
3628 KiB |
| 02_random2_00.txt |
AC |
501 ms |
3512 KiB |
| 02_random2_01.txt |
AC |
376 ms |
3408 KiB |
| 02_random2_02.txt |
AC |
404 ms |
3384 KiB |
| 02_random2_03.txt |
AC |
467 ms |
3512 KiB |
| 02_random2_04.txt |
AC |
463 ms |
3412 KiB |
| 02_random2_05.txt |
AC |
418 ms |
3452 KiB |
| 02_random2_06.txt |
AC |
371 ms |
3440 KiB |
| 02_random2_07.txt |
AC |
366 ms |
3412 KiB |
| 02_random2_08.txt |
AC |
376 ms |
3516 KiB |
| 02_random2_09.txt |
AC |
370 ms |
3524 KiB |
| 03_killer_00.txt |
AC |
1 ms |
3444 KiB |
| 03_killer_01.txt |
AC |
1 ms |
3412 KiB |
| 04_killer2_00.txt |
AC |
372 ms |
3512 KiB |
| 04_killer2_01.txt |
AC |
378 ms |
3532 KiB |
| 05_handmade_00.txt |
AC |
1304 ms |
3516 KiB |
| 05_handmade_01.txt |
AC |
1936 ms |
3416 KiB |
| 05_handmade_02.txt |
AC |
1 ms |
3452 KiB |
| 05_handmade_03.txt |
AC |
1 ms |
3440 KiB |
| 05_handmade_04.txt |
AC |
636 ms |
3388 KiB |
| 05_handmade_05.txt |
AC |
1 ms |
3408 KiB |
| 05_handmade_06.txt |
AC |
593 ms |
3632 KiB |