QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#201584 | #5152. Circular Caramel Cookie | DreamOn# | WA | 1ms | 3888kb | C++23 | 781b | 2023-10-05 15:17:18 | 2023-10-05 15:17:19 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define db long double
using namespace std;
template<typename T>
inline void read( T &n )
{
n=0;bool w=false;char ch=getchar();
while( ch>'9' || ch<'0' ) w=!(ch^'-'),ch=getchar();
while( ch<='9' && ch>='0' ) n=(n<<3)+(n<<1)+(ch^48),ch=getchar();
n=w?-n:n;
}
namespace kk
{///////////
ll s;
ll count( ll r )
{
ll ret=0;
for(ll i=sqrt(r);i>=1;i--)
{
ll l=sqrt(r-i*i);
ret+=l;
}
return ret<<2;
}
void solve()
{
read(s);
ll l=2,r=1e10,ans;
while( l<=r )
{
ll mid=l+r>>1;
if( count(mid)>=s )
ans=mid,r=mid-1;
else l=mid+1;
}
cout<<fixed<<setprecision(10);
cout<<sqrt(ans);
// printf("%.10lf",sqrt(ans));
}
}//////////
int main()
{
kk::solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3664kb
input:
11
output:
2.2360679775
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3880kb
input:
59
output:
5.0000000000
result:
ok found '5.0000000', expected '5.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3800kb
input:
1
output:
1.4142135624
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3852kb
input:
2
output:
1.4142135624
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
3
output:
1.4142135624
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #6:
score: -100
Wrong Answer
time: 1ms
memory: 3888kb
input:
4
output:
1.4142135624
result:
wrong answer 1st numbers differ - expected: '2.2360680', found: '1.4142136', error = '0.3675445'