QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#385026 | #4005. Frog | Hqwq | WA | 23ms | 4252kb | C++20 | 2.0kb | 2024-04-10 14:48:53 | 2024-04-10 14:48:54 |
Judging History
answer
#include<bits/stdc++.h>
#define double long double
using namespace std;
int t,ds,dt;
double pi=acos(-1);
int main(){
ios::sync_with_stdio(false);
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>t;
while(t--){
cin>>ds>>dt;
int flag=0;
if (ds<dt) dt-=360;
if (ds-dt>180){
swap(ds,dt);
dt-=360;
flag=1;
}
if (ds-dt==0){
printf("0\n");
printf("%.10Lf %.10Lf\n",cos(pi*ds/180),sin(pi*ds/180));
}
else if (ds-dt<=90){
if (flag) swap(ds,dt);
printf("2\n");
printf("%.10Lf %.10Lf\n",cos(pi*ds/180),sin(pi*ds/180));
printf("%.10Lf %.10Lf\n",cos(pi*ds/180)+cos(pi*dt/180),sin(pi*ds/180)+sin(pi*dt/180));
printf("%.10Lf %.10Lf\n",cos(pi*dt/180),sin(pi*dt/180));
}
else if (ds-dt<=131){
printf("3\n");
double temp1,temp2,temp3,jiao;
temp1=sqrt(2-2*cos((ds-dt)*pi/180));
temp2=temp1+1;
temp3=(2-temp2)/2;
double temp4=(1+temp1*temp1-temp2)/2/temp1;
jiao=(360-(540-acos(temp3)/pi*180*2-(ds-dt)))*pi/360;
double jiao1=acos(temp4);
double jiao2=acos(temp3);
//printf("%.10lf\n%.10lf\n%.10lf\n",(jiao1+jiao2)/pi*180,jiao1,jiao2);
if (flag) {
swap(ds,dt);
jiao=-jiao;
}
//cout<<jiao<<' '<<pi*ds/180-jiao+2*pi<<' '<<pi*dt/180+jiao<<'\n';
printf("%.10Lf %.10Lf\n",cos(pi*ds/180),sin(pi*ds/180));
printf("%.10Lf %.10Lf\n",cos(pi*ds/180)+cos(pi*ds/180-jiao),sin(pi*ds/180)+sin(pi*ds/180-jiao));
printf("%.10Lf %.10Lf\n",cos(pi*dt/180)+cos(pi*dt/180+jiao),sin(pi*dt/180)+sin(pi*dt/180+jiao));
printf("%.10Lf %.10Lf\n",cos(pi*dt/180),sin(pi*dt/180));
}
else {
printf("4\n");
int mid=(ds+dt)/2;
printf("%.10Lf %.10Lf\n",cos(pi*ds/180),sin(pi*ds/180));
printf("%.10Lf %.10Lf\n",cos(pi*ds/180)+cos(pi*mid/180),sin(pi*ds/180)+sin(pi*mid/180));
printf("%.10Lf %.10Lf\n",cos(pi*mid/180),sin(pi*mid/180));
printf("%.10Lf %.10Lf\n",cos(pi*dt/180)+cos(pi*mid/180),sin(pi*dt/180)+sin(pi*mid/180));
printf("%.10Lf %.10Lf\n",cos(pi*dt/180),sin(pi*dt/180));
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 4252kb
input:
3 0 0 0 90 180 0
output:
0 1.0000000000 0.0000000000 2 1.0000000000 0.0000000000 1.0000000000 1.0000000000 -0.0000000000 1.0000000000 4 -1.0000000000 0.0000000000 -1.0000000000 1.0000000000 0.0000000000 1.0000000000 1.0000000000 1.0000000000 1.0000000000 0.0000000000
result:
ok ok
Test #2:
score: -100
Wrong Answer
time: 23ms
memory: 4120kb
input:
10000 194 96 89 164 139 41 323 35 185 221 0 275 53 116 233 79 209 91 236 12 94 291 332 293 207 31 133 329 60 114 1 91 273 103 69 193 220 303 100 118 42 15 331 201 26 103 347 292 184 148 307 197 84 326 52 224 257 27 3 99 310 26 138 288 112 17 206 159 302 104 58 121 276 268 236 134 281 173 147 128 72 ...
output:
3 -0.9702957263 -0.2419218956 -1.6163347531 0.5213824840 -1.0427583167 1.3405345283 -0.1045284633 0.9945218954 2 0.0174524064 0.9998476952 -0.9438092895 1.2754850510 -0.9612616959 0.2756373558 3 -0.7547095802 0.6560590290 -0.5000000000 1.6230766244 0.5000000000 1.6230766244 0.7547095802 0.6560590290...
result:
wrong answer Starting point too far from actual. (Test case 10)