QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#718374#9576. Ordainer of Inexorable JudgmentEwiGKeiTWA 0ms3980kbC++142.0kb2024-11-06 20:22:232024-11-06 20:22:24

Judging History

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

  • [2024-12-23 14:23:26]
  • hack成功,自动添加数据
  • (/hack/1303)
  • [2024-12-06 11:32:56]
  • hack成功,自动添加数据
  • (/hack/1271)
  • [2024-11-14 21:58:28]
  • hack成功,自动添加数据
  • (/hack/1181)
  • [2024-11-06 20:22:24]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3980kb
  • [2024-11-06 20:22:23]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LB;
const LL MOD=1e9+7;
const LL INF=1e9;
const LB eps=1e-9;
const LB PI=acos(-1);
struct Point
{
    LB x,y,ang;
    Point operator-(const Point& p) const
    {
        return {x-p.x,y-p.y};
    }
    LB operator*(const Point& p) const
    {
        return x*p.y-y*p.x;
    }
} p[105];
int n;
LB X0,Y0,d,t,enter[105],leave[105],ans;
void normalize(LB &x)
{
    while (x<-eps) x+=PI*2;
}
signed main()
{
    // ios::sync_with_stdio(false);
    // cin.tie(0),cout.tie(0);

    cin >> n >> X0 >> Y0 >> d >> t;
    for (int i=1;i<=n;i++)
    {
        cin >> p[i].x >> p[i].y;
        LB l=sqrt(p[i].x*p[i].x+p[i].y*p[i].y),
           ang=atan2(p[i].y,p[i].x);
        normalize(ang);
        LB ang1=asin(d/l);
        enter[i]=ang-ang1;
        leave[i]=ang+ang1;
    }

    Point o={0,0};
    int news=0;
    for (int i=1;i<=n;i++)
    {
        bool ok=true;
        for (int j=1;j<=n;j++)
            if (i!=j && (p[i]-o)*(p[j]-p[i])<0)
            {
                ok=false;
                break;
            }
        if (ok) news=i;
    }

    cout << news << '\n';

    double offset=enter[news];

    LB em=PI*2,lm=0;
    for (int i=1;i<=n;i++)
    {
        enter[i]-=offset;
        normalize(enter[i]);
        leave[i]-=offset;
        normalize(leave[i]);

        em=min(em,enter[i]);
        lm=max(lm,leave[i]);
    }

    // cout << fixed << setprecision(9) << em << ' ' << lm << '\n';

    // cout << fixed << setprecision(9) << (em+lm)/2 << '\n';

    LB start=atan2(Y0,X0)-offset;
    normalize(start);
    cout << start << '\n';
    LB em2=max(em,start),
       lm2=max(lm,start);
    if (t-(em2-start)>0) ans+=min(t-(em2-start),lm2-em2);
    t-=PI*2-start;

    while (t>em)
    {
        ans+=min(t-em,lm-em);
        t-=PI*2;
    }
    cout << fixed << setprecision(9) << ans << '\n';
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3980kb

input:

3 1 0 1 1
1 2
2 1
2 2

output:

2
0
1.000000000

result:

wrong answer 1st numbers differ - expected: '1.0000000', found: '2.0000000', error = '1.0000000'