Submission details
Task:Closest points
Sender:hy2025_002
Submission time:2025-11-12 16:57:38 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.04 sdetails
#20.24 sdetails
#30.27 sdetails
#40.25 sdetails
#50.04 sdetails
#60.24 sdetails
#70.04 sdetails
#80.04 sdetails
#90.04 sdetails
#100.24 sdetails
#110.04 sdetails
#120.04 sdetails
#130.24 sdetails
#140.05 sdetails
#150.05 sdetails
#160.24 sdetails
#170.24 sdetails
#180.04 sdetails

Code

def closest_points(n, points):
    min_dist = float('inf')
    for i in range(n):
        for j in range(i + 1, n):
            dist = ((points[i][0] - points[j][0]) ** 2) + ((points[i][1] - points[j][1]) ** 2)
            min_dist = min(dist, min_dist)
    return int(min_dist)

if __name__ == "__main__":
    n = int(input())
    points = []
    for _ in range(n):
        (x, y) = map(int, input().split())
        points.append((x, y))

Test details

Test 1

Verdict:

input
100
58 36
81 -7
46 49
87 -58
...

correct output
1

user output
(empty)

Feedback: Output is shorter than expected

Test 2

Verdict:

input
200000
-222 -705
277 680
-436 561
528 -516
...

correct output
1

user output
(empty)

Feedback: Output is shorter than expected

Test 3

Verdict:

input
200000
-464738043 865360844
465231470 129093134
-276549869 -21946314
111055008 -48821736
...

correct output
25413170

user output
(empty)

Feedback: Output is shorter than expected

Test 4

Verdict:

input
200000
1 513001000
2 689002000
3 785003000
4 799004000
...

correct output
1000000

user output
(empty)

Feedback: Output is shorter than expected

Test 5

Verdict:

input
4
0 0
0 3
3 0
1 1

correct output
2

user output
(empty)

Feedback: Output is shorter than expected

Test 6

Verdict:

input
200000
1 0
1 1
1 2
1 3
...

correct output
1

user output
(empty)

Feedback: Output is shorter than expected

Test 7

Verdict:

input
4
1 2
10 3
3 5
8 5

correct output
8

user output
(empty)

Feedback: Output is shorter than expected

Test 8

Verdict:

input
4
10 6
4 10
8 3
2 3

correct output
13

user output
(empty)

Feedback: Output is shorter than expected

Test 9

Verdict:

input
2
-999999999 -999999999
999999999 999999999

correct output
7999999984000000008

user output
(empty)

Feedback: Output is shorter than expected

Test 10

Verdict:

input
200000
0 1
1 1
2 1
3 1
...

correct output
1

user output
(empty)

Feedback: Output is shorter than expected

Test 11

Verdict:

input
8
1 10000
-1 -10000
2 0
-2 0
...

correct output
16

user output
(empty)

Feedback: Output is shorter than expected

Test 12

Verdict:

input
3
-1000000000 -1000000000
1000000000 1000000000
0 0

correct output
2000000000000000000

user output
(empty)

Feedback: Output is shorter than expected

Test 13

Verdict:

input
199999
1 1
2 1
3 1
4 1
...

correct output
1

user output
(empty)

Feedback: Output is shorter than expected

Test 14

Verdict:

input
4
0 0
5 8
6 1
10000 0

correct output
37

user output
(empty)

Feedback: Output is shorter than expected

Test 15

Verdict:

input
435
-842 -199
-480 798
-176 -406
792 608
...

correct output
2

user output
(empty)

Feedback: Output is shorter than expected

Test 16

Verdict:

input
200000
1 0
1 2
1 4
1 6
...

correct output
4

user output
(empty)

Feedback: Output is shorter than expected

Test 17

Verdict:

input
200000
0 1
2 1
4 1
6 1
...

correct output
4

user output
(empty)

Feedback: Output is shorter than expected

Test 18

Verdict:

input
3
-1000000000 -1000000000
1000000000 1000000000
1000000000 -1000000000

correct output
4000000000000000000

user output
(empty)

Feedback: Output is shorter than expected