Submission details
Task:Polygon area
Sender:jonnymorgan
Submission time:2025-11-10 16:54:17 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#20.06 sdetails
#3ACCEPTED0.04 sdetails

Code

n = int(input())
x_list = []
y_list = []

for i in range(n):
    x, y = map(int, input().split())
    x_list.append(x)
    y_list.append(y)


def polygonArea(X, Y, n):
    area = 0.0
    j = n - 1
    for i in range(0, n):
        area += (X[j] + X[i]) * (Y[j] - Y[i])
        j = i
    return int(abs(area / 2.0))



print(2*polygonArea(x_list, y_list, n))

Test details

Test 1

Verdict: ACCEPTED

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

correct output
43582

user output
43582

Test 2

Verdict:

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

correct output
4053466653883387139

user output
4053466653883387392

Feedback: Incorrect character on line 1 col 17: expected "40534...87139", got "40534...87392"

Test 3

Verdict: ACCEPTED

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

correct output
8000000000000000000

user output
8000000000000000000