QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#184921 | #5610. It's About Time | ucup-team004 | WA | 0ms | 3664kb | C++20 | 855b | 2023-09-21 14:17:26 | 2023-09-21 14:17:26 |
Judging History
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;
}
詳細信息
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]