QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#325273 | #5610. It's About Time | weilaifuture# | WA | 0ms | 3760kb | C++14 | 923b | 2024-02-11 06:59:40 | 2024-02-11 06:59:40 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
long double r,s,h,sn;
long double d;
long double pi = 3.14159265359;
long long ans1,ans2,ans3;
long double ans;
int main(){
cin>>r>>s>>h;
long double tmp = pi*r*2.0/s/h; if(tmp-floor(tmp)>=0.5) sn = -1, d =ceil(tmp); else sn = 1, d= floor(tmp);
ans = 1e10;
for(long long i=2;i<=1000;i++){
for(long long j=2;j*i<=1000;j++){
for(long long k=2;k*j*i<=1000;k++){
long long n1=i; long long n2=j*i; long long n3=k*j*i;
long double ac = pi * r * 2.0 * n3;
long double ep = d*s*h*n3 + sn*s*h*k*j - sn*s*h*k + sn*s*h;
//cout<<n1<<" "<<n2<<" "<<n3<<" "<<ac<<" "<<ep<<" "<<ans<<" "<<abs(ac-ep)<<endl;
if(abs(ac-ep)<ans) ans=abs(ac-ep),ans1=n1,ans2=n2,ans3=n3;
}
}
}
cout<<ans1<<" "<<ans2<<" "<<ans3<<endl;
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3636kb
input:
92998938 66660 24
output:
4 100 400
result:
ok Output is valid!
Test #2:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
92998938 66660 25
output:
2 6 30
result:
ok Output is valid!
Test #3:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
1 1 1
output:
3 15 60
result:
ok Output is valid!
Test #4:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
1000000000 1000000 1000
output:
3 15 60
result:
ok Output is valid!
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3760kb
input:
1000000000 1 1
output:
5 25 50
result:
wrong answer Fractions are not equal