QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#501223#5152. Circular Caramel CookieAu_GoldWA 0ms3940kbC++20458b2024-08-02 15:47:542024-08-02 15:47:54

Judging History

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

  • [2024-08-02 15:47:54]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3940kb
  • [2024-08-02 15:47:54]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
const int N = 1e5 + 5, M = 1e4 + 5, mod = 7;

int main()
{
    ll need;
    cin >> need;
    need++;
    ll n = 0;
    while (4 * n * n < need)
    {
        n++;
    }
    if ((n * n - 1) * 4 >= need)
    {
        printf("%.10lf\n", sqrt((n - 1) * (n - 1) + n * n));
    }
    else
    {
        printf("%.10lf\n", n * sqrt(2));
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

11

output:

2.2360679775

result:

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

Test #2:

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

input:

59

output:

5.0000000000

result:

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

Test #3:

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

input:

1

output:

1.4142135624

result:

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

Test #4:

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

input:

2

output:

1.4142135624

result:

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

Test #5:

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

input:

3

output:

1.4142135624

result:

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

Test #6:

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

input:

4

output:

2.2360679775

result:

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

Test #7:

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

input:

1000000000

output:

22360.8377526425

result:

wrong answer 1st numbers differ - expected: '17841.8813190', found: '22360.8377526', error = '0.2532780'