QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#184923#5610. It's About Timeucup-team004AC ✓1ms3696kbC++20863b2023-09-21 14:18:212023-09-21 14:18:22

Judging History

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

  • [2023-09-21 14:18:22]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3696kb
  • [2023-09-21 14:18:21]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;
using real = double;

constexpr real Pi = std::acos(-1);

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int r, s, h;
    std::cin >> r >> s >> h;
    
    real days = 2 * r * Pi / s / h;
    real diff = std::abs(days - std::floor(days + 0.5));
    
    int n1 = 0, n2 = 0, n3 = 0;
    real res = 1E18;
    for (int x = 1; x <= 1000; x++) {
        for (int y = 2 * x; y <= 1000; y += x) {
            for (int z = 2 * y; z <= 1000; z += y) {
                real v = std::abs(diff - 1.0 / x + 1.0 / y - 1.0 / z);
                if (v < res) {
                    res = v;
                    n1 = x, n2 = y, n3 = z;
                }
            }
        }
    }
    std::cout << n1 << " " << n2 << " " << n3 << "\n";
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3536kb

input:

92998938 66660 24

output:

4 100 400

result:

ok Output is valid!

Test #2:

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

input:

92998938 66660 25

output:

2 6 30

result:

ok Output is valid!

Test #3:

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

input:

1 1 1

output:

3 15 60

result:

ok Output is valid!

Test #4:

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

input:

1000000000 1000000 1000

output:

3 15 60

result:

ok Output is valid!

Test #5:

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

input:

1000000000 1 1

output:

5 45 540

result:

ok Output is valid!

Test #6:

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

input:

26373099 693335 239

output:

250 500 1000

result:

ok Output is valid!

Test #7:

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

input:

116691234 213569 246

output:

20 120 360

result:

ok Output is valid!

Test #8:

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

input:

50800597 848015 782

output:

2 50 750

result:

ok Output is valid!

Test #9:

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

input:

735896038 135114 659

output:

12 72 648

result:

ok Output is valid!

Test #10:

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

input:

366800924 611543 109

output:

2 12 120

result:

ok Output is valid!

Test #11:

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

input:

522294156 301860 432

output:

6 432 864

result:

ok Output is valid!

Test #12:

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

input:

408459747 702290 86

output:

2 114 684

result:

ok Output is valid!

Test #13:

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

input:

483269997 328697 800

output:

2 20 380

result:

ok Output is valid!

Test #14:

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

input:

10037736 216006 317

output:

12 180 900

result:

ok Output is valid!

Test #15:

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

input:

335021997 211213 76

output:

5 15 570

result:

ok Output is valid!

Test #16:

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

input:

628059082 935104 991

output:

2 4 120

result:

ok Output is valid!