QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#201452#5152. Circular Caramel CookieDreamOn#WA 1ms3924kbC++23753b2023-10-05 14:25:252023-10-05 14:25:26

Judging History

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

  • [2023-10-05 14:25:26]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3924kb
  • [2023-10-05 14:25:25]
  • 提交

answer

#include<bits/stdc++.h>
#define db double
#define ll long long
#define eps 5e-9
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 count( db r )
{
	ll ret=0;
	for(int i=floor(r);i>=1;i--)
	{
		int l=floor(sqrt(r*r-1ll*i*i));
		ret+=l;
	}
	return ret<<2;
}

int s;
void solve()
{
	read(s);
	db l=1,r=1e5,ans;
	while( r-l>=eps )
	{
		db mid=(l+r)/2;
		if( count(mid)>=s ) 
			ans=mid,r=mid;
		else l=mid;
	}
	printf("%.8lf",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: 3860kb

input:

11

output:

2.23606798

result:

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

Test #2:

score: 0
Accepted
time: 1ms
memory: 3860kb

input:

59

output:

5.00000000

result:

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

Test #3:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

1

output:

1.41421356

result:

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

Test #4:

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

input:

2

output:

1.41421356

result:

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

Test #5:

score: 0
Accepted
time: 1ms
memory: 3856kb

input:

3

output:

1.41421356

result:

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

Test #6:

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

input:

4

output:

1.41421356

result:

wrong answer 1st numbers differ - expected: '2.2360680', found: '1.4142136', error = '0.3675445'