fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define int long long
  5. #define fi first
  6. #define se second
  7. #define pb push_back
  8. #define SQR(x) (1LL * (x) * (x))
  9. #define debug cout << "ok\n";
  10.  
  11. const double PI = acos(-1.0);
  12.  
  13. int32_t main() {
  14. ios::sync_with_stdio(false);
  15. cin.tie(0);
  16.  
  17. int n;
  18. cin >> n;
  19.  
  20. vector<pair<int,int>> a(n);
  21. for (int i = 0; i < n; i++) cin >> a[i].fi >> a[i].se;
  22.  
  23. double angle;
  24. double X, Y;
  25. cin >> angle >> X >> Y;
  26.  
  27. vector<double> ang;
  28. int same = 0;
  29.  
  30. for (auto [x, y] : a) {
  31. double dx = x - X, dy = y - Y;
  32. if (dx == 0 && dy == 0) {
  33. same++;
  34. continue;
  35. }
  36. double theta = atan2(dy, dx) * 180.0 / PI;
  37. if (theta < 0) theta += 360.0;
  38. ang.pb(theta);
  39. }
  40.  
  41. sort(ang.begin(), ang.end());
  42. int m = ang.size();
  43. for (int i = 0; i < m; i++) ang.pb(ang[i] + 360.0);
  44.  
  45. int res = 0;
  46. int j = 0;
  47. for (int i = 0; i < m; i++) {
  48. while (j < (int)ang.size() && ang[j] - ang[i] <= angle + 1e-9) j++;
  49. res = max(res, j - i);
  50. }
  51.  
  52. cout << res + same << "\n";
  53. return 0;
  54. }
  55.  
Success #stdin #stdout 0.01s 5276KB
stdin
3
2 1
2 2
3 3
90 1 1
stdout
3