QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#76099#5461. Paddle StarzhouhuanyiWA 117ms4184kbC++141.1kb2023-02-07 17:14:162023-02-07 17:14:18

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-07 17:14:18]
  • 评测
  • 测评结果:WA
  • 用时:117ms
  • 内存:4184kb
  • [2023-02-07 17:14:16]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int read()
{
    char c=0;
    int sum=0;
    while (c<'0'||c>'9') c=getchar();
    while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
    return sum;
}
int T;
const double Pi=asin(1)*2;
double l1,l2,l3,l4,l5,l6,a,b,c,d;
int main()
{
    T=read();
    while (T--)
    {
	l1=read(),l2=read(),a=read()/180.0*Pi,b=read()/180.0*Pi;
	if (b<=Pi/2) printf("%0.20lf\n",(l1+l2)*(l1+l2)*a+l2*l2*b);
	else
	{
	    l3=l1*sin(Pi-b),l4=l1*cos(Pi-b);
	    if (l4<=l2)
	    {
		if (b-Pi/2<=2*a) printf("%0.20lf\n",(l1+l2)*(l1+l2)*a+l2*l2*b+l3*l4-l3*l3*(b-Pi/2));
		else c=b-Pi/2-2*a,l5=l3*tan(c),printf("%0.20lf\n",(l1+l2)*(l1+l2)*a+l2*l2*b+l3*l4-l3*l3*(2*a)-l3*l5);
	    }
	    else
	    {
		l5=sqrt(l1*l1+l2*l2-2*l1*l2*cos(Pi-b)),c=asin(sin(Pi-b)/l5*l2);
		if (c<=2*a) printf("%0.20lf\n",(l1+l2)*(l1+l2)*a+l2*l2*b+l1*l2*sin(Pi-b)-l5*l5*c);
		else d=c-2*a,l6=l5*tan(d),printf("%0.20lf\n",(l1+l2)*(l1+l2)*a+l2*l2*b+l1*l2*sin(Pi-b)-l5*l5*(2*a)-l5*l6);
	    }
	}
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 4184kb

input:

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

output:

3.49065850398865906712
0.00000000000000000000
3367.15761190651073775371
1098.86327898408194414515
373.96048957008883917297

result:

ok 5 numbers

Test #2:

score: -100
Wrong Answer
time: 117ms
memory: 4068kb

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:

4526.99161320287566923071
13636.47926547432507504709
19433.17050261267286259681
61610.12259539983642753214
17006.23372698732418939471
15903.66703697509001358412
37972.63984345006610965356
13840.11190246463411313016
14968.80452031827007886022
9194.79592523408791748807
31073.49293665664299624041
16982...

result:

wrong answer 31st numbers differ - expected: '12961.4718368', found: '12988.3103186', error = '0.0020706'