QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#325332 | #5610. It's About Time | weilaifuture# | WA | 0ms | 3780kb | C++14 | 918b | 2024-02-11 08:13:11 | 2024-02-11 08:13:12 |
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 /s/h;
long double ep = d*n3 + sn*k*j - sn*k + sn;
//cout<<n1<<" "<<n2<<" "<<n3<<" "<<ac<<" "<<ep<<" "<<ans<<" "<<abs(ac-ep)<<endl;
if(abs(ac-ep)/n3<ans) ans=abs(ac-ep)/n3,ans1=n1,ans2=n2,ans3=n3;
}
}
}
cout<<ans1<<" "<<ans2<<" "<<ans3<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3708kb
input:
92998938 66660 24
output:
4 100 400
result:
ok Output is valid!
Test #2:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
92998938 66660 25
output:
2 6 30
result:
ok Output is valid!
Test #3:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
1 1 1
output:
3 15 60
result:
ok Output is valid!
Test #4:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
1000000000 1000000 1000
output:
3 15 60
result:
ok Output is valid!
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3744kb
input:
1000000000 1 1
output:
5 25 50
result:
wrong answer Fractions are not equal