## Submission #314061

# Submission time Handle Problem Language Result Execution time Memory
314061 2020-10-18T03:40:07 Z shrek12357 Mobile (BOI12_mobile) C++14
90 / 100
1000 ms 17208 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);

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

bool check(double mid) {
double left = 0;
for (int i = 0; i < points.size(); i++) {
if (left >= l) {
return true;
}
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.tie(0); ios_base::sync_with_stdio(0);
cin >> n >> l;
for (int i = 0; i < n; i++) {
double a, b;
cin >> a >> b;
points.push_back({ a, b });
}
double lo = 0;
double hi = 1e9;
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;
}
}
printf("%.7lf\n", ans);
}```

### 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<double, double> >::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 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct

#### Subtask #2 4.0 / 4.0

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

#### Subtask #3 4.0 / 4.0

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

#### Subtask #4 4.0 / 4.0

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

#### Subtask #5 4.0 / 4.0

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

#### Subtask #6 5.0 / 5.0

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

#### Subtask #7 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 52 ms 2544 KB Output is correct
2 Correct 57 ms 2628 KB Output is correct
3 Correct 32 ms 1532 KB Output is correct
4 Correct 75 ms 2540 KB Output is correct
5 Correct 29 ms 1532 KB Output is correct

#### Subtask #8 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 52 ms 2520 KB Output is correct
2 Correct 57 ms 2552 KB Output is correct
3 Correct 71 ms 2544 KB Output is correct
4 Correct 75 ms 2544 KB Output is correct
5 Correct 88 ms 2544 KB Output is correct

#### Subtask #9 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 57 ms 2552 KB Output is correct
2 Correct 57 ms 2540 KB Output is correct
3 Correct 55 ms 2544 KB Output is correct
4 Correct 107 ms 2540 KB Output is correct
5 Correct 65 ms 2544 KB Output is correct

#### Subtask #10 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 78 ms 2544 KB Output is correct
2 Correct 71 ms 2544 KB Output is correct
3 Correct 61 ms 2544 KB Output is correct
4 Correct 109 ms 2552 KB Output is correct
5 Correct 87 ms 2544 KB Output is correct

#### Subtask #11 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 82 ms 2544 KB Output is correct
2 Correct 72 ms 2544 KB Output is correct
3 Correct 63 ms 2544 KB Output is correct
4 Correct 111 ms 2536 KB Output is correct
5 Correct 85 ms 2544 KB Output is correct

#### Subtask #12 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 356 ms 8680 KB Output is correct
2 Correct 361 ms 8676 KB Output is correct
3 Correct 340 ms 8824 KB Output is correct
4 Correct 533 ms 8676 KB Output is correct
5 Correct 440 ms 8672 KB Output is correct

#### Subtask #13 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 401 ms 8672 KB Output is correct
2 Correct 389 ms 8672 KB Output is correct
3 Correct 329 ms 8684 KB Output is correct
4 Correct 528 ms 8672 KB Output is correct
5 Correct 457 ms 8720 KB Output is correct

#### Subtask #14 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 430 ms 17012 KB Output is correct
2 Correct 441 ms 16852 KB Output is correct
3 Correct 405 ms 17024 KB Output is correct
4 Correct 664 ms 16980 KB Output is correct
5 Correct 524 ms 16888 KB Output is correct

#### Subtask #15 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 504 ms 16936 KB Output is correct
2 Correct 471 ms 16856 KB Output is correct
3 Correct 383 ms 17208 KB Output is correct
4 Correct 669 ms 16856 KB Output is correct
5 Correct 553 ms 16932 KB Output is correct

#### Subtask #16 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 503 ms 16876 KB Output is correct
2 Correct 521 ms 16980 KB Output is correct
3 Correct 505 ms 16852 KB Output is correct
4 Correct 765 ms 17024 KB Output is correct
5 Correct 595 ms 16984 KB Output is correct

#### Subtask #17 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 556 ms 16980 KB Output is correct
2 Correct 538 ms 16852 KB Output is correct
3 Correct 449 ms 16856 KB Output is correct
4 Correct 753 ms 16944 KB Output is correct
5 Correct 646 ms 16980 KB Output is correct

#### Subtask #18 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 571 ms 16852 KB Output is correct
2 Correct 593 ms 16984 KB Output is correct
3 Correct 540 ms 16980 KB Output is correct
4 Correct 880 ms 16852 KB Output is correct
5 Correct 710 ms 16980 KB Output is correct

#### Subtask #19 5.0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 637 ms 16852 KB Output is correct
2 Correct 616 ms 17000 KB Output is correct
3 Correct 499 ms 17004 KB Output is correct
4 Correct 858 ms 16980 KB Output is correct
5 Correct 740 ms 17048 KB Output is correct

#### Subtask #20 0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 715 ms 16856 KB Output is correct
2 Correct 700 ms 16852 KB Output is correct
3 Correct 713 ms 16856 KB Output is correct
4 Execution timed out 1079 ms 16852 KB Time limit exceeded
5 Halted 0 ms 0 KB -

#### Subtask #21 0 / 5.0

# Verdict Execution time Memory Grader output
1 Correct 817 ms 16852 KB Output is correct
2 Correct 752 ms 16852 KB Output is correct
3 Correct 654 ms 16852 KB Output is correct
4 Execution timed out 1080 ms 16872 KB Time limit exceeded
5 Halted 0 ms 0 KB -