QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#325166#5610. It's About TimeYuukiS#AC ✓0ms3676kbC++20914b2024-02-11 05:23:442024-02-11 05:23:44

Judging History

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

  • [2024-02-11 05:23:44]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3676kb
  • [2024-02-11 05:23:44]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;

void solve() {
    int r, s, h; cin >> r >> s >> h;
    long double d = M_PI * r * 2 / s / h;
    d = fabs(d - round(d));
    long double best = 1e9;
    int a = 0;
    int b = 0;
    int c = 0;
    for(int i = 2; i <= 250; i++) {
        for(int j = 2 * i; j <= 500; j += i) {
            for(int k = 2 * j; k <= 1000; k += j) {
                long double frac = 1.0 / i - 1.0 / j + 1.0 / k;
                if(fabs(frac - d) <= best) {
                    best = fabs(frac - d);
                    a = i;
                    b = j;
                    c = k;
                }
            }
        }
    }
    cout << a << " " << b << " " << c << "\n";
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int T = 1;
    // cin >> T;
    while(T--) {
        solve();
    }
    return 0;
}

詳細信息

Test #1:

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

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

input:

1 1 1

output:

3 18 180

result:

ok Output is valid!

Test #4:

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

input:

1000000000 1000000 1000

output:

3 18 180

result:

ok Output is valid!

Test #5:

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

input:

1000000000 1 1

output:

5 45 540

result:

ok Output is valid!

Test #6:

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

input:

26373099 693335 239

output:

250 500 1000

result:

ok Output is valid!

Test #7:

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

input:

116691234 213569 246

output:

21 210 630

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

input:

735896038 135114 659

output:

12 72 648

result:

ok Output is valid!

Test #10:

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

input:

366800924 611543 109

output:

2 12 120

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

input:

408459747 702290 86

output:

2 114 684

result:

ok Output is valid!

Test #13:

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

input:

483269997 328697 800

output:

2 20 380

result:

ok Output is valid!

Test #14:

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

input:

10037736 216006 317

output:

12 180 900

result:

ok Output is valid!

Test #15:

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

input:

335021997 211213 76

output:

5 15 570

result:

ok Output is valid!

Test #16:

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

input:

628059082 935104 991

output:

3 12 120

result:

ok Output is valid!