## Submission #314058

# Submission time Handle Problem Language Result Execution time Memory
314058 2020-10-18T03:33:43 Z shrek12357 Mobile (BOI12_mobile) C++14
8 / 100
1000 ms 8836 KB
```#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <climits>
#include <cmath>
#include <fstream>
#include <queue>
#include <stack>
#include <bitset>
using namespace std;
#define ll long long
//cin.tie(0); ios_base::sync_with_stdio(0);

int n, l;
vector<pair<int, int>> points;

bool check(double mid) {
double left = 0;
for (int i = 0; i < points.size(); i++) {
if (mid < points[i].second) {
continue;
}
double temp = sqrt(mid*mid - points[i].second*points[i].second);
if (points[i].first - temp <= left) {
left = max(points[i].first + temp, left);
}
}
return left >= l;
}

int main() {
cin >> n >> l;
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
points.push_back({ a, b });
}
double lo = 0;
double hi = 1e10;
double ans = 1e10;
while (hi - lo > 1e-3) {
double mid = (lo + hi) / 2;
if (check(mid)) {
ans = min(ans, mid);
hi = mid;
}
else {
lo = mid;
}
}
cout << ans << endl;
}```

### Compilation message

```mobile.cpp: In function 'bool check(double)':
mobile.cpp:22:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
22 |  for (int i = 0; i < points.size(); i++) {
|                  ~~^~~~~~~~~~~~~~~```

#### Subtask #1 4.0 / 4.0

# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct

#### Subtask #2 4.0 / 4.0

# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct

#### Subtask #3 0 / 4.0

# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Incorrect 4 ms 384 KB Output isn't correct

#### Subtask #4 0 / 4.0

# Verdict Execution time Memory Grader output
1 Correct 7 ms 384 KB Output is correct
2 Incorrect 8 ms 512 KB Output isn't correct
3 Halted 0 ms 0 KB -

#### Subtask #5 0 / 4.0

# Verdict Execution time Memory Grader output
1 Correct 7 ms 384 KB Output is correct
2 Incorrect 8 ms 512 KB Output isn't correct
3 Halted 0 ms 0 KB -

#### Subtask #6 0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 7 ms 384 KB Output is correct
2 Incorrect 8 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -

#### Subtask #7 0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 101 ms 1520 KB Output is correct
2 Incorrect 124 ms 2692 KB Output isn't correct
3 Halted 0 ms 0 KB -

#### Subtask #8 0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 100 ms 1520 KB Output is correct
2 Correct 111 ms 2416 KB Output is correct
3 Incorrect 139 ms 2544 KB Output isn't correct
4 Halted 0 ms 0 KB -

#### Subtask #9 0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 96 ms 1520 KB Output is correct
2 Incorrect 127 ms 1520 KB Output isn't correct
3 Halted 0 ms 0 KB -

#### Subtask #10 0 / 5.0

# Verdict Execution time Memory Grader output
1 Incorrect 167 ms 1520 KB Output isn't correct
2 Halted 0 ms 0 KB -

#### Subtask #11 0 / 5.0

# Verdict Execution time Memory Grader output
1 Incorrect 167 ms 1520 KB Output isn't correct
2 Halted 0 ms 0 KB -

#### Subtask #12 0 / 5.0

# Verdict Execution time Memory Grader output
1 Incorrect 575 ms 4608 KB Output isn't correct
2 Halted 0 ms 0 KB -

#### Subtask #13 0 / 5.0

# Verdict Execution time Memory Grader output
1 Incorrect 855 ms 4608 KB Output isn't correct
2 Halted 0 ms 0 KB -

#### Subtask #14 0 / 5.0

# Verdict Execution time Memory Grader output
1 Incorrect 702 ms 8668 KB Output isn't correct
2 Halted 0 ms 0 KB -

#### Subtask #15 0 / 5.0

# Verdict Execution time Memory Grader output
1 Execution timed out 1042 ms 8724 KB Time limit exceeded
2 Halted 0 ms 0 KB -

#### Subtask #16 0 / 5.0

# Verdict Execution time Memory Grader output
1 Incorrect 810 ms 8740 KB Output isn't correct
2 Halted 0 ms 0 KB -

#### Subtask #17 0 / 5.0

# Verdict Execution time Memory Grader output
1 Execution timed out 1084 ms 8704 KB Time limit exceeded
2 Halted 0 ms 0 KB -

#### Subtask #18 0 / 5.0

# Verdict Execution time Memory Grader output
1 Incorrect 946 ms 8796 KB Output isn't correct
2 Halted 0 ms 0 KB -

#### Subtask #19 0 / 5.0

# Verdict Execution time Memory Grader output
1 Execution timed out 1083 ms 8720 KB Time limit exceeded
2 Halted 0 ms 0 KB -

#### Subtask #20 0 / 5.0

# Verdict Execution time Memory Grader output
1 Execution timed out 1083 ms 8836 KB Time limit exceeded
2 Halted 0 ms 0 KB -

#### Subtask #21 0 / 5.0

# Verdict Execution time Memory Grader output
1 Execution timed out 1056 ms 8672 KB Time limit exceeded
2 Halted 0 ms 0 KB -