QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#501107#5152. Circular Caramel CookiecloudsssWA 0ms3904kbC++20870b2024-08-02 14:18:422024-08-02 14:18:42

Judging History

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

  • [2024-08-02 14:18:42]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3904kb
  • [2024-08-02 14:18:42]
  • 提交

answer

#include<bits/stdc++.h>
#define INF 400010
#define mod 80112002
using namespace std;
typedef long long LL;
int a[INF];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
   
    int n;
    cin>>n;
    double minn=1,bian=1;
    while(minn<=n)
    {
        minn=bian*bian+4*bian;
        bian++;
    }
    double temp=bian-1;
    minn=1;
    if(n==1||n==2||n==3)
    {
        cout<<fixed<<setprecision(10)<<1.4142136;
        return 0;
    }
    else if(n==4)
    {
        cout<<fixed<<setprecision(10)<<2.23606800;
        return 0;
    }
    while(temp<=bian&&minn<=n)
    {
        minn=floor(temp)*floor(temp)+4*floor(temp);
        temp+=0.000000001;
    }
    double r;
    r=sqrt((temp/2.0)*(temp/2.0)+((temp+2.0)/2.0)*((temp+2.0)/2.0));
    cout<<fixed<<setprecision(10)<<r;
    return 0;
}

詳細信息

Test #1:

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

input:

11

output:

2.2360679782

result:

ok found '2.2360680', expected '2.2360680', error '0.0000000'

Test #2:

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

input:

59

output:

5.0000000007

result:

ok found '5.0000000', expected '5.0000000', error '0.0000000'

Test #3:

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

input:

1

output:

1.4142136000

result:

ok found '1.4142136', expected '1.4142136', error '0.0000000'

Test #4:

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

input:

2

output:

1.4142136000

result:

ok found '1.4142136', expected '1.4142136', error '0.0000000'

Test #5:

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

input:

3

output:

1.4142136000

result:

ok found '1.4142136', expected '1.4142136', error '0.0000000'

Test #6:

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

input:

4

output:

2.2360680000

result:

ok found '2.2360680', expected '2.2360680', error '0.0000000'

Test #7:

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

input:

1000000000

output:

22360.1306458623

result:

wrong answer 1st numbers differ - expected: '17841.8813190', found: '22360.1306459', error = '0.2532384'