QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#94695 | #5610. It's About Time | PetroTarnavskyi# | AC ✓ | 3ms | 3788kb | C++17 | 1018b | 2023-04-07 15:33:24 | 2023-04-07 15:33:28 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
const double pi = acos(-1);
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
LL r, s, h;
cin >> r >> s >> h;
LL d = 2 * pi * r / (s * h) + 0.5;
long double v = abs(2 * pi * r / (s * h) - d);
vector<pair<double, VI>> ans;
FOR(a, 2, 1000)
{
FOR(b, 2, 1000/a + 1)
{
FOR(c, 2, 1000 / (a * b) + 1)
{
if (a * b * c > 1000) continue;
long double x = (b * c - c + 1) / double(a * b * c);
ans.PB({abs(x - v), {a, b, c}});
}
}
}
sort(ALL(ans));
int n = 1;
FOR(i, 0, 3)
{
n *= ans[0].second[i];
if (i) cout << ' ';
cout << n;
}
cout << '\n';
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3688kb
input:
92998938 66660 24
output:
4 100 400
result:
ok Output is valid!
Test #2:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
92998938 66660 25
output:
2 6 30
result:
ok Output is valid!
Test #3:
score: 0
Accepted
time: 3ms
memory: 3760kb
input:
1 1 1
output:
3 15 60
result:
ok Output is valid!
Test #4:
score: 0
Accepted
time: 3ms
memory: 3788kb
input:
1000000000 1000000 1000
output:
3 15 60
result:
ok Output is valid!
Test #5:
score: 0
Accepted
time: 2ms
memory: 3740kb
input:
1000000000 1 1
output:
5 45 540
result:
ok Output is valid!
Test #6:
score: 0
Accepted
time: 2ms
memory: 3724kb
input:
26373099 693335 239
output:
250 500 1000
result:
ok Output is valid!
Test #7:
score: 0
Accepted
time: 3ms
memory: 3788kb
input:
116691234 213569 246
output:
12 24 360
result:
ok Output is valid!
Test #8:
score: 0
Accepted
time: 1ms
memory: 3716kb
input:
50800597 848015 782
output:
2 50 750
result:
ok Output is valid!
Test #9:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
735896038 135114 659
output:
12 72 648
result:
ok Output is valid!
Test #10:
score: 0
Accepted
time: 3ms
memory: 3772kb
input:
366800924 611543 109
output:
2 10 40
result:
ok Output is valid!
Test #11:
score: 0
Accepted
time: 3ms
memory: 3788kb
input:
522294156 301860 432
output:
6 432 864
result:
ok Output is valid!
Test #12:
score: 0
Accepted
time: 1ms
memory: 3740kb
input:
408459747 702290 86
output:
2 114 684
result:
ok Output is valid!
Test #13:
score: 0
Accepted
time: 3ms
memory: 3672kb
input:
483269997 328697 800
output:
2 20 380
result:
ok Output is valid!
Test #14:
score: 0
Accepted
time: 3ms
memory: 3644kb
input:
10037736 216006 317
output:
12 180 900
result:
ok Output is valid!
Test #15:
score: 0
Accepted
time: 2ms
memory: 3708kb
input:
335021997 211213 76
output:
5 15 570
result:
ok Output is valid!
Test #16:
score: 0
Accepted
time: 1ms
memory: 3780kb
input:
628059082 935104 991
output:
2 4 120
result:
ok Output is valid!