Submission details
Task:Polygon area
Sender:aalto26jm_022
Submission time:2026-11-09 16:34:29 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.04 sdetails
#20.07 sdetails
#30.04 sdetails

Code

n = int(input())
x = []
y = []
for i in range(n):
    buffer = input().split()
    x.append(int(buffer[0]))
    y.append(int(buffer[1]))

area = 0
for i in range(n):
    area += x[i]*y[(i+1)%n] - x[i]*y[i-1]
    print(i,x[i],y[(i+1)%n],"-",x[i],y[i-1],"=",area)

print(area)

Test details

Test 1

Verdict:

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

correct output
43582

user output
0 -7 77 - -7 -1 = -546
1 91 100 - 91 -19 = 10283
2 100 60 - 100 77 = 8583
3 64 -1 - 64 100 = 2119
4 -11 87 - -11 60 = 1822
...

Feedback: Output is longer than expected

Test 2

Verdict:

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

correct output
4053466653883387139

user output
0 365625896 38777445 - 3656258...

Feedback: Output is longer than expected

Test 3

Verdict:

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

correct output
8000000000000000000

user output
0 -1000000000 1000000000 - -10...

Feedback: Output is longer than expected