#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++){
if(eli[c[j].a[3]-1])continue;
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 |
0 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 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
2 ms |
340 KB |
Output is correct |
17 |
Correct |
2 ms |
340 KB |
Output is correct |
18 |
Correct |
2 ms |
340 KB |
Output is correct |
19 |
Correct |
7 ms |
544 KB |
Output is correct |
20 |
Correct |
8 ms |
468 KB |
Output is correct |
21 |
Correct |
8 ms |
468 KB |
Output is correct |
22 |
Correct |
35 ms |
516 KB |
Output is correct |
23 |
Correct |
34 ms |
468 KB |
Output is correct |
24 |
Correct |
37 ms |
520 KB |
Output is correct |
25 |
Correct |
35 ms |
468 KB |
Output is correct |
26 |
Correct |
38 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
367 ms |
8192 KB |
Output is correct |
2 |
Correct |
347 ms |
14892 KB |
Output is correct |
3 |
Correct |
376 ms |
14676 KB |
Output is correct |
4 |
Correct |
346 ms |
14960 KB |
Output is correct |
5 |
Execution timed out |
3047 ms |
10740 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Execution timed out |
3069 ms |
2132 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3091 ms |
6144 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 |
0 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 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
2 ms |
340 KB |
Output is correct |
17 |
Correct |
2 ms |
340 KB |
Output is correct |
18 |
Correct |
2 ms |
340 KB |
Output is correct |
19 |
Correct |
7 ms |
544 KB |
Output is correct |
20 |
Correct |
8 ms |
468 KB |
Output is correct |
21 |
Correct |
8 ms |
468 KB |
Output is correct |
22 |
Correct |
35 ms |
516 KB |
Output is correct |
23 |
Correct |
34 ms |
468 KB |
Output is correct |
24 |
Correct |
37 ms |
520 KB |
Output is correct |
25 |
Correct |
35 ms |
468 KB |
Output is correct |
26 |
Correct |
38 ms |
468 KB |
Output is correct |
27 |
Correct |
19 ms |
724 KB |
Output is correct |
28 |
Correct |
13 ms |
724 KB |
Output is correct |
29 |
Correct |
16 ms |
724 KB |
Output is correct |
30 |
Correct |
120 ms |
752 KB |
Output is correct |
31 |
Correct |
122 ms |
696 KB |
Output is correct |
32 |
Correct |
148 ms |
752 KB |
Output is correct |
33 |
Correct |
140 ms |
5940 KB |
Output is correct |
34 |
Correct |
138 ms |
6060 KB |
Output is correct |
35 |
Correct |
135 ms |
5676 KB |
Output is correct |
36 |
Execution timed out |
3019 ms |
4664 KB |
Time limit exceeded |
37 |
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 |
0 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 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
2 ms |
340 KB |
Output is correct |
17 |
Correct |
2 ms |
340 KB |
Output is correct |
18 |
Correct |
2 ms |
340 KB |
Output is correct |
19 |
Correct |
7 ms |
544 KB |
Output is correct |
20 |
Correct |
8 ms |
468 KB |
Output is correct |
21 |
Correct |
8 ms |
468 KB |
Output is correct |
22 |
Correct |
35 ms |
516 KB |
Output is correct |
23 |
Correct |
34 ms |
468 KB |
Output is correct |
24 |
Correct |
37 ms |
520 KB |
Output is correct |
25 |
Correct |
35 ms |
468 KB |
Output is correct |
26 |
Correct |
38 ms |
468 KB |
Output is correct |
27 |
Correct |
367 ms |
8192 KB |
Output is correct |
28 |
Correct |
347 ms |
14892 KB |
Output is correct |
29 |
Correct |
376 ms |
14676 KB |
Output is correct |
30 |
Correct |
346 ms |
14960 KB |
Output is correct |
31 |
Execution timed out |
3047 ms |
10740 KB |
Time limit exceeded |
32 |
Halted |
0 ms |
0 KB |
- |