#pragma GCC target("avx512f")
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
vector<long long> X(N),Y(N),R(N);
for(int i=0;i<N;i++) cin>>X[i]>>Y[i]>>R[i];
vector<int> A(N,N+1);
vector<pair<long long, long long>> S(N);
for(int i=0;i<N;i++) S[i] = {R[i],N-1-i};
sort(S.rbegin(),S.rend());
for(int i=0;i<N;i++){
int ind = N-1-S[i].second;
if(A[ind] != N+1) continue;
for(int j=0;j<N;j++){
if(A[j] == N+1 && (X[ind]-X[j])*(X[ind]-X[j])+(Y[ind]-Y[j])*(Y[ind]-Y[j]) <= (R[ind]+R[j])*(R[ind]+R[j])){
A[j] = ind+1;
}
}
if(clock()*1.0/CLOCKS_PER_SEC > 2.95){
break;
}
}
for(int i=0;i<N;i++) cout<<(A[i] == N+1 ? i+1 : A[i])<<' ';
cout<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 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 |
0 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 |
0 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 |
8 ms |
468 KB |
Output is correct |
20 |
Correct |
6 ms |
468 KB |
Output is correct |
21 |
Correct |
7 ms |
416 KB |
Output is correct |
22 |
Correct |
51 ms |
504 KB |
Output is correct |
23 |
Correct |
51 ms |
504 KB |
Output is correct |
24 |
Correct |
53 ms |
496 KB |
Output is correct |
25 |
Correct |
51 ms |
496 KB |
Output is correct |
26 |
Correct |
52 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
313 ms |
15272 KB |
Output is correct |
2 |
Correct |
329 ms |
15264 KB |
Output is correct |
3 |
Correct |
320 ms |
15008 KB |
Output is correct |
4 |
Correct |
310 ms |
15260 KB |
Output is correct |
5 |
Incorrect |
2975 ms |
14992 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
2959 ms |
5112 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2975 ms |
15164 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 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 |
0 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 |
0 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 |
8 ms |
468 KB |
Output is correct |
20 |
Correct |
6 ms |
468 KB |
Output is correct |
21 |
Correct |
7 ms |
416 KB |
Output is correct |
22 |
Correct |
51 ms |
504 KB |
Output is correct |
23 |
Correct |
51 ms |
504 KB |
Output is correct |
24 |
Correct |
53 ms |
496 KB |
Output is correct |
25 |
Correct |
51 ms |
496 KB |
Output is correct |
26 |
Correct |
52 ms |
468 KB |
Output is correct |
27 |
Correct |
13 ms |
724 KB |
Output is correct |
28 |
Correct |
13 ms |
792 KB |
Output is correct |
29 |
Correct |
13 ms |
660 KB |
Output is correct |
30 |
Correct |
221 ms |
716 KB |
Output is correct |
31 |
Correct |
214 ms |
732 KB |
Output is correct |
32 |
Correct |
231 ms |
720 KB |
Output is correct |
33 |
Correct |
132 ms |
5328 KB |
Output is correct |
34 |
Correct |
128 ms |
5200 KB |
Output is correct |
35 |
Correct |
124 ms |
5204 KB |
Output is correct |
36 |
Incorrect |
2958 ms |
5204 KB |
Output isn't correct |
37 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 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 |
0 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 |
0 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 |
8 ms |
468 KB |
Output is correct |
20 |
Correct |
6 ms |
468 KB |
Output is correct |
21 |
Correct |
7 ms |
416 KB |
Output is correct |
22 |
Correct |
51 ms |
504 KB |
Output is correct |
23 |
Correct |
51 ms |
504 KB |
Output is correct |
24 |
Correct |
53 ms |
496 KB |
Output is correct |
25 |
Correct |
51 ms |
496 KB |
Output is correct |
26 |
Correct |
52 ms |
468 KB |
Output is correct |
27 |
Correct |
313 ms |
15272 KB |
Output is correct |
28 |
Correct |
329 ms |
15264 KB |
Output is correct |
29 |
Correct |
320 ms |
15008 KB |
Output is correct |
30 |
Correct |
310 ms |
15260 KB |
Output is correct |
31 |
Incorrect |
2975 ms |
14992 KB |
Output isn't correct |
32 |
Halted |
0 ms |
0 KB |
- |