QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#102555 | #5152. Circular Caramel Cookie | w4p3r# | WA | 2ms | 3556kb | C++20 | 439b | 2023-05-03 14:35:54 | 2023-05-03 14:35:58 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef double db;
const db eps=1e-12;
typedef long long ll;
int s=0;
bool check(db mid)
{
ll cnt=0;
db d=mid*mid;
for(int i=1;i<=mid;i++)
cnt+=(sqrt(d-1ll*i*i)+(1e-12));
return 4*cnt>s;
}
int main()
{
scanf("%d",&s);
db l=0,r=sqrt(s);
while(l+eps<=r)
{
db mid=l+(r-l)*0.5;
if(check(mid)) r=mid;
else l=mid;
}
printf("%.20lf\n",r);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3556kb
input:
11
output:
2.23606797749959440580
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3516kb
input:
59
output:
4.99999999999963584685
result:
ok found '5.0000000', expected '5.0000000', error '0.0000000'
Test #3:
score: -100
Wrong Answer
time: 2ms
memory: 3512kb
input:
1
output:
1.00000000000000000000
result:
wrong answer 1st numbers differ - expected: '1.4142136', found: '1.0000000', error = '0.2928932'