fork download
  1. #include<bits/stdc++.h>
  2. #define f1(i, n) for(ll i=1;i<=n;++i)
  3. #define f0(i, n) for(ll i=0;i<n;++i)
  4. #define ull unsigned long long
  5. #define ll long long
  6. #define rev(a) reverse(a.begin(),a.end())
  7. #define all(x) x.begin(),x.end()
  8. #define so(A, n) sort(A+1, A+n+1)
  9. using namespace std;
  10. const int maxn = 200010;
  11. const int N = 1e5 + 1;
  12. pair<double, pair<double, double>> A[N], B[N];
  13. int main()
  14. {
  15. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  16. int n;
  17. cin >> n;
  18. f1(i, n) {
  19. cin >> A[i].second.first >> A[i].second.second;
  20. if (A[i].second.first == 0 || A[i].second.second == 0) {
  21. A[i].first = max(abs(A[i].second.first), abs(A[i].second.second));
  22. }
  23. else{
  24. A[i].first = sqrt(A[i].second.first * A[i].second.first + A[i].second.second * A[i].second.second);
  25. }
  26. }
  27. f1(i, n) {
  28. cin >> B[i].second.first >> B[i].second.second;
  29. if (B[i].second.first == 0 || B[i].second.second == 0) {
  30. B[i].first = max(abs(B[i].second.first), abs(B[i].second.second));
  31. }
  32. else{
  33. B[i].first = sqrt(B[i].second.first * B[i].second.first + B[i].second.second * B[i].second.second);
  34. }
  35. }
  36. sort(B + 1, B + n + 1);
  37. sort(A + 1, A + n + 1);
  38. // f1(i, n) {
  39. // cout << A[i].first << " " << A[i].second.first << " " << A[i].second.second;
  40. // cout<<endl;
  41. // }
  42. // f1(i, n) {
  43. // cout << B[i].first << " " << B[i].second.first << " " << B[i].second.second;
  44. // cout<<endl;
  45. // }
  46. f1(i, n) {
  47. int it = upper_bound(B + 1, B + n + 1, make_pair(A[i].first, make_pair((double)LLONG_MAX, (double)LLONG_MAX))) - B - 1;
  48. if(it == i){
  49. cout<<fixed<<setprecision(6)<<A[i].first;
  50. return 0;
  51. }
  52. }
  53.  
  54. return 0;
  55. }
  56.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
0.000000