| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 931612 | 12345678 | 원 고르기 (APIO18_circle_selection) | C++17 | 102 ms | 1116 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int nx=5e3+5;
ll n, x[nx], y[nx], r[nx], used[nx], res[nx];
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n;
for (int i=1; i<=n; i++) cin>>x[i]>>y[i]>>r[i];
for (int i=1; i<=n; i++)
{
pair<ll, ll> p={0, 0};
for (int j=1; j<=n; j++) if (!used[j]) p=max(p, {r[j], -j});
if (p.first==0) continue;
for (int j=1; j<=n; j++) if (!used[j]&&((x[-p.second]-x[j])*(x[-p.second]-x[j])+(y[-p.second]-y[j])*(y[-p.second]-y[j])<=(r[-p.second]+r[j])*(r[-p.second]+r[j]))) used[j]=1, res[j]=-p.second;
}
for (int i=1; i<=n; i++) cout<<res[i]<<' ';
}| # | 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... | ||||
