QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#501128 | #5152. Circular Caramel Cookie | mmzskm | WA | 0ms | 3916kb | C++14 | 868b | 2024-08-02 14:37:50 | 2024-08-02 14:37:50 |
Judging History
answer
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<climits>
#include<map>
#include<set>
#include<stack>
#include<iomanip>
#include<cmath>
using namespace std;
using ll = long long;
#define int ll
void solve()
{
int n;
cin >> n;
if (n >= 1 && n <= 4)
{
cout << fixed << setprecision(12) << sqrt(2);
return;
}
int k = 4;
while (true)
{
if (n <= k * k - 4 && n > (k - 2) * (k - 2) - 4)
{
break;
}
k += 2;
}
k /= 2;
cout << fixed << setprecision(12) << sqrt(k * k + (k - 1) * (k - 1));
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int T = 1;
//cin >> T;
while (T--)
{
solve();
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3644kb
input:
11
output:
2.236067977500
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
59
output:
5.000000000000
result:
ok found '5.0000000', expected '5.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
1
output:
1.414213562373
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
2
output:
1.414213562373
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
3
output:
1.414213562373
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3648kb
input:
4
output:
1.414213562373
result:
wrong answer 1st numbers differ - expected: '2.2360680', found: '1.4142136', error = '0.3675445'