QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#184921#5610. It's About Timeucup-team004WA 0ms3664kbC++20855b2023-09-21 14:17:262023-09-21 14:17:26

Judging History

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

  • [2023-09-21 14:17:26]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3664kb
  • [2023-09-21 14:17:26]
  • 提交

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 - int(days + 0.5));
    
    int n1 = 0, n2 = 0, n3 = 0;
    real res = 1E9;
    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: 3544kb

input:

92998938 66660 24

output:

4 100 400

result:

ok Output is valid!

Test #2:

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

input:

92998938 66660 25

output:

2 6 30

result:

ok Output is valid!

Test #3:

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

input:

1 1 1

output:

3 15 60

result:

ok Output is valid!

Test #4:

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

input:

1000000000 1000000 1000

output:

3 15 60

result:

ok Output is valid!

Test #5:

score: -100
Wrong Answer
time: 0ms
memory: 3632kb

input:

1000000000 1 1

output:

0 0 0

result:

wrong answer Integer parameter [name=n1] equals to 0, violates the range [1, 1000]