QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#325265#5610. It's About Timeweilaifuture#WA 0ms3636kbC++14918b2024-02-11 06:52:062024-02-11 06:52:07

Judging History

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

  • [2024-02-11 06:52:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3636kb
  • [2024-02-11 06:52:06]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
long long r,s,h,d,sn;
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=1;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 long 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*1.0)<ans) ans=abs(ac-ep*1.0),ans1=n1,ans2=n2,ans3=n3;
            }
        }
    }
    cout<<ans1<<" "<<ans2<<" "<<ans3<<endl;
    return 0;
}

詳細信息

Test #1:

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

input:

92998938 66660 24

output:

4 100 400

result:

ok Output is valid!

Test #2:

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

input:

92998938 66660 25

output:

2 6 30

result:

ok Output is valid!

Test #3:

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

input:

1 1 1

output:

3 15 60

result:

ok Output is valid!

Test #4:

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

input:

1000000000 1000000 1000

output:

3 15 60

result:

ok Output is valid!

Test #5:

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

input:

1000000000 1 1

output:

5 25 50

result:

wrong answer Fractions are not equal