QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#196840 | #5610. It's About Time | KKT89 | AC ✓ | 0ms | 3808kb | C++17 | 1.1kb | 2023-10-02 00:33:23 | 2023-10-02 00:33:23 |
Judging History
answer
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
return (ull)rng() % B;
}
inline double time() {
return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int r,s,h; cin >> r >> s >> h;
double day = 2 * r * acos(-1) / s / h;
double fl = floor(day+0.5);
int n1 = 0, n2 = 0, n3 = 0;
double mi = 1e18;
for (int i = 1; i <= 1000; ++i) {
for (int j = i+i; j <= 1000; j += i) {
for (int k = j+j; k <= 1000; k += j) {
double c = 1.0 / i - 1.0 / j + 1.0 / k;
if (abs(abs(day-fl)-c) < mi) {
mi = abs(abs(day-fl)-c);
n1 = i, n2 = j, n3 = k;
}
}
}
}
cout << n1 << " " << n2 << ' ' << n3 << endl;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3736kb
input:
92998938 66660 24
output:
4 100 400
result:
ok Output is valid!
Test #2:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
92998938 66660 25
output:
2 6 30
result:
ok Output is valid!
Test #3:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1 1 1
output:
3 15 60
result:
ok Output is valid!
Test #4:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
1000000000 1000000 1000
output:
3 15 60
result:
ok Output is valid!
Test #5:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
1000000000 1 1
output:
5 45 540
result:
ok Output is valid!
Test #6:
score: 0
Accepted
time: 0ms
memory: 3736kb
input:
26373099 693335 239
output:
250 500 1000
result:
ok Output is valid!
Test #7:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
116691234 213569 246
output:
20 120 360
result:
ok Output is valid!
Test #8:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
50800597 848015 782
output:
2 50 750
result:
ok Output is valid!
Test #9:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
735896038 135114 659
output:
12 72 648
result:
ok Output is valid!
Test #10:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
366800924 611543 109
output:
2 12 120
result:
ok Output is valid!
Test #11:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
522294156 301860 432
output:
6 432 864
result:
ok Output is valid!
Test #12:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
408459747 702290 86
output:
2 114 684
result:
ok Output is valid!
Test #13:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
483269997 328697 800
output:
2 20 380
result:
ok Output is valid!
Test #14:
score: 0
Accepted
time: 0ms
memory: 3664kb
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: 3672kb
input:
628059082 935104 991
output:
2 4 120
result:
ok Output is valid!