| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 49316 | WLZ | 원 고르기 (APIO18_circle_selection) | C++17 | 3026 ms | 14552 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, pair<int, pair<int, int>>> circle;
int n;
bool* used;
vector<circle> v;
vector<int> ans;
int main() {
scanf("%d", &n);
used = new bool[n];
memset(used, 0, sizeof (bool) * n);
priority_queue<circle> pq;
ans.resize(n);
for (int i = 0; i < n; i++) {
int x, y, r;
scanf("%d %d %d", &x, &y, &r);
pq.push({r, {-i, {x, y}}});
v.push_back({r, {-i, {x, y}}});
}
while (!pq.empty()) {
circle cur = pq.top(); pq.pop();
int x = cur.second.second.first;
int y = cur.second.second.second;
if (used[-cur.second.first]) continue;
used[-cur.second.first] = true;
ans[-cur.second.first] = -cur.second.first;
for (int i = 0; i < n; i++) {
if (hypot(v[i].second.second.first - x, v[i].second.second.second - y) <= double(cur.first + v[i].first)) {
used[i] = true;
ans[i] = -cur.second.first;
}
}
}
for (int i = 0; i < n; i++) {
if (i) printf(" ");
printf("%d", ans[i] + 1);
}
printf("\n");
return 0;
}
컴파일 시 표준 에러 (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... | ||||
