QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#502676#5152. Circular Caramel CookiecloudsssWA 7ms3884kbC++20617b2024-08-03 11:30:542024-08-03 11:30:55

Judging History

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

  • [2024-08-03 11:30:55]
  • 评测
  • 测评结果:WA
  • 用时:7ms
  • 内存:3884kb
  • [2024-08-03 11:30:54]
  • 提交

answer

#include<bits/stdc++.h>
#define INF 100010
#define mod 80112002
#define pi 3.14159265359
using namespace std;
typedef long long LL;
vector<int> a,b;
double p=1e-6;
double l=0,r=1e5,s;
bool check(double x)
{
    int num=0;
    for(int i=1;i<=(int)x;i++)
        num+=(int)sqrt(x*x-i*i);
    return 4*num>s;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>s;
    while(l+p<r)
    {
        double mid=(l+r)/2;
        if(check(mid))
            r=mid;
        else
            l=mid;
    }
    cout<<fixed<<setprecision(10)<<l;
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3828kb

input:

11

output:

2.2360676667

result:

ok found '2.2360677', expected '2.2360680', error '0.0000001'

Test #2:

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

input:

59

output:

4.9999995099

result:

ok found '4.9999995', expected '5.0000000', error '0.0000001'

Test #3:

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

input:

1

output:

1.4142133296

result:

ok found '1.4142133', expected '1.4142136', error '0.0000002'

Test #4:

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

input:

2

output:

1.4142133296

result:

ok found '1.4142133', expected '1.4142136', error '0.0000002'

Test #5:

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

input:

3

output:

1.4142133296

result:

ok found '1.4142133', expected '1.4142136', error '0.0000002'

Test #6:

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

input:

4

output:

2.2360676667

result:

ok found '2.2360677', expected '2.2360680', error '0.0000001'

Test #7:

score: -100
Wrong Answer
time: 7ms
memory: 3740kb

input:

1000000000

output:

99999.9999992724

result:

wrong answer 1st numbers differ - expected: '17841.8813190', found: '99999.9999993', error = '4.6047901'