답안 #569937

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
569937 2022-05-28T09:24:13 Z 2017487 원 고르기 (APIO18_circle_selection) C++14
0 / 100
3000 ms 8188 KB
#include<bits/stdc++.h>
using namespace std;

struct circle{
    //radius,x,y,index
    int a[4];
};

bool compr(circle p,circle q){
    if(p.a[0]==q.a[0])return p.a[3]<q.a[3];
    return p.a[0]>q.a[0];
}

int main(){
    int n;cin>>n;
    circle c[n];
    int eli[n]={0};
    for(int i=0;i<n;i++){
        cin>>c[i].a[1]>>c[i].a[2]>>c[i].a[0];
        c[i].a[3]=i+1;
        eli[i]=0;
    }
    sort(c,c+n,compr);
    for(int i=0;i<n;i++){
        if(eli[c[i].a[3]-1])continue;
        eli[c[i].a[3]-1]=c[i].a[3];
        for(int j=i+1;j<n;j++){
            long long dx=c[i].a[1]-c[j].a[1];
            long long dy=c[i].a[2]-c[j].a[2];
            long long dr=c[i].a[0]+c[j].a[0];
            if(dx*dx+dy*dy<=dr*dr)eli[c[j].a[3]-1]=c[i].a[3];
        }
    }
    for(int i:eli)cout<<i<<" ";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Incorrect 1 ms 212 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 352 ms 8188 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 3077 ms 2132 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3083 ms 6140 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Incorrect 1 ms 212 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Incorrect 1 ms 212 KB Output isn't correct
9 Halted 0 ms 0 KB -