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

Code

n = int(input())

x = []
y = []
for i in range(n):
    xi, yi = [int(x) for x in input().split()]
    x.append(xi)
    y.append(yi)
total = 0
for i in range(n):
    if i == n - 1: total += x[i] * y[0] - x[0] * y[i]
    else: total += x[i] * y[i+1] - x[i+1] * y[i]

print(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..."