# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305205 | 2020-09-22T17:39:55 Z | oleksg | Mobile (BOI12_mobile) | C++14 | 1000 ms | 57056 KB |
#include <fstream> #include <string> #include <iostream> #include <math.h> #include <algorithm> #include<bits/stdc++.h> #include <vector> using namespace std; long long n, l; vector<pair<long long, long long>> points; bool ok(double cur){ vector<pair<double, double>> segs; for (int x = 0; x < points.size(); x++){ double curx = points[x].first; double cury = abs(points[x].second); double xintervals = sqrt(pow(cur, 2) - pow(cury, 2)); double minx = max((double)0, curx - xintervals); double maxx = min((double)l, curx + xintervals); segs.push_back(make_pair(minx, maxx)); } sort(segs.begin(), segs.end()); double curx = 0; for (int x = 0; x < segs.size(); x++){ if (segs[x].second > curx){ if (segs[x].first <= curx){ curx = segs[x].second; } else{ return false; } } } if (curx < l){ return false; } return true; } int main(){ long long one, two; cin >> n >> l; for (int x = 0; x < n; x++){ cin >> one >> two; points.push_back(make_pair(one, two)); } double mi = 0; double ma = 100000000000; while(ma - mi > 0.00001){ double cur = (mi + ma) / 2.0; if (ok(cur)){ ma = cur; } else{ mi = cur + 0.00001; } } cout << setprecision(10) << ma << "\n"; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 8 ms | 512 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 17 ms | 744 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 19 ms | 720 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 21 ms | 716 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 344 ms | 5860 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 354 ms | 5780 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 375 ms | 6144 KB | Output is correct |
2 | Correct | 430 ms | 6208 KB | Output is correct |
3 | Incorrect | 385 ms | 6296 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 463 ms | 7280 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 456 ms | 7212 KB | Output is correct |
2 | Correct | 538 ms | 7208 KB | Output is correct |
3 | Incorrect | 422 ms | 6652 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1090 ms | 28848 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1093 ms | 32688 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1091 ms | 41000 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1087 ms | 45916 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1096 ms | 44928 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1096 ms | 47832 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1093 ms | 49160 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1081 ms | 25844 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1097 ms | 57056 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1088 ms | 25860 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |