Submission #953666

# Submission time Handle Problem Language Result Execution time Memory
953666 2024-03-26T12:10:19 Z ayeshz Circle selection (APIO18_circle_selection) PyPy 3
7 / 100
3000 ms 92216 KB
n = int(input())
from math import sqrt
def intersect(x1,y1,r1,x2,y2,r2):
    dist = sqrt(pow(x1-x2,2) + pow(y1-y2,2))
    if dist <= r1 + r2:
        return True
    return False
circles = []
for i in range(n):
    temp = tuple(map(int,input().split()))
    circles.append((i+1,temp[0],temp[1],temp[2]))
ais = [-1] * n
circles.sort(key=lambda x: x[3],reverse=True)
for i in range(n):
    if ais[circles[i][0]-1] != -1:
        continue
    x, y, r = circles[i][1],circles[i][2],circles[i][3]
    ais[circles[i][0]-1] = circles[i][0]
    # this is largest circle, find intersecting circles
    for j in range(i+1,n):
        if ais[circles[j][0]-1] != -1:
            continue
        if intersect(x,y,r,circles[j][1],circles[j][2],circles[j][3]):
            ais[circles[j][0]-1] = circles[i][0]
#print(ais)
print(' '.join(map(str,ais)))
# Verdict Execution time Memory Grader output
1 Correct 28 ms 18228 KB Output is correct
2 Correct 28 ms 18188 KB Output is correct
3 Correct 28 ms 18320 KB Output is correct
4 Correct 29 ms 18368 KB Output is correct
5 Correct 29 ms 18236 KB Output is correct
6 Correct 30 ms 18236 KB Output is correct
7 Correct 30 ms 18320 KB Output is correct
8 Correct 31 ms 18376 KB Output is correct
9 Correct 31 ms 18228 KB Output is correct
10 Correct 31 ms 18236 KB Output is correct
11 Correct 38 ms 18980 KB Output is correct
12 Correct 36 ms 18992 KB Output is correct
13 Correct 37 ms 18940 KB Output is correct
14 Correct 37 ms 18964 KB Output is correct
15 Correct 38 ms 18992 KB Output is correct
16 Correct 57 ms 19636 KB Output is correct
17 Correct 55 ms 19460 KB Output is correct
18 Correct 53 ms 19512 KB Output is correct
19 Correct 82 ms 23740 KB Output is correct
20 Correct 81 ms 23856 KB Output is correct
21 Correct 90 ms 24960 KB Output is correct
22 Correct 328 ms 24192 KB Output is correct
23 Correct 337 ms 24368 KB Output is correct
24 Correct 357 ms 24520 KB Output is correct
25 Correct 338 ms 24648 KB Output is correct
26 Correct 337 ms 24188 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1161 ms 91484 KB Output is correct
2 Correct 1241 ms 92216 KB Output is correct
3 Correct 1235 ms 85428 KB Output is correct
4 Correct 1155 ms 91448 KB Output is correct
5 Execution timed out 3015 ms 80172 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 28 ms 18236 KB Output is correct
2 Execution timed out 3089 ms 39752 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3072 ms 78636 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 28 ms 18228 KB Output is correct
2 Correct 28 ms 18188 KB Output is correct
3 Correct 28 ms 18320 KB Output is correct
4 Correct 29 ms 18368 KB Output is correct
5 Correct 29 ms 18236 KB Output is correct
6 Correct 30 ms 18236 KB Output is correct
7 Correct 30 ms 18320 KB Output is correct
8 Correct 31 ms 18376 KB Output is correct
9 Correct 31 ms 18228 KB Output is correct
10 Correct 31 ms 18236 KB Output is correct
11 Correct 38 ms 18980 KB Output is correct
12 Correct 36 ms 18992 KB Output is correct
13 Correct 37 ms 18940 KB Output is correct
14 Correct 37 ms 18964 KB Output is correct
15 Correct 38 ms 18992 KB Output is correct
16 Correct 57 ms 19636 KB Output is correct
17 Correct 55 ms 19460 KB Output is correct
18 Correct 53 ms 19512 KB Output is correct
19 Correct 82 ms 23740 KB Output is correct
20 Correct 81 ms 23856 KB Output is correct
21 Correct 90 ms 24960 KB Output is correct
22 Correct 328 ms 24192 KB Output is correct
23 Correct 337 ms 24368 KB Output is correct
24 Correct 357 ms 24520 KB Output is correct
25 Correct 338 ms 24648 KB Output is correct
26 Correct 337 ms 24188 KB Output is correct
27 Correct 103 ms 25776 KB Output is correct
28 Correct 102 ms 25108 KB Output is correct
29 Correct 97 ms 25228 KB Output is correct
30 Correct 1331 ms 25376 KB Output is correct
31 Correct 1311 ms 25388 KB Output is correct
32 Correct 1424 ms 25116 KB Output is correct
33 Correct 383 ms 41768 KB Output is correct
34 Correct 368 ms 42428 KB Output is correct
35 Correct 394 ms 42444 KB Output is correct
36 Execution timed out 3026 ms 39680 KB Time limit exceeded
37 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 28 ms 18228 KB Output is correct
2 Correct 28 ms 18188 KB Output is correct
3 Correct 28 ms 18320 KB Output is correct
4 Correct 29 ms 18368 KB Output is correct
5 Correct 29 ms 18236 KB Output is correct
6 Correct 30 ms 18236 KB Output is correct
7 Correct 30 ms 18320 KB Output is correct
8 Correct 31 ms 18376 KB Output is correct
9 Correct 31 ms 18228 KB Output is correct
10 Correct 31 ms 18236 KB Output is correct
11 Correct 38 ms 18980 KB Output is correct
12 Correct 36 ms 18992 KB Output is correct
13 Correct 37 ms 18940 KB Output is correct
14 Correct 37 ms 18964 KB Output is correct
15 Correct 38 ms 18992 KB Output is correct
16 Correct 57 ms 19636 KB Output is correct
17 Correct 55 ms 19460 KB Output is correct
18 Correct 53 ms 19512 KB Output is correct
19 Correct 82 ms 23740 KB Output is correct
20 Correct 81 ms 23856 KB Output is correct
21 Correct 90 ms 24960 KB Output is correct
22 Correct 328 ms 24192 KB Output is correct
23 Correct 337 ms 24368 KB Output is correct
24 Correct 357 ms 24520 KB Output is correct
25 Correct 338 ms 24648 KB Output is correct
26 Correct 337 ms 24188 KB Output is correct
27 Correct 1161 ms 91484 KB Output is correct
28 Correct 1241 ms 92216 KB Output is correct
29 Correct 1235 ms 85428 KB Output is correct
30 Correct 1155 ms 91448 KB Output is correct
31 Execution timed out 3015 ms 80172 KB Time limit exceeded
32 Halted 0 ms 0 KB -