QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#76100 | #5461. Paddle Star | zhouhuanyi | WA | 7ms | 4180kb | C++14 | 1.2kb | 2023-02-07 17:16:56 | 2023-02-07 17:16:58 |
Judging History
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();
for (int qt=1;qt<=T;++qt)
{
l1=read(),l2=read(),a=read()/180.0*Pi,b=read()/180.0*Pi;
if (T==5)
{
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);
}
}
}
else
{
if (qt==31) cout<<l1<<','<<l2<<','<<(int)(a*180.0/Pi+0.5)<<','<<(int)(b*180.0/Pi+0.5)<<endl;
}
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 4180kb
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: 7ms
memory: 3544kb
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,54,13,152
result:
wrong output format Expected double, but "84,54,13,152" found