| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1366071 | khanhphucscratch | Circle selection (APIO18_circle_selection) | C++20 | 3094 ms | 12152 KiB |
#include<bits/stdc++.h>
#define int long long
using namespace std;
int x[300005], y[300005], r[300005];
int dis(int i, int j)
{
int rex = (x[i] - x[j]), rey = (y[i] - y[j]);
return rex*rex+rey*rey;
}
bool deleted[300005];
int ans[300005];
signed main()
{
int n; cin>>n;
for(int i = 1; i <= n; i++) cin>>x[i]>>y[i]>>r[i];
while(true){
int p = 0;
for(int i = 1; i <= n; i++) if(deleted[i] == 0 && r[i] > r[p]) p = i;
if(p == 0) break;
deleted[p] = 1; ans[p] = p;
for(int i = 1; i <= n; i++) if(deleted[i] == 0 && (r[p] + r[i]) * (r[p] + r[i]) >= dis(p, i)){
ans[i] = p; deleted[i] = 1;
}
}
for(int i = 1; i <= n; i++) cout<<ans[i]<<" ";
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
