| Task: | Polygon area |
| Sender: | aalto26jm_006 |
| Submission time: | 2026-11-09 16:44:58 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | details |
| #2 | WRONG ANSWER | 0.01 s | details |
| #3 | WRONG ANSWER | 0.00 s | details |
Code
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
int calculateArea(vector<vector<long long>> points, int n){
long long area = 0;
for (int i = 0; i < n; i++) {
area += (points[i][0] * points[(i + 1) % n][1] - points[(i + 1) % n][0] * points[i][1]);
}
return abs(area);
}
int main(){
int n;
cin >> n;
vector<vector<long long>> points;
for (int i = 0; i < n; i++) {
int x, y;
cin >> x >> y;
points.push_back({x, y});
}
cout << calculateArea(points, n);
return 0;
}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: WRONG ANSWER
| input |
|---|
| 1000 365625896 -113418831 278762563 38777445 250367343 -96991975 175866909 -129766978 ... |
| correct output |
|---|
| 4053466653883387139 |
| user output |
|---|
| 228347139 |
Feedback: Incorrect character on line 1 col 1: expected "405346665388...", got "228347139"
Test 3
Verdict: WRONG ANSWER
| input |
|---|
| 4 -1000000000 -1000000000 -1000000000 1000000000 1000000000 1000000000 1000000000 -1000000000 |
| correct output |
|---|
| 8000000000000000000 |
| user output |
|---|
| 991952896 |
Feedback: Incorrect character on line 1 col 1: expected "800000000000...", got "991952896"
