QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#948638#7073. Absolute SpacewzhqwqAC ✓1ms4096kbC++232.7kb2025-03-23 11:48:352025-03-23 11:48:36

Judging History

This is the latest submission verdict.

  • [2025-03-23 11:48:36]
  • Judged
  • Verdict: AC
  • Time: 1ms
  • Memory: 4096kb
  • [2025-03-23 11:48:35]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
const double P = acos(-1.0);
int n;
vector < array < double, 3 > > g[105] {
{}, 
{
{0.000000000, 0.000000000, 0.000000000}, {1.000000000, 0.000000000, 0.000000000}
}, 
{
{0.000000000, 0.000000000, 0.000000000}, {1.000000000, 0.000000000, 0.000000000}, {0.500000000, 0.866025404, 0.000000000}
}, 
{
{0.500000000, 0.000000000, -0.353553391}, {-0.500000000, 0.000000000, -0.353553391}, {0.000000000, 0.500000000, 0.353553391}, {0.000000000, -0.500000000, 0.353553391
}
}, 
{
{0.707106781, 0.00000000, 0.000000000}, {-0.707106781, 0.000000000, 0.000000000}, {0.000000000, 0.707106781, 0.000000000}, {0.000000000, -0.707106781, 0.000000000}, {0.000000000, 0.000000000, 0.707106781}, {0.000000000, 0.000000000, -0.707106781}
}, 
{
{0.000000000, 0.500000000, 0.809016994}, {0.000000000, -0.500000000, 0.809016994}, {0.000000000, 0.500000000, -0.809016994}, {0.000000000, -0.500000000, -0.809016994}, {0.500000000, 0.809016994, 0.000000000}, {0.500000000, -0.809016994, 0.000000000}, {-0.500000000, 0.809016994, 0.000000000}, {-0.500000000, -0.809016994, 0.000000000}, {0.809016994, 0.000000000, 0.500000000}, {0.809016994, 0.000000000, -0.500000000}, {-0.809016994, 0.000000000, 0.500000000}, {-0.809016994, 0.000000000, -0.500000000}
}
};
inline void roto (int i, int p, int q, double x, vector < array < double, 3 > > &u)
{
	double o = u[i][p], r = u[i][q];
	u[i][p] = cos(x) * o - sin(x) * r;
	u[i][q] = sin(x) * o + cos(x) * r;
}
inline void rot (double x, double y, double z, vector < array < double, 3 > > &u)
{
	for (int i = 0; i < u.size(); i = -~i)
	{
		roto(i, 1, 2, x, u); roto(i, 2, 0, y, u); roto (i, 0, 1, z, u);
	}
	return void();
}
inline vector < array < double, 3 > > solve(double x, double y, double z, vector < array < double, 3 > > &u, vector < array < double, 3 > > v)
{
	rot(1.0, 1.0, 1.0, v);
	vector < array < double, 3 > > s;
	for (auto d : u)
	{
		for (auto e : v){s.push_back({d[0] + e[0], d[1] + e[1], d[2] + e[2]});}
	}
	return s;
}
signed main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    mt19937 rng;
    cin >> n;
    for (register int i = 6;i <= 10; i = -~i)
    {
        if (i == 10){g[i] = solve(rng() * P / rng.max(), rng() * P / rng.max(), rng() * P / rng.max(), g[4], g[6]); break;}
    	if (i & 1) g[i] = solve(rng() * P / rng.max(), rng() * P / rng.max(), rng() * P / rng.max(), g[i / 2], g[i / 2 + 1]);
    	else g[i] = solve(rng() * P / rng.max(), rng() * P / rng.max(), rng() * P / rng.max(), g[i / 2], g[i / 2]);
	}
	cout << g[n].size() << "\n";
	for (auto [x, y, z] : g[n])
	{
		cout << fixed << setprecision(10) << x << " " << y << " " << z << "\n";
	}
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3968kb

input:

1

output:

2
0.0000000000 0.0000000000 0.0000000000
1.0000000000 0.0000000000 0.0000000000

result:

ok required_n=1, sz=2

Test #2:

score: 0
Accepted
time: 0ms
memory: 3968kb

input:

2

output:

3
0.0000000000 0.0000000000 0.0000000000
1.0000000000 0.0000000000 0.0000000000
0.5000000000 0.8660254040 0.0000000000

result:

ok required_n=2, sz=3

Test #3:

score: 0
Accepted
time: 0ms
memory: 3968kb

input:

3

output:

4
0.5000000000 0.0000000000 -0.3535533910
-0.5000000000 0.0000000000 -0.3535533910
0.0000000000 0.5000000000 0.3535533910
0.0000000000 -0.5000000000 0.3535533910

result:

ok required_n=3, sz=4

Test #4:

score: 0
Accepted
time: 1ms
memory: 4096kb

input:

4

output:

6
0.7071067810 0.0000000000 0.0000000000
-0.7071067810 0.0000000000 0.0000000000
0.0000000000 0.7071067810 0.0000000000
0.0000000000 -0.7071067810 0.0000000000
0.0000000000 0.0000000000 0.7071067810
0.0000000000 0.0000000000 -0.7071067810

result:

ok required_n=4, sz=6

Test #5:

score: 0
Accepted
time: 0ms
memory: 4096kb

input:

5

output:

12
0.0000000000 0.5000000000 0.8090169940
0.0000000000 -0.5000000000 0.8090169940
0.0000000000 0.5000000000 -0.8090169940
0.0000000000 -0.5000000000 -0.8090169940
0.5000000000 0.8090169940 0.0000000000
0.5000000000 -0.8090169940 0.0000000000
-0.5000000000 0.8090169940 0.0000000000
-0.5000000000 -0.8...

result:

ok required_n=5, sz=12

Test #6:

score: 0
Accepted
time: 0ms
memory: 4096kb

input:

6

output:

16
0.3087719384 0.2528067219 -0.8775005163
0.0168453567 -0.2018419915 -0.0360295315
0.8011538461 0.4183925440 -0.0230174014
0.8732288589 -0.4693572743 -0.4776661148
-0.6912280616 0.2528067219 -0.8775005163
-0.9831546433 -0.2018419915 -0.0360295315
-0.1988461539 0.4183925440 -0.0230174014
-0.12677114...

result:

ok required_n=6, sz=16

Test #7:

score: 0
Accepted
time: 0ms
memory: 3968kb

input:

7

output:

24
0.7064232655 0.3214851882 -0.9485632304
0.2935767345 -0.3214851882 0.2414564484
0.4490352697 0.6277339164 -0.0320682028
0.5509647303 -0.6277339164 -0.6750385792
1.1743827040 -0.0509647303 -0.1471301255
-0.1743827040 0.0509647303 -0.5599766565
-0.2935767345 0.3214851882 -0.9485632304
-0.7064232655...

result:

ok required_n=7, sz=24

Test #8:

score: 0
Accepted
time: 1ms
memory: 4096kb

input:

8

output:

36
0.9135300465 0.3214851882 -0.5950098394
0.5006835155 -0.3214851882 0.5950098394
0.6561420507 0.6277339164 0.3214851882
0.7580715113 -0.6277339164 -0.3214851882
1.3814894850 -0.0509647303 0.2064232655
0.0327240770 0.0509647303 -0.2064232655
-0.5006835155 0.3214851882 -0.5950098394
-0.9135300465 -0...

result:

ok required_n=8, sz=36

Test #9:

score: 0
Accepted
time: 1ms
memory: 3968kb

input:

9

output:

72
1.4426459058 0.3855649990 0.4634979223
1.5147209186 -0.5021848194 0.0088492089
-0.1005073566 0.5021848194 -0.0088492089
-0.0284323438 -0.3855649990 -0.4634979223
0.7947601617 0.9455290461 -0.0529169570
0.9113799821 -0.4908803327 -0.7885540279
0.5028335799 0.4908803327 0.7885540279
0.6194534003 -0...

result:

ok required_n=9, sz=72

Test #10:

score: 0
Accepted
time: 0ms
memory: 3968kb

input:

10

output:

96
-0.0578663462 0.4280577469 -0.4010501024
0.6922100257 -0.1689296426 -0.1164600586
0.8888770538 0.7373304498 -0.4906454753
0.5402941442 0.0147683335 -1.0876328649
-0.3497929279 -0.0265909665 0.4404208824
0.4002834440 -0.6235783560 0.7250109262
0.5969504721 0.2826817364 0.3508255095
0.2483675625 -0...

result:

ok required_n=10, sz=96