QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#862394 | #9576. Ordainer of Inexorable Judgment | chenyiwei27 | WA | 0ms | 3968kb | C++17 | 3.4kb | 2025-01-19 00:39:48 | 2025-01-19 00:39:50 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define maxn 105
using namespace std;
const ld pi=(3.141592653589793238462643383);
ll input(){
ll ans=0;
char c=getchar();
bool flag=0;
while(c<'0'||c>'9'){
if(c=='-')flag=1;
c=getchar();
}
while(c>='0'&&c<='9'){
ans=ans*10+c-'0';
c=getchar();
}
if(flag)ans=-ans;
return ans;
}
void print(ll ans,char c=0,bool flag=1){
if(ans<0){
putchar('-');
ans=-ans;
}
if(ans>=10)print(ans/10,c,0);
putchar('0'+ans%10);
if(flag&&c!=0)putchar(c);
}
ll n,x0,yy,d,cnt,circle;
ld rou[maxn],thita[maxn],kthita[maxn<<1],t,ans;
bool cmp(ld a,ld b){
return(a<b);
}
int main(){
n=input();x0=input();yy=input();d=input();t=input();
circle=1.0*t/(2*pi);
t=t-circle*2*pi;
bool flag1=0,flag2=0;
for(ll i=1;i<=n;i++){
ll x=input(),y=input();
if(x>0&&y>0)flag1=1;
if(x>0&&y<0)flag2=1;
rou[i]=x*x+y*y;
ld k;
if(x!=0)k=1.0*y/x;
if(x!=0)thita[i]=atan(k);
if(x>0&&y==0){
thita[i]=0;
}
if(x<0&&y==0){
thita[i]=pi;
}
if(x==0&&y>0){
thita[i]=pi/2;
}
if(x==0&&y<0){
thita[i]=3*pi/2;
}
if(y<0&&x<0){
thita[i]=thita[i]+pi;
}
if(x<0&&y>0){
thita[i]=thita[i]+pi;
}
if(x>0&&y<0){
thita[i]=thita[i]+2*pi;
}
}
if(flag1&&flag2){
for(ll i=1;i<=n;i++){
if(thita[i]>pi)thita[i]=thita[i]-2*pi;
}
}
//for(ll i=1;i<=n;i++)cout<<thita[i]<<' '<<endl;
for(ll i=1;i<=n;i++){
ld now=asin(sqrt(1.0*d*d/rou[i]));
kthita[++cnt]=thita[i]+now;
kthita[++cnt]=thita[i]-now;
}
//for(ll i=1;i<=cnt;i++)cout<<kthita[i]<<endl;
sort(kthita+1,kthita+cnt+1,cmp);
ans=circle*(kthita[cnt]-kthita[1]);
// printf("angle %0.10Lf\n",kthita[cnt]-kthita[1]);
ld thita0,k;
if(x0!=0)k=1.0*yy/x0;
if(x0!=0)thita0=atan(k);
if(x0>0&&yy==0){
thita0=0;
}
if(x0<0&&yy==0){
thita0=pi;
}
if(x0==0&&yy>0){
thita0=pi/2;
}
if(x0==0&&yy<0){
thita0=3*pi/2;
}
if(yy<0&&x0<0){
thita0=thita0+pi;
}
if(x0<0&&yy>0){
thita0=thita0+pi;
}
if(x0>0&&yy<0){
thita0=thita0+2*pi;
}
/* if(flag1&&flag2){
thita0=thita0-2*pi;
}*/
while(thita0>kthita[cnt]){
thita0=thita0-2*pi;
}
ld thitat=thita0+t;
if(thitat<kthita[1]){
}
else if(2*pi-t<kthita[cnt]-kthita[1]&&(thitat>kthita[1]+2*pi||(thitat>kthita[1]&&thitat-kthita[1]<=pi/2))&&(kthita[cnt]>thita0+2*pi||(kthita[cnt]>thita0&&kthita[cnt]-thita0<=pi))){
/*if(thitat>kthita[1]+2*pi)*/ans=ans+thitat-kthita[1]-2*pi+kthita[cnt]-thita0;
/*else ans=ans+thitat-kthita[1]+kthita[cnt]-thita0;*/
cout<<22<<endl;
}
else{
ans=ans+min(thitat,kthita[cnt])-max(thita0,kthita[1]);
cout<<33<<endl;
}
cout<<t<<' '<<thitat<<" "<<thita0<<" "<<kthita[cnt]<<" "<<kthita[1]<<endl;
printf("%.15Lf\n",ans);
return 0;
}
/*
3 0 -1 1 1
2 -1
1 -2
2 -2
3 0 -1 1 2
2 -1
1 -2
2 -2
3 0 -1 1 10000
2 -1
1 -2
2 -2
3 0 -1 1 5
-2 -1
-1 -2
-2 -2
3 10000 10000 1 10000
10000 9999
10000 10000
9999 10000
25 -5212 -3307 3213 9807
-8651 3425
-8608 2890
-8399 2503
-8247 2230
-8135 2085
-8009 1935
-7593 1637
-7417 1512
-6970 1450
-6316 1388
-6030 1478
-5588 1674
-5323 1882
-4788 2794
-4747 2896
-4855 3889
-4949 4158
-5050 4422
-5377 4814
-5501 4953
-5989 5188
-6221 5243
-6566 5324
-7210 5255
-7874 4929
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3968kb
input:
3 1 0 1 1 1 2 2 1 2 2
output:
33 1 1 0 1.5708 0 1.000000000000000
result:
wrong answer 1st numbers differ - expected: '1.0000000', found: '33.0000000', error = '32.0000000'