# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
134923 | Lawliet | Circle selection (APIO18_circle_selection) | C++14 | 326 ms | 19776 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define MAX 5010
#define R first.first
#define X second.first
#define Y second.second
using namespace std;
typedef long long int lli;
typedef pair<lli,lli> pii;
typedef pair<pii,pii> circle;
int n;
int n1, n2, n3, n4;
int removed[MAX];
vector<circle> v;
bool intersect(int i, int j)
{
lli sR = v[i].R + v[j].R; sR = -sR;
lli dX = v[i].X - v[j].X;
lli dY = v[i].Y - v[j].Y;
return (dX*dX <= (sR + dY)*(sR - dY));
}
int main()
{
scanf("%d",&n);
memset(removed , -1 , sizeof(removed));
for(int g = 1 ; g <= n ; g++)
{
scanf("%d %d %d",&n1,&n2,&n3);
circle k;
k = {{-n3 , g} , {n1 , n2}};
v.push_back( k );
}
sort(v.begin() , v.end());
for(int g = 0 ; g < n ; g++)
{
int curInd = v[g].first.second;
if(removed[curInd] != -1) continue;
for(int h = g ; h < n ; h++)
{
if(intersect(g , h))
{
int ind = v[h].first.second;
removed[ind] = curInd;
}
}
}
for(int g = 1 ; g <= n ; g++)
printf("%d ",removed[g]);
}
컴파일 시 표준 에러 (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... |