QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#829667 | #9576. Ordainer of Inexorable Judgment | 1145141919# | WA | 0ms | 4412kb | C++17 | 2.4kb | 2024-12-24 11:57:31 | 2024-12-24 11:57:37 |
Judging History
answer
#include<bits/stdc++.h>
#define For(i,l,r) for(int i=l,i##_e=r;i<=i##_e;++i)
#define rFor(i,r,l) for(int i=r,i##_e=l;i>=i##_e;--i)
#define y0 y_zero
#define y1 y_one
#define all(a) a.begin(),a.end()
#define cmin(a,b) a=min(a,b)
#define cmax(a,b) a=max(a,b)
#define vect basic_string
// #define ensure(_) if(!(_)) __builtin_unreachable();
using namespace std;
using u32=unsigned;
using i64=long long;
using ll=long long;
using u64=unsigned long long;
using ull=unsigned long long;
#if __SIZEOF_POINTER__==8
using i128=__int128;
using u128=__uint128_t;
#endif
using pii=array<int,2>;
using pll=array<ll,2>;
using a3=array<int,3>;
using a4=array<int,4>;
#define mtc() int T; cin>>T; while(T--) work();
using D=double;
const int N=110;
const double pi=acos(-1),eps=1e-8;
struct nd {
int x,y;
int det(nd b)const{ return x*b.y-y*b.x; }
void rev() {x=-x;y=-y;}
double getr(){return atan2(y,x);}
pair<D,D> rot(D a){return {x*cos(a)-y*sin(a),x*sin(a)+y*cos(a)};}
};
int n,d; double t;
nd a0,a[N];
double b[N];
bool chk1() {
For(i,1,n) if(abs(a[i].y)<=d) return 1;
bool f1=0,f2=0;
For(i,1,n) if(a[i].x>=0) {
if(a[i].y<0) f1=1;
else if(a[i].y>0) f2=1;
}
return f1 && f2;
}
int main() {
#ifdef LOCAL
freopen(".in","r",stdin);
// freopen(".out","w",stdout);
// freopen(".debug","w",stderr);
#endif
#ifndef with_buffer
ios::sync_with_stdio(0); cin.tie(0);
#endif
cin>>n>>a0.x>>a0.y>>d>>t;
For(i,1,n) cin>>a[i].x>>a[i].y;
if(chk1()) {
For(i,1,n) a[i].rev(); a0.rev();
}
For(i,1,n) b[i]=a[i].getr();
// For(i,1,n) cerr<<b[i]<<" "; cerr<<"\n";
double l,r,l1=0,r1=*min_element(b+1,b+n+1); cmax(l1,r1-pi/2);
while(l1+eps<r1) {
double m=(l1+r1)/2;
bool fl=0;
For(i,1,n) {
fl|=a[i].rot(-m).second<d;
}
if(fl) r1=m; else l1=m;
}
l=(l1+r1)/2;
l1=*max_element(b+1,b+n+1),r1=pi*2; cmin(r1,l1+pi/2);
while(l1+eps<r1) {
double m=(l1+r1)/2;
bool fl=0;
// cerr<<l1<<" "<<m<<" "<<r1<<"\n";
For(i,1,n) {
fl|=a[i].rot(-m).second>-d;
// cerr<<a[i].rot(-m).second<<" ";
}
// cerr<<fl<<" "<<"\n";
if(fl) l1=m; else r1=m;
}
r=(l1+r1)/2;
// cerr<<l<<" "<<r<<"\n";
auto calc=[&](D L,D R) {
return max(0.,min(r,R)-max(l,L));
};
double p0=a0.getr(),s;
if(p0+t<=pi*2) s+=calc(p0,p0+t),t=0;
else s+=calc(p0,pi*2),t-=pi*2-p0;
if(t>eps) {
int k=t/(pi*2);
s+=k*calc(0,pi*2);
s+=calc(0,t-k*pi*2);
}
cout<<setprecision(10)<<s<<"\n";
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 4412kb
input:
3 1 0 1 1 1 2 2 1 2 2
output:
0
result:
wrong answer 1st numbers differ - expected: '1.0000000', found: '0.0000000', error = '1.0000000'