QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#201193 | #5152. Circular Caramel Cookie | nameless_story# | WA | 1ms | 3696kb | C++20 | 397b | 2023-10-05 13:04:57 | 2023-10-05 13:04:58 |
Judging History
answer
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
int main()
{
ios::sync_with_stdio(0); cin.tie(0);
cout<<fixed<<setprecision(15);
ll n,l=1,r=1e10,mid,i;
cin>>n;
while (l<r)
{
mid=l+r>>1;
ll res=0;
for (i=1; i*i<=mid; i++) res+=(ll)sqrtl(mid-i*i);
if (res*4>=n) r=mid; else l=mid+1;
}
cout<<sqrt(l)<<endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3628kb
input:
11
output:
2.236067977499790
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
59
output:
5.000000000000000
result:
ok found '5.0000000', expected '5.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
1
output:
1.414213562373095
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
2
output:
1.414213562373095
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
3
output:
1.414213562373095
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #6:
score: -100
Wrong Answer
time: 1ms
memory: 3624kb
input:
4
output:
1.414213562373095
result:
wrong answer 1st numbers differ - expected: '2.2360680', found: '1.4142136', error = '0.3675445'