QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#325331#5610. It's About Timeweilaifuture#WA 1ms3728kbC++14918b2024-02-11 08:11:422024-02-11 08:11:42

Judging History

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

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

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)/ac<ans) ans=abs(ac-ep)/ac,ans1=n1,ans2=n2,ans3=n3;
            }
        }
    }
    cout<<ans1<<" "<<ans2<<" "<<ans3<<endl;
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3656kb

input:

92998938 66660 24

output:

4 100 400

result:

ok Output is valid!

Test #2:

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

input:

92998938 66660 25

output:

2 6 30

result:

ok Output is valid!

Test #3:

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

input:

1 1 1

output:

3 15 60

result:

ok Output is valid!

Test #4:

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

input:

1000000000 1000000 1000

output:

3 15 60

result:

ok Output is valid!

Test #5:

score: -100
Wrong Answer
time: 0ms
memory: 3704kb

input:

1000000000 1 1

output:

5 45 450

result:

wrong answer Fractions are not equal