| Task: | Polygon area |
| Sender: | kookinnam |
| Submission time: | 2025-11-10 16:24:47 +0200 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.04 s | details |
| #2 | WRONG ANSWER | 0.07 s | details |
| #3 | WRONG ANSWER | 0.04 s | details |
Code
def area(point1, point2, point3):
(x1, y1) = point1
(x2, y2) = point2
(x3, y3) = point3
return abs(x3 * (y1 - y2) + x1 * (y2 - y3) + x2 * (y3 - y1)) / 2
if __name__ == "__main__":
n = int(input())
points = []
for i in range(n):
point = list(map(int, input().split()))
points.append(point)
start = points[0]
polygon = points[1:]
total_area = 0
for i in range(1, len(polygon)):
total_area += area(start, polygon[i-1], polygon[i])
print(total_area * 2)
Test details
Test 1
Verdict: WRONG ANSWER
| input |
|---|
| 100 -7 -19 91 77 100 100 64 60 ... |
| correct output |
|---|
| 43582 |
| user output |
|---|
| 202606.0 |
Feedback: Incorrect character on line 1 col 1: expected "43582", got "202606.0"
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 1000 365625896 -113418831 278762563 38777445 250367343 -96991975 175866909 -129766978 ... |
| correct output |
|---|
| 4053466653883387139 |
| user output |
|---|
| 1.258407938041353e+20 |
Feedback: Incorrect character on line 1 col 1: expected "405346665388...", got "1.2584079380..."
Test 3
Verdict: WRONG ANSWER
| 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"
