Advertisement
jeff69

655E

Jun 17th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
4CS 1.08 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. typedef long long ll;
  3.  
  4. typedef long double ld;
  5. using namespace std;
  6.  
  7. int a[6283186];
  8. const ld pi=acos(-1);
  9.  
  10. int main()
  11. {
  12.  
  13.        /* while(1)
  14.         {
  15.  
  16.             ld x,y;
  17.             cin>>x>>y;
  18.             cout<<atan2(x,y);
  19.         }*/
  20.     int x0,y0,v,t;
  21.     cin>>x0>>y0>>v>>t;
  22.  
  23.     int n;
  24.  
  25.     cin>>n;
  26.     for(int i=0;i<n;i++)
  27.     {
  28.         int x,y,r;
  29.         cin>>x>>y>>r;
  30.         x-=x0,y-=y0;
  31.         ld d= hypot(x,y);
  32.         if(d-r<=0){
  33.             cout<<1;
  34.             return 0;
  35.         }
  36.         if(d-r>v*t)continue;
  37.         ld theta=atan2(y*1.0,x*1.0);
  38.         if(theta<0)theta+=2*pi;
  39.         ld psi =acos(r/d);
  40.         int in,on;
  41.         in =1e6*(theta-psi);
  42.         on=1e6*(theta+psi);
  43.         a[in]++;
  44.         a[on]--;
  45.        // cout<<in<<' '<<on<<endl;
  46.  
  47.     }
  48.         ld h=0;
  49.         int fl=0;
  50.         for(int i=0;i<6283186;i++)
  51.         {
  52.  
  53.             fl+=a[i];
  54.             if(fl)h++;
  55.         }
  56.         ld ans=h/(2*pi*1e6);
  57.         cout<<fixed(;
  58.         cout.precision(8);
  59.         cout<<ans;
  60.  
  61.     return 0;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement