# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
952351 | coolsentenceidontremember | Mobile (BOI12_mobile) | C++17 | 510 ms | 35284 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define ff first
#define ss second
#define db double
using namespace std;
void setIO(string s = ""){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
if (s.size()){
freopen((s+".in").c_str(), "r", stdin);
freopen((s+".out").c_str(), "w", stdout);
}
}
ll pow_mod(ll a, ll b, ll m){
ll res = 1;
a%=m;
for (; b; b>>=1, a = (a*a)%m){
if (b&1) res = (res*a)%m;
}
return res;
}
ll pow(ll a, ll b){
ll res = 1;
for (; b; b>>=1, a*=a){
if (b&1) res *= a;
}
return res;
}
void GiveMeAnswer(){
int n;
db len;
cin >> n >> len;
pair<db, db> station[n];
for (auto &a : station) cin >> a.ff >> a.ss;
double l = 0, r = 1.5e9;
while (r-l>1e-4){
db m = (l+r)/2, mx = 0;
for (int i = 0; i < n; i++){
db p = m*m-station[i].ss*station[i].ss;
if (p<0) continue;
p = sqrt(p);
db start = station[i].ff-p, end = station[i].ff+p;
if (start<mx) mx = max(mx, end);
}
if (mx>=len) r = m;
else l = m;
}
cout << fixed << setprecision(6) << l << '\n';
}
int main(){
auto begin = chrono::high_resolution_clock::now();
setIO();
int tt = 1;
//cin >> tt;
for (int t = 1; t <= tt; t++) GiveMeAnswer();
auto end = chrono::high_resolution_clock::now();
// super cool C++ timer
auto elapsed = chrono::duration_cast<chrono::nanoseconds>(end-begin);
auto fulltime = elapsed.count()*1e-9;
cerr << "\n\nExecution time: " << fulltime << " seconds.\n";
if (fulltime>1) cerr << "TLE!1!!1!!11!!1 C= C= C= C= C=+(;·w·)+";
else cerr << "You safe brother";
return 0;
}
Compilation message (stderr)
# | 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... |