## 답안 #314063

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
314063 2020-10-18T03:43:33 Z shrek12357 Mobile (BOI12_mobile) C++14
90 / 100
1000 ms 16128 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);

const int MAXN = 1e6 + 5;

double n, l;
vector<pair<double, double>> points(MAXN);

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 (temp + points[i].first <= left) {
continue;
}
if (points[i].first - temp <= left) {
left = 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[i] = make_pair( 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:24: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]
24 |  for (int i = 0; i < points.size(); i++) {
|                  ~~^~~~~~~~~~~~~~~
mobile.cpp:36:39: warning: right operand of comma operator has no effect [-Wunused-value]
36 |    left = points[i].first + temp, left;
|                                       ^```

#### Subtask #1 4.0 / 4.0

# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 16000 KB Output is correct
2 Correct 38 ms 16000 KB Output is correct
3 Correct 42 ms 16000 KB Output is correct
4 Correct 54 ms 16000 KB Output is correct

#### Subtask #2 4.0 / 4.0

# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 16000 KB Output is correct
2 Correct 37 ms 16000 KB Output is correct
3 Correct 59 ms 16000 KB Output is correct
4 Correct 75 ms 16000 KB Output is correct

#### Subtask #3 4.0 / 4.0

# 결과 실행 시간 메모리 Grader output
1 Correct 54 ms 16000 KB Output is correct
2 Correct 44 ms 16120 KB Output is correct
3 Correct 67 ms 16056 KB Output is correct
4 Correct 72 ms 16000 KB Output is correct

#### Subtask #4 4.0 / 4.0

# 결과 실행 시간 메모리 Grader output
1 Correct 57 ms 16056 KB Output is correct
2 Correct 101 ms 16120 KB Output is correct
3 Correct 82 ms 16000 KB Output is correct
4 Correct 84 ms 16000 KB Output is correct

#### Subtask #5 4.0 / 4.0

# 결과 실행 시간 메모리 Grader output
1 Correct 74 ms 16120 KB Output is correct
2 Correct 102 ms 16000 KB Output is correct
3 Correct 55 ms 16000 KB Output is correct
4 Correct 95 ms 16000 KB Output is correct

#### Subtask #6 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 90 ms 16000 KB Output is correct
2 Correct 101 ms 16000 KB Output is correct
3 Correct 78 ms 16000 KB Output is correct
4 Correct 95 ms 16000 KB Output is correct
5 Correct 61 ms 16000 KB Output is correct

#### Subtask #7 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 114 ms 16056 KB Output is correct
2 Correct 164 ms 16120 KB Output is correct
3 Correct 88 ms 16128 KB Output is correct
4 Correct 158 ms 16128 KB Output is correct
5 Correct 67 ms 16000 KB Output is correct

#### Subtask #8 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 94 ms 16000 KB Output is correct
2 Correct 103 ms 16000 KB Output is correct
3 Correct 134 ms 16000 KB Output is correct
4 Correct 155 ms 16000 KB Output is correct
5 Correct 184 ms 16120 KB Output is correct

#### Subtask #9 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 139 ms 16000 KB Output is correct
2 Correct 145 ms 16120 KB Output is correct
3 Correct 102 ms 16120 KB Output is correct
4 Correct 200 ms 16000 KB Output is correct
5 Correct 105 ms 16000 KB Output is correct

#### Subtask #10 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 234 ms 16056 KB Output is correct
2 Correct 180 ms 16000 KB Output is correct
3 Correct 134 ms 16000 KB Output is correct
4 Correct 198 ms 16124 KB Output is correct
5 Correct 140 ms 16000 KB Output is correct

#### Subtask #11 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 151 ms 16056 KB Output is correct
2 Correct 184 ms 16120 KB Output is correct
3 Correct 136 ms 16052 KB Output is correct
4 Correct 194 ms 16000 KB Output is correct
5 Correct 134 ms 16000 KB Output is correct

#### Subtask #12 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 411 ms 16120 KB Output is correct
2 Correct 408 ms 16056 KB Output is correct
3 Correct 384 ms 16056 KB Output is correct
4 Correct 542 ms 16056 KB Output is correct
5 Correct 450 ms 16000 KB Output is correct

#### Subtask #13 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 478 ms 16120 KB Output is correct
2 Correct 426 ms 16124 KB Output is correct
3 Correct 332 ms 16000 KB Output is correct
4 Correct 548 ms 16052 KB Output is correct
5 Correct 471 ms 16000 KB Output is correct

#### Subtask #14 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 471 ms 16048 KB Output is correct
2 Correct 456 ms 16000 KB Output is correct
3 Correct 406 ms 16052 KB Output is correct
4 Correct 669 ms 16000 KB Output is correct
5 Correct 522 ms 16120 KB Output is correct

#### Subtask #15 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 536 ms 16000 KB Output is correct
2 Correct 489 ms 16052 KB Output is correct
3 Correct 394 ms 16000 KB Output is correct
4 Correct 672 ms 16052 KB Output is correct
5 Correct 566 ms 16060 KB Output is correct

#### Subtask #16 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 510 ms 16120 KB Output is correct
2 Correct 530 ms 16000 KB Output is correct
3 Correct 518 ms 16056 KB Output is correct
4 Correct 767 ms 16056 KB Output is correct
5 Correct 583 ms 16060 KB Output is correct

#### Subtask #17 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 582 ms 16000 KB Output is correct
2 Correct 547 ms 16052 KB Output is correct
3 Correct 450 ms 16000 KB Output is correct
4 Correct 745 ms 16048 KB Output is correct
5 Correct 638 ms 16000 KB Output is correct

#### Subtask #18 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 574 ms 16124 KB Output is correct
2 Correct 584 ms 16000 KB Output is correct
3 Correct 535 ms 16056 KB Output is correct
4 Correct 852 ms 16056 KB Output is correct
5 Correct 684 ms 16120 KB Output is correct

#### Subtask #19 5.0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 650 ms 16052 KB Output is correct
2 Correct 616 ms 16120 KB Output is correct
3 Correct 476 ms 16000 KB Output is correct
4 Correct 851 ms 16000 KB Output is correct
5 Correct 709 ms 16120 KB Output is correct

#### Subtask #20 0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 718 ms 16056 KB Output is correct
2 Correct 676 ms 16120 KB Output is correct
3 Correct 689 ms 16048 KB Output is correct
4 Execution timed out 1037 ms 16120 KB Time limit exceeded
5 Halted 0 ms 0 KB -

#### Subtask #21 0 / 5.0

# 결과 실행 시간 메모리 Grader output
1 Correct 779 ms 16120 KB Output is correct
2 Correct 745 ms 16120 KB Output is correct
3 Correct 614 ms 16120 KB Output is correct
4 Execution timed out 1020 ms 16120 KB Time limit exceeded
5 Halted 0 ms 0 KB -