# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
698197 | randmac | Mobile (BOI12_mobile) | C++14 | 167 ms | 16452 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <queue>
#include <math.h>
using namespace std;
// https://oj.uz/problem/view/BOI12_mobile
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
// freopen("mobile.in", "r", stdin);
// freopen("mobile.out", "w", stdout);
int N, L;
cin >> N >> L;
vector<pair<int, int>> a(N);
for (int i = 0; i < N; i++) {
cin >> a[i].first >> a[i].second;
}
vector<pair<int, int>> b;
int last_x = -1;
for (auto it : a) {
if (last_x != -1 && it.first == last_x) continue;
b.push_back(it);
last_x = it.first;
}
double ans = -1;
for (int i = 0; i < b.size() - 1; i++) {
int x_sum = b[i].first + b[i + 1].first;
int x_diff = b[i + 1].first - b[i].first;
double y_squared = (b[i + 1].second + b[i].second) * (b[i + 1].second - b[i].second);
double x_0 = ( y_squared / x_diff + x_sum) / 2;
double distance = (b[i].first - x_0) * (b[i].first - x_0) + b[i].second * b[i].second;
ans = max(ans, distance);
}
cout << sqrt(ans) << endl;
}
컴파일 시 표준 에러 (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... |