QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#501114 | #5152. Circular Caramel Cookie | zmrzmr | WA | 0ms | 3728kb | C++14 | 476b | 2024-08-02 14:21:38 | 2024-08-02 14:21:39 |
Judging History
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