QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#278082#6176. 天文奇观问题Nyans0 635ms471044kbC++141.7kb2023-12-07 11:40:232023-12-07 11:40:23

Judging History

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

  • [2023-12-07 11:40:23]
  • 评测
  • 测评结果:0
  • 用时:635ms
  • 内存:471044kb
  • [2023-12-07 11:40:23]
  • 提交

answer

// Qzong!!!!!!!!!!!!!!!!!!!!!!!
#include<cstdio>
#include<cmath>
const int N=15000000,M=N>>1;
const double pi=acos(-1);
struct node{
    double x,y,z;
    node operator+(const node &a)const {return node{x+a.x,y+a.y,z+a.z};}
    node operator/(const double a)const {return node{x/a,y/a,z/a};}
    node operator-(const node &A)const {return node{x-A.x,y-A.y,z-A.z};}
    node operator*(const double a)const {return node{x*a,y*a,z*a};}
}ear,sun,moon,a1,a2,d1,d2,d3,tmp;
double er,mr,sr,C[N+20],S[N+20],H[N+20],R[N+20],Ans[3];
int now;
double dot(const node &a,const node &b){
    return a.x*b.x+a.y*b.y+a.z*b.z;
}
node cro(const node &a,const node &b){
    return node{a.y*b.z-a.z*b.y,a.z*b.x-a.x*b.z,a.x*b.y-a.y*b.x};
}
double dis(const node &a){
    return a.x*a.x+a.y*a.y+a.z*a.z;
}
bool check(const node &a,const node &b){
    return dis(cro(sun-a,sun-b))>=sr*sr*dis(a-b);
}
void go(int op,node t){
    int l=now,r=N-now,i;
    for(i=1;i<=N;i++){
        while(l<r&&(tmp=node{C[l]*R[i],S[l]*R[i],H[i]},dot(tmp,d3-tmp)<0||check(tmp,t)))l++;
        while(l<r&&(tmp=node{C[r]*R[i],S[r]*R[i],H[i]},dot(tmp,d3-tmp)<0||check(tmp,t)))r--;
        if(l>=r)return;
        Ans[op?2:S[r]*R[i]<t.y]+=(r-l)*pi*er*er/N/M;
    }
}
int main(){
    scanf("%lf%lf%lf%lf%lf%lf",&er,&sun.y,&sr,&moon.x,&moon.y,&mr),C[0]=1;
    d1=(moon-sun)/(sr-mr)*sr+sun,d2=(sun-moon)/(sr+mr)*mr+moon,d3=sun*er/(sr+er);
    for(int i=1;i<=N;i++)
        C[i]=cos(pi*i/N),S[i]=sin(pi*i/N),H[i]=(i-0.5)*er/N,R[i]=sqrt(er*er-H[i]*H[i]);
    while(tmp=node{C[now],S[now],0}*er,dot(tmp,d3-tmp)<0)now++;
    go(1,d2);
    go(0,d1);
    printf("%.2lf %.2lf %.2lf\n",Ans[0],Ans[1],Ans[2]-Ans[1]-Ans[0]);
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 541ms
memory: 471000kb

input:

11938 594248 12780 0 346883 9238

output:

63941852.86 0.00 794264774.65

result:

wrong answer 1st lines differ - expected: '63941708.64 0.00 794264530.31', found: '63941852.86 0.00 794264774.65'

Test #2:

score: 0
Wrong Answer
time: 565ms
memory: 471044kb

input:

16719 144851 22165 0 83017 7761

output:

0.00 240783124.21 1044058410.11

result:

wrong answer 1st lines differ - expected: '0.00 240782739.55 1044058060.95', found: '0.00 240783124.21 1044058410.11'

Test #3:

score: 0
Wrong Answer
time: 574ms
memory: 470924kb

input:

7646 605779 19906 1694 126163 6841

output:

45194627.12 0.00 305422057.16

result:

wrong answer 1st lines differ - expected: '45194552.62 0.00 305421972.74', found: '45194627.12 0.00 305422057.16'

Test #4:

score: 0
Wrong Answer
time: 593ms
memory: 471012kb

input:

18162 946556 18741 8928 97390 10313

output:

433217695.71 0.00 309143360.98

result:

wrong answer 1st lines differ - expected: '433217227.86 0.00 309143206.65', found: '433217695.71 0.00 309143360.98'

Test #5:

score: 0
Wrong Answer
time: 538ms
memory: 470968kb

input:

14690 703057 16984 2539 153176 5322

output:

18284854.61 0.00 533900829.26

result:

wrong answer 1st lines differ - expected: '18284759.68 0.00 533900477.35', found: '18284854.61 0.00 533900829.26'

Test #6:

score: 0
Wrong Answer
time: 624ms
memory: 470932kb

input:

8828 760567 15307 1346 299568 2042

output:

0.00 176371880.67 297760548.80

result:

wrong answer 1st lines differ - expected: '0.00 176371726.37 297760491.04', found: '0.00 176371880.67 297760548.80'

Test #7:

score: 0
Wrong Answer
time: 431ms
memory: 470924kb

input:

9233 684542 9743 7686 99982 23

output:

0.00 15894701.95 760785.51

result:

wrong answer 1st lines differ - expected: '0.00 15894661.10 760784.14', found: '0.00 15894701.95 760785.51'

Test #8:

score: 0
Wrong Answer
time: 635ms
memory: 471012kb

input:

11854 888164 19196 11668 633801 3822

output:

0.00 172428536.86 679601895.97

result:

wrong answer 1st lines differ - expected: '0.00 172428241.22 679601808.58', found: '0.00 172428536.86 679601895.97'

Test #9:

score: 0
Wrong Answer
time: 631ms
memory: 471040kb

input:

375 254376 14504 2002 226643 351

output:

0.00 831890.79 0.00

result:

wrong answer 1st lines differ - expected: '0.00 831890.41 0.00', found: '0.00 831890.79 0.00'

Test #10:

score: 0
Wrong Answer
time: 479ms
memory: 470932kb

input:

22819 983527 22854 19008 945334 6139

output:

0.00 0.00 3119765873.06

result:

wrong answer 1st lines differ - expected: '0.00 0.00 3119764452.78', found: '0.00 0.00 3119765873.06'