Submission #569926

# Submission time Handle Problem Language Result Execution time Memory
569926 2022-05-28T08:43:39 Z 2017487 Circle selection (APIO18_circle_selection) C++14
0 / 100
3000 ms 13952 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;
    }
    sort(c,c+n,compr);
    for(int i=0;i<n;i++){
        if(eli[i])continue;
        eli[i]=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[i].a[2];
            long long dr=c[i].a[0]-c[i].a[0];
            if(dx*dx+dy*dy<=dr*dr)eli[j]=c[i].a[3];
        }
    }
    for(int i:eli)cout<<i<<" ";
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3057 ms 12788 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3058 ms 13952 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -