Submission details
Task:Polygon area
Sender:azeaus1
Submission time:2025-11-10 16:29:32 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.04 sdetails
#20.06 sdetails
#30.04 sdetails

Code

n = int(input())
vertices = []
for _ in range(n):
    x1, y1 = [int(x) for x in input().split()]
    vertices.append([x1, y1])

area = 0.0
for i in range(n):
    j = (i+1)%n
    area += vertices[i][0]*vertices[j][1] - vertices[i][1]*vertices[j][0]

print(2*(area/2))

Test details

Test 1

Verdict:

input
100
-7 -19
91 77
100 100
64 60
...

correct output
43582

user output
43582.0

Feedback: Incorrect character on line 1 col 6: expected "43582", got "43582.0"

Test 2

Verdict:

input
1000
365625896 -113418831
278762563 38777445
250367343 -96991975
175866909 -129766978
...

correct output
4053466653883387139

user output
4.0534666538833864e+18

Feedback: Incorrect character on line 1 col 2: expected "405346665388...", got "4.0534666538..."

Test 3

Verdict:

input
4
-1000000000 -1000000000
-1000000000 1000000000
1000000000 1000000000
1000000000 -1000000000

correct output
8000000000000000000

user output
-8e+18

Feedback: Incorrect character on line 1 col 1: expected "800000000000...", got "-8e+18"