Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- typedef long long ll;
- typedef long double ld;
- using namespace std;
- int a[6283186];
- const ld pi=acos(-1);
- int main()
- {
- /* while(1)
- {
- ld x,y;
- cin>>x>>y;
- cout<<atan2(x,y);
- }*/
- int x0,y0,v,t;
- cin>>x0>>y0>>v>>t;
- int n;
- cin>>n;
- for(int i=0;i<n;i++)
- {
- int x,y,r;
- cin>>x>>y>>r;
- x-=x0,y-=y0;
- ld d= hypot(x,y);
- if(d-r<=0){
- cout<<1;
- return 0;
- }
- if(d-r>v*t)continue;
- ld theta=atan2(y*1.0,x*1.0);
- if(theta<0)theta+=2*pi;
- ld psi =acos(r/d);
- int in,on;
- in =1e6*(theta-psi);
- on=1e6*(theta+psi);
- a[in]++;
- a[on]--;
- // cout<<in<<' '<<on<<endl;
- }
- ld h=0;
- int fl=0;
- for(int i=0;i<6283186;i++)
- {
- fl+=a[i];
- if(fl)h++;
- }
- ld ans=h/(2*pi*1e6);
- cout<<fixed(;
- cout.precision(8);
- cout<<ans;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement