QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#75987#5461. Paddle StarchenshiWA 287ms1880kbC++1.3kb2023-02-06 22:11:212023-02-06 22:11:26

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-06 22:11:26]
  • 评测
  • 测评结果:WA
  • 用时:287ms
  • 内存:1880kb
  • [2023-02-06 22:11:21]
  • 提交

answer

//https://cdn.luogu.com.cn/upload/image_hosting/bce60lzi.png
//https://cdn.luogu.com.cn/upload/image_hosting/30e80xrq.png
//https://cdn.luogu.com.cn/upload/image_hosting/kejvnuf4.png
#include<cstdio>
#include<cmath>
using namespace std;
const long double PI=acosl(-1);
int T,Tc;long double l1,l2,l3,Alpha,Beta,Gamma,t,ans;
inline long double calc(long double x,long double Alpha,long double Beta){
	return x*x*sinl(Alpha)*sinl(Beta)/sinl(PI-Alpha-Beta);
}
int main(){
	for(scanf("%d",&T),Tc=T;T--;){
		scanf("%Lf%Lf%Lf%Lf",&l1,&l2,&Alpha,&Beta);Alpha=Alpha/180*PI;t=Beta=Beta/180*PI;
		if(T==Tc-31) printf("%Lf %Lf %Lf %Lf\n",l1,l2,Alpha,Beta);
		if(l1<l2){
			Gamma=Alpha-asinl(l1*sinl(Alpha)/l2);
			if(PI-Beta<Gamma) Beta=PI-Gamma;
		}
		ans=(l1+l2)*(l1+l2)*Alpha+l2*l2*Beta;
		if(l1<l2&&PI-t<Gamma) Beta=t,t=l1*sinl(Alpha)/sinl(Alpha-(PI-Beta)),ans+=l2*t*sinl(Gamma-(PI-Beta));
		if(Beta>PI/2){
			if(l2>l1*cosl(PI-Beta)) l2=l1*cosl(PI-Beta),l3=l1*sinl(Beta);
			else l3=sqrtl(l1*l1+l2*l2-2*l1*l2*cosl(PI-Beta));
			Gamma=asinl(l2*sinl(Beta)/l3);
			if(Gamma<2*Alpha) ans+=l1*l2*sinl(Beta)-l3*l3*asinl(l2*sinl(Beta)/l3);
			else ans+=l1*l2*sinl(Beta)-l1*l3*sinl(Gamma-2*Alpha)-l3*l3*2*Alpha+
			l1*l3*sinl(Gamma-2*Alpha)-calc(l3,Gamma-2*Alpha,asinl(l1*sinl(Beta)/l3));
		}
		if(Tc<100000) printf("%.9Lf\n",ans);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 1732kb

input:

5
2 1 20 20
3 3 0 0
20 20 90 120
20 10 50 170
100 10 1 93

output:

3.490658504
0.000000000
3367.157611907
1098.863278984
373.960489570

result:

ok 5 numbers

Test #2:

score: -100
Wrong Answer
time: 287ms
memory: 1880kb

input:

100000
88 12 24 116
79 15 84 150
96 52 31 141
100 100 81 29
83 29 71 99
95 92 5 87
99 97 39 72
79 72 20 65
67 39 60 116
100 89 1 62
78 77 63 45
62 34 83 178
92 49 24 103
94 73 66 49
20 14 24 51
100 97 66 109
94 94 86 82
82 79 49 67
76 38 88 118
92 79 58 112
93 23 40 167
87 34 13 25
96 18 73 15
94 38...

output:

84.000000 54.000000 0.226893 2.652900

result:

wrong answer 1st numbers differ - expected: '4526.9916132', found: '84.0000000', error = '0.9814446'