QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#325334#5610. It's About Timeweilaifuture#WA 1ms3780kbC++14930b2024-02-11 08:19:032024-02-11 08:19:03

Judging History

你现在查看的是最新测评结果

  • [2024-02-11 08:19:03]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3780kb
  • [2024-02-11 08:19:03]
  • 提交

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*n3*s*h + sn*k*j*s*h - sn*k*s*h + sn*h*s;
                //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: 1ms
memory: 3708kb

input:

92998938 66660 24

output:

4 100 400

result:

ok Output is valid!

Test #2:

score: 0
Accepted
time: 1ms
memory: 3664kb

input:

92998938 66660 25

output:

2 6 30

result:

ok Output is valid!

Test #3:

score: 0
Accepted
time: 0ms
memory: 3744kb

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 18 180

result:

ok Output is valid!

Test #5:

score: -100
Wrong Answer
time: 1ms
memory: 3720kb

input:

1000000000 1 1

output:

5 45 450

result:

wrong answer Fractions are not equal