Submission details
Task:Polygon area
Sender:mooc.fi~1130261
Submission time:2025-11-10 16:33:52 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.04 sdetails
#20.07 sdetails
#30.04 sdetails

Code

n = int(input())
l = []
for _ in range(n):
    l.append(tuple(map(float, input().split())))
area = 0
for i in range(n):
    x1, y1 = l[i]
    x2, y2 = l[(i + 1) % n]
    area += x1 * y2 - x2 * y1
print(abs(area))

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.053466653883391e+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 2: expected "800000000000...", got "8e+18"