QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#18182#2267. Jewelry SizeAppleblue17#WA 0ms4124kbC++654b2022-01-16 17:10:342022-05-04 17:17:32

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-04 17:17:32]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4124kb
  • [2022-01-16 17:10:34]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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'