# 11:10 -> 11:33
import math
n = int(input())
circles = []
for _ in range(n):
x, y, r = [int(a) for a in input().split()]
circles.append([x,y,r]) # r=-1 will indicate that the circle is removed
n_removed = 0
removing_list = [-1]*n
while n_removed < n:
r_max = 0
r_max_idx = -1
for i in range(len(circles)):
circle = circles[i]
if circle[2] > r_max:
r_max = circle[2]
r_max_idx = i
if r_max_idx == -1:
break
x_max = circles[r_max_idx][0]
y_max = circles[r_max_idx][1]
r_max = circles[r_max_idx][2]
for i in range(len(circles)):
circle = circles[i]
if circle[2] < 1:
continue
dis = (circle[0] - x_max)**2 + (circle[1] - y_max)**2
if dis <= (r_max+circle[2])**2:
removing_list[i] = str(r_max_idx + 1)
circle[2] = -1
n_removed += 1
#n_removed += 1
circles[r_max_idx][2] = -1
print(' '.join(removing_list))
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
18208 KB |
Output is correct |
2 |
Correct |
36 ms |
18236 KB |
Output is correct |
3 |
Correct |
29 ms |
18416 KB |
Output is correct |
4 |
Correct |
29 ms |
18204 KB |
Output is correct |
5 |
Correct |
29 ms |
18480 KB |
Output is correct |
6 |
Correct |
30 ms |
18236 KB |
Output is correct |
7 |
Correct |
32 ms |
18240 KB |
Output is correct |
8 |
Correct |
31 ms |
18256 KB |
Output is correct |
9 |
Correct |
31 ms |
18228 KB |
Output is correct |
10 |
Correct |
31 ms |
18188 KB |
Output is correct |
11 |
Correct |
39 ms |
19248 KB |
Output is correct |
12 |
Correct |
39 ms |
19252 KB |
Output is correct |
13 |
Correct |
44 ms |
19248 KB |
Output is correct |
14 |
Correct |
37 ms |
19248 KB |
Output is correct |
15 |
Correct |
39 ms |
19224 KB |
Output is correct |
16 |
Correct |
57 ms |
20008 KB |
Output is correct |
17 |
Correct |
53 ms |
19248 KB |
Output is correct |
18 |
Correct |
54 ms |
19172 KB |
Output is correct |
19 |
Correct |
80 ms |
23856 KB |
Output is correct |
20 |
Correct |
84 ms |
23852 KB |
Output is correct |
21 |
Correct |
84 ms |
24228 KB |
Output is correct |
22 |
Correct |
316 ms |
25136 KB |
Output is correct |
23 |
Correct |
315 ms |
25132 KB |
Output is correct |
24 |
Correct |
346 ms |
24356 KB |
Output is correct |
25 |
Correct |
318 ms |
24624 KB |
Output is correct |
26 |
Correct |
320 ms |
24624 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
610 ms |
103556 KB |
Output is correct |
2 |
Correct |
619 ms |
103556 KB |
Output is correct |
3 |
Correct |
595 ms |
101884 KB |
Output is correct |
4 |
Correct |
601 ms |
104256 KB |
Output is correct |
5 |
Execution timed out |
3060 ms |
73652 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
18228 KB |
Output is correct |
2 |
Execution timed out |
3057 ms |
39020 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3038 ms |
76468 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
18208 KB |
Output is correct |
2 |
Correct |
36 ms |
18236 KB |
Output is correct |
3 |
Correct |
29 ms |
18416 KB |
Output is correct |
4 |
Correct |
29 ms |
18204 KB |
Output is correct |
5 |
Correct |
29 ms |
18480 KB |
Output is correct |
6 |
Correct |
30 ms |
18236 KB |
Output is correct |
7 |
Correct |
32 ms |
18240 KB |
Output is correct |
8 |
Correct |
31 ms |
18256 KB |
Output is correct |
9 |
Correct |
31 ms |
18228 KB |
Output is correct |
10 |
Correct |
31 ms |
18188 KB |
Output is correct |
11 |
Correct |
39 ms |
19248 KB |
Output is correct |
12 |
Correct |
39 ms |
19252 KB |
Output is correct |
13 |
Correct |
44 ms |
19248 KB |
Output is correct |
14 |
Correct |
37 ms |
19248 KB |
Output is correct |
15 |
Correct |
39 ms |
19224 KB |
Output is correct |
16 |
Correct |
57 ms |
20008 KB |
Output is correct |
17 |
Correct |
53 ms |
19248 KB |
Output is correct |
18 |
Correct |
54 ms |
19172 KB |
Output is correct |
19 |
Correct |
80 ms |
23856 KB |
Output is correct |
20 |
Correct |
84 ms |
23852 KB |
Output is correct |
21 |
Correct |
84 ms |
24228 KB |
Output is correct |
22 |
Correct |
316 ms |
25136 KB |
Output is correct |
23 |
Correct |
315 ms |
25132 KB |
Output is correct |
24 |
Correct |
346 ms |
24356 KB |
Output is correct |
25 |
Correct |
318 ms |
24624 KB |
Output is correct |
26 |
Correct |
320 ms |
24624 KB |
Output is correct |
27 |
Correct |
87 ms |
25648 KB |
Output is correct |
28 |
Correct |
87 ms |
25468 KB |
Output is correct |
29 |
Correct |
83 ms |
25392 KB |
Output is correct |
30 |
Correct |
1124 ms |
26824 KB |
Output is correct |
31 |
Correct |
1113 ms |
26756 KB |
Output is correct |
32 |
Correct |
1108 ms |
27064 KB |
Output is correct |
33 |
Correct |
241 ms |
47916 KB |
Output is correct |
34 |
Correct |
238 ms |
47904 KB |
Output is correct |
35 |
Correct |
300 ms |
47860 KB |
Output is correct |
36 |
Execution timed out |
3029 ms |
38736 KB |
Time limit exceeded |
37 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
18208 KB |
Output is correct |
2 |
Correct |
36 ms |
18236 KB |
Output is correct |
3 |
Correct |
29 ms |
18416 KB |
Output is correct |
4 |
Correct |
29 ms |
18204 KB |
Output is correct |
5 |
Correct |
29 ms |
18480 KB |
Output is correct |
6 |
Correct |
30 ms |
18236 KB |
Output is correct |
7 |
Correct |
32 ms |
18240 KB |
Output is correct |
8 |
Correct |
31 ms |
18256 KB |
Output is correct |
9 |
Correct |
31 ms |
18228 KB |
Output is correct |
10 |
Correct |
31 ms |
18188 KB |
Output is correct |
11 |
Correct |
39 ms |
19248 KB |
Output is correct |
12 |
Correct |
39 ms |
19252 KB |
Output is correct |
13 |
Correct |
44 ms |
19248 KB |
Output is correct |
14 |
Correct |
37 ms |
19248 KB |
Output is correct |
15 |
Correct |
39 ms |
19224 KB |
Output is correct |
16 |
Correct |
57 ms |
20008 KB |
Output is correct |
17 |
Correct |
53 ms |
19248 KB |
Output is correct |
18 |
Correct |
54 ms |
19172 KB |
Output is correct |
19 |
Correct |
80 ms |
23856 KB |
Output is correct |
20 |
Correct |
84 ms |
23852 KB |
Output is correct |
21 |
Correct |
84 ms |
24228 KB |
Output is correct |
22 |
Correct |
316 ms |
25136 KB |
Output is correct |
23 |
Correct |
315 ms |
25132 KB |
Output is correct |
24 |
Correct |
346 ms |
24356 KB |
Output is correct |
25 |
Correct |
318 ms |
24624 KB |
Output is correct |
26 |
Correct |
320 ms |
24624 KB |
Output is correct |
27 |
Correct |
610 ms |
103556 KB |
Output is correct |
28 |
Correct |
619 ms |
103556 KB |
Output is correct |
29 |
Correct |
595 ms |
101884 KB |
Output is correct |
30 |
Correct |
601 ms |
104256 KB |
Output is correct |
31 |
Execution timed out |
3060 ms |
73652 KB |
Time limit exceeded |
32 |
Halted |
0 ms |
0 KB |
- |