QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#501114#5152. Circular Caramel CookiezmrzmrWA 0ms3728kbC++14476b2024-08-02 14:21:382024-08-02 14:21:39

Judging History

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

  • [2024-08-02 14:21:39]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3728kb
  • [2024-08-02 14:21:38]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int n;
int main()
{
	cin>>n;
	int flag;
	for(int i = 1 ; ; i++ )
	{
		if(4*(i-1)*(i-1)-4 >= n )
		{
			flag = i ;
			break;
		}
	}
	for(int i = 1 ; i < 1e3; i++ )
	{
		ll tt = i*i*4;
		if(tt==n)
		{
			double t =  i *1.0 * sqrt(2);
			printf("%.10llf",t);
		return 0;
		}
	}

	ll num = (flag-1)*(flag-1) + (flag-2)*(flag-2) ;
	double ans = sqrt(num);
	printf("%.10llf",ans);

 } 

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3728kb

input:

11

output:

-nan

result:

wrong output format Expected double, but "-nan" found