Submission details
Task:Polygon area
Sender:luukwin
Submission time:2025-11-10 17:32:04 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#2ACCEPTED0.07 sdetails
#30.04 sdetails

Code

n = int(input())

xall = []
yall = []

for i in range(n):
    xi, yi = [int(x) for x in input().split()]
    xall.append(xi)
    yall.append(yi)

total = xall[n-1] * yall[0] - xall[0] * yall[n-1]

for i in range(n-1):
    total += (xall[i] * yall[i+1] - xall[i+1] * yall[i])

print(int(total))

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: ACCEPTED

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

correct output
4053466653883387139

user output
4053466653883387139

Test 3

Verdict:

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

correct output
8000000000000000000

user output
-8000000000000000000

Feedback: Incorrect character on line 1 col 1: expected "800000000000...", got "-80000000000..."