QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#501186 | #5152. Circular Caramel Cookie | ssmy | WA | 0ms | 3884kb | C++20 | 789b | 2024-08-02 15:27:51 | 2024-08-02 15:27:52 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
int n;
std:: cin >> n;
int x = 4;
double ans;
for(int i = x; ;i ++ )
{
if(i * i > n)
{
if(i % 2 == 0)
{
ans = sqrt((i / 2) * (i / 2) + (i / 2 - 1) * (i / 2 - 1));
break;
}
else
{
ans = sqrt((i / 2 + 0.5) * (i / 2 + 0.5) + (i / 2 - 1 + 0.5) * (i / 2 - 1 + 0.5));
break;
}
}
}
std:: cout << setprecision(10) << ans << endl;
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
// int T;
// std:: cin >> T;
// while(T -- )
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3648kb
input:
11
output:
2.236067977
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
59
output:
5
result:
ok found '5.0000000', expected '5.0000000', error '0.0000000'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3832kb
input:
1
output:
2.236067977
result:
wrong answer 1st numbers differ - expected: '1.4142136', found: '2.2360680', error = '0.5811388'