QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#501223 | #5152. Circular Caramel Cookie | Au_Gold | WA | 0ms | 3940kb | C++20 | 458b | 2024-08-02 15:47:54 | 2024-08-02 15:47:54 |
Judging History
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'