QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#772349 | #9576. Ordainer of Inexorable Judgment | laonongmin | WA | 0ms | 3976kb | C++23 | 2.4kb | 2024-11-22 18:55:47 | 2024-11-22 18:55:48 |
Judging History
你现在查看的是最新测评结果
- [2024-12-23 14:23:26]
- hack成功,自动添加数据
- (/hack/1303)
- [2024-12-06 11:32:56]
- hack成功,自动添加数据
- (/hack/1271)
- [2024-11-22 18:55:47]
- 提交
answer
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define N 105
#define double long double
using namespace std;
const double PI = acos(-1);
const double eps = 1e-12;
int sgn(double x){return x < -eps ? -1 : (x < eps ? 0 : 1);} // 解决double精度问题
struct Point {
double x, y;
Point(double x=0, double y=0) : x(x), y(y) {}
double operator^ (const Point &B) const { return x * B.y - y * B.x; }
double operator* (const Point &B) const { return x * B.x + y * B.y; }
double sita(int axis = 1)
{
double res = acos(x/sqrt(x*x+y*y));
if(sgn(y) == -1)
{
res = -res;
if(axis == 1) res += 2*PI;
}
return res;
}
Point Rotate(double b)
{
Point B(sin(b), cos(b));
return Point((*this) ^ B, (*this) * B);
}
};
double len(Point A) {return sqrt(A*A);}
using Vector = Point;
double qjj(double l1,double r1,double l2,double r2)
{
if(sgn(r1-l1)==-1 || sgn(r2-l2)==-1) return 0;
return max((double)0, (r1-l1)+(r2-l2)-(max(r1,r2)-min(l1,l2)));
}
void solve()
{
int n,d;
double t;
Point s;
cin>>n>>s.x>>s.y>>d>>t;
double cur1 = s.sita(1), cur2 = s.sita(-1);
double mx1 = -1e9, mi1 = 1e9;
double mx2 = -1e9, mi2 = 1e9;
for(int i=1;i<=n;++i)
{
int x,y; cin>>x>>y;
Point A(x,y);
double tmp = asin(d/len(A));
Point B = A.Rotate(tmp), C = A.Rotate(-tmp);
mx1 = max({mx1, B.sita(1), C.sita(1)});
mi1 = min({mi1, B.sita(1), C.sita(1)});
mx2 = max({mx2, B.sita(-1), C.sita(-1)});
mi2 = min({mi2, B.sita(-1), C.sita(-1)});
}
int cnt = int(t/(2*PI));
t -= cnt*2*PI;
// [cur, cur+t]
if(sgn((mx2-mi2) - (mx1-mi1)) != -1)
{
// cout<<"XXX\n";
double ans = cnt*(mx1-mi1);
// cout<<mi1<<' '<<mx1<<'\n';;
ans += qjj(mi1,mx1,cur1,cur1+t) + qjj(mi1,mx1,0,cur1+t-2*PI);
// cout<<ans<<'\n';
}
else
{
double ans = cnt*(mx2-mi2);
ans += qjj(mi2,mx2,cur2,cur2+t) + qjj(mi2,mx2,-PI,cur2+t-2*PI);
cout<<ans<<'\n';
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout<<fixed<<setprecision(12);
int T=1;
// cin>>T;
while(T--)
{
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3976kb
input:
3 1 0 1 1 1 2 2 1 2 2
output:
result:
wrong output format Unexpected end of file - double expected