QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#167057#7073. Absolute Spaceucup-team004AC ✓1ms4028kbC++202.7kb2023-09-07 00:41:232023-09-07 00:41:24

Judging History

你现在查看的是最新测评结果

  • [2023-09-07 00:41:24]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:4028kb
  • [2023-09-07 00:41:23]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

using Point = std::array<double, 3>;
std::vector<Point> a[11] {
    {},
    {{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.000000000, 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}}
};

std::mt19937 rng;
std::vector<Point> conv(const std::vector<Point> &a, std::vector<Point> b) {
    const double Pi = std::acos(-1.0);
    double x = Pi * rng() / rng.max();
    double y = Pi * rng() / rng.max();
    double z = Pi * rng() / rng.max();
    std::vector<Point> c;
    for (auto &p : b) {
        double u = p[1], v = p[2];
        p[1] = u * std::cos(x) - v * std::sin(x);
        p[2] = u * std::sin(x) + v * std::cos(x);
        u = p[2], v = p[0];
        p[2] = u * std::cos(y) - v * std::sin(y);
        p[0] = u * std::sin(y) + v * std::cos(y);
        u = p[0], v = p[1];
        p[0] = u * std::cos(z) - v * std::sin(z);
        p[1] = u * std::sin(z) + v * std::cos(z);
    }
    for (auto p : a) {
        for (auto q : b) {
            c.push_back({p[0] + q[0], p[1] + q[1], p[2] + q[2]});
        }
    }
    return c;
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    a[6] = conv(a[3], a[3]);
    a[7] = conv(a[3], a[4]);
    a[8] = conv(a[4], a[4]);
    a[9] = conv(a[4], a[5]);
    a[10] = conv(a[4], a[6]);
    
    int n;
    std::cin >> n;
    
    std::cout << a[n].size() << "\n";
    std::cout << std::fixed << std::setprecision(10);
    for (auto [x, y, z] : a[n]) {
        std::cout << 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: 4028kb

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: 1ms
memory: 3856kb

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: 3836kb

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: 4020kb

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: 1ms
memory: 4024kb

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: 1ms
memory: 3852kb

input:

6

output:

16
-0.1089176503 -0.0175296624 -0.2910073571
0.7622684360 -0.2831707199 0.1218723248
0.6865859043 0.5829566489 -0.3721879313
0.6600633101 -0.2822562666 -0.8728906003
-1.1089176503 -0.0175296624 -0.2910073571
-0.2377315640 -0.2831707199 0.1218723248
-0.3134140957 0.5829566489 -0.3721879313
-0.3399366...

result:

ok required_n=6, sz=16

Test #7:

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

input:

7

output:

24
-0.1484658119 0.0636260637 -0.6282237654
1.1484658119 -0.0636260637 -0.0788830166
0.4245473449 0.6245774622 -0.0307378240
0.5754526551 -0.6245774622 -0.6763689580
0.7716596904 0.3253532196 -0.9195448175
0.2283403096 -0.3253532196 0.2124380355
-1.1484658119 0.0636260637 -0.6282237654
0.1484658119 ...

result:

ok required_n=7, sz=24

Test #8:

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

input:

8

output:

36
0.4876191555 0.4970654211 -0.4524943636
0.9265944065 -0.4970654211 0.4524943636
1.2810232632 0.3863787398 0.1460525266
0.1331902988 -0.3863787398 -0.1460525266
1.0570282770 -0.3219276879 -0.5233712928
0.3571852850 0.3219276879 0.5233712928
-0.9265944065 0.4970654211 -0.4524943636
-0.4876191555 -0...

result:

ok required_n=8, sz=36

Test #9:

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

input:

9

output:

72
1.0471612524 0.3163287028 0.8299443384
1.6445038606 0.1543234079 0.0444915437
-0.2302902986 -0.1543234079 -0.0444915437
0.3670523096 -0.3163287028 -0.8299443384
0.1533869469 0.6025371172 0.4846151714
1.1199075896 0.3404070439 -0.7862741465
0.2943059724 -0.3404070439 0.7862741465
1.2608266151 -0.6...

result:

ok required_n=9, sz=72

Test #10:

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

input:

10

output:

96
0.5269326127 -0.2309114570 -0.1052273424
0.8977507352 0.5893253955 -0.5407792059
-0.0458306490 0.5821224858 -0.2097168393
0.2065560102 0.0417807122 -1.0124196124
0.6487250149 -1.0518532990 0.4526445988
1.0195431374 -0.2316164465 0.0170927354
0.0759617531 -0.2388193562 0.3481551019
0.3283484124 -0...

result:

ok required_n=10, sz=96