QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#18182 | #2267. Jewelry Size | Appleblue17# | WA | 0ms | 4124kb | C++ | 654b | 2022-01-16 17:10:34 | 2022-05-04 17:17:32 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1100;
const double PI=acos(-1),eps=1e-8;
int n;
int a[N],mx;
int main(){
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
sort(a+1,a+n+1);
mx=a[n];
double l=mx/2.0,r=200000;
while(r-l>eps){
double mid=(l+r)/2,tot=0;
for(int i=1;i<=n;i++) tot+=asin(a[i]*1.0/2/mid);
if(tot<PI) r=mid;
else l=mid;
}
if(l>mx/2.0) return cout<<setprecision(10)<<fixed<<l,0;
l=0,r=200000;
while(r-l>eps){
double mid=(l+r)/2,tot=0;
for(int i=1;i<n;i++) tot+=asin(a[i]*1.0/2/mid);
if(tot<asin(mx*1.0/2/mid)) l=mid;
else r=mid;
}
cout<<setprecision(10)<<fixed<<l;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 4124kb
input:
5 3 1 6 1 7
output:
3.5444043468
result:
ok found '3.5444043', expected '3.5444044', error '0.0000000'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 4000kb
input:
3 500 300 400
output:
0.0000000000
result:
wrong answer 1st numbers differ - expected: '250.0000000', found: '0.0000000', error = '1.0000000'