| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1329914 | pranvesh | Mobile (BOI12_mobile) | C++20 | 344 ms | 15996 KiB |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using ll = long long;
#define ret(x) {cout << x << "\n"; return;}
#define pb push_back
#define MOD 998244353
#define mod 1000000007
#define retarr(arr) {for (auto &x : arr) cout << x << " "; cout << "\n"; return;}
#define N 1000005
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define input(arr) for (auto &it: arr) cin >> it;
#define INF (ll)(1e12+5)
typedef __gnu_pbds::tree<int, __gnu_pbds::null_type, less<int>, __gnu_pbds::rb_tree_tag,
__gnu_pbds::tree_order_statistics_node_update> ordered_set;
void solve() {
ll n, len;
cin >> n >> len;
vector<pair<ll,ll>> arr(n);
for (int i = 0; i<n; i++) {
cin >> arr[i].F >> arr[i].S;
}
auto check = [&](double mid) {
double cur = 0;
for (int i = 0; i<n; i++) {
double delta = sqrt(mid*mid - arr[i].S*arr[i].S);
double a = arr[i].F-delta, b = arr[i].F+delta;
if (cur >= a) cur = max(cur, b);
}
if (cur >= len) return true;
return false;
};
double l = 1, r = 1e18;
double ans = r;
double dif = 1e-3;
while (r-l > dif) {
double mid = (l+r)/2.0;
if (check(mid)) {
r = mid;
ans = mid;
}
else l = mid;
}
cout << fixed << setprecision(4) << ans << "\n";
}
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
int t = 1;
// cin >> t;
while(t--) solve();
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
