QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#723096#5610. It's About TimeTheZoneAC ✓0ms3804kbC++20872b2024-11-07 21:10:022024-11-07 21:10:04

Judging History

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

  • [2024-11-07 21:10:04]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3804kb
  • [2024-11-07 21:10:02]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

const double PI = acos(-1);

double r, s, h;
double d;

int n1, n2, n3;

int main() {
    cin >> r >> s >> h;
    d = 2 * PI * r / s / h;

    double X = abs(d - floor(d + 0.5));

    double best = 1e18;
    for (double x = 1; x <= 1000; x += 1.0) {
        for (double y = x * 2; y <= 1000; y += x) {
            for (double z = y * 2; z <= 1000; z += y) {
                double diff = abs(X - (1 / x - 1 / y + 1 / z));
                if (diff < best) {
                    best = diff;
                    n1 = x;
                    n2 = y;
                    n3 = z;
                }
            }
        }
    }

    cout << n1 << ' ' << n2 << ' ' << n3 << '\n';
    return 0;
}




















































详细

Test #1:

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

input:

92998938 66660 24

output:

4 100 400

result:

ok Output is valid!

Test #2:

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

input:

92998938 66660 25

output:

2 6 30

result:

ok Output is valid!

Test #3:

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

input:

1 1 1

output:

3 15 60

result:

ok Output is valid!

Test #4:

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

input:

1000000000 1000000 1000

output:

3 15 60

result:

ok Output is valid!

Test #5:

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

input:

1000000000 1 1

output:

5 45 540

result:

ok Output is valid!

Test #6:

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

input:

26373099 693335 239

output:

250 500 1000

result:

ok Output is valid!

Test #7:

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

input:

116691234 213569 246

output:

15 30 90

result:

ok Output is valid!

Test #8:

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

input:

50800597 848015 782

output:

2 50 750

result:

ok Output is valid!

Test #9:

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

input:

735896038 135114 659

output:

12 72 648

result:

ok Output is valid!

Test #10:

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

input:

366800924 611543 109

output:

2 10 40

result:

ok Output is valid!

Test #11:

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

input:

522294156 301860 432

output:

6 432 864

result:

ok Output is valid!

Test #12:

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

input:

408459747 702290 86

output:

2 114 684

result:

ok Output is valid!

Test #13:

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

input:

483269997 328697 800

output:

2 20 380

result:

ok Output is valid!

Test #14:

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

input:

10037736 216006 317

output:

12 180 900

result:

ok Output is valid!

Test #15:

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

input:

335021997 211213 76

output:

5 15 570

result:

ok Output is valid!

Test #16:

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

input:

628059082 935104 991

output:

2 4 120

result:

ok Output is valid!