QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#501110#5152. Circular Caramel CookiezmrzmrWA 0ms3860kbC++17476b2024-08-02 14:20:052024-08-02 14:20:05

Judging History

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

  • [2024-08-02 14:20:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3860kb
  • [2024-08-02 14:20:05]
  • 提交

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: 3860kb

input:

11

output:

nan

result:

wrong output format Expected double, but "nan" found