Submission #842335

#TimeUsernameProblemLanguageResultExecution timeMemory
842335a5a7Mobile (BOI12_mobile)C++14
8 / 100
265 ms16088 KiB
#include <bits/stdc++.h> #define ALL(x) (x).begin(), (x).end() #define REP(i, a, b) for (int i = (a); i < (b); i++) #define READ(arr, n) for (int i = 0; i < (n); i++) cin >> arr[i]; #define ABS(a) (max((a), -(a))) #define MOD 1000000007 using namespace std; typedef long double ld; typedef long long ll; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; ll len; cin >> n >> len; ll x[n], y[n]; for (int i = 0; i < n; i++) cin >> x[i] >> y[i]; double left = 1, right = 1.5e9; while ((right-left)>1e-3){ double mid = (left+right)/2, curr = 0; for (int i = 0; i < n; i++){ if (y[i]>mid) continue; double sq = sqrt(mid*mid-y[i]*y[i]); double l = x[i]-sq, r = x[i]+sq; if (curr > l) curr = max(curr, r); } if (curr >= len){ right = mid; }else{ left = mid; } } cout << left << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...