| Task: | Polygon area |
| Sender: | aalto26jm_016 |
| Submission time: | 2026-11-09 16:40:38 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | details |
| #2 | ACCEPTED | 0.00 s | details |
| #3 | WRONG ANSWER | 0.00 s | details |
Code
#include <iostream>
#include <vector>
#include <climits>
#include <cstdint>
using namespace std;
#define DEBUG std::cout<<"LINE"<<__LINE__;
#define IN(A) int A;std::cin>>A;
template<typename T> void printV(vector<T> V) {
for (int i=0;i<V.size()-1;i++) {
cout<<V[i]<<" ";
}
cout<<V[V.size()-1];
cout<<endl;
}
int64_t max3(int64_t a,int64_t b,int64_t c) {
return max(a,max(b,c));
}
struct compute {
int tests=1;
vector<int64_t> x;
vector<int64_t> y;
bool start() {
IN(n);
x.assign(n,0);
y.assign(n,0);
for (int i=0;i<n;i++) {
cin>>x[i];
cin>>y[i];
}
x.emplace_back(x[0]);
y.emplace_back(y[0]);
int64_t t=0;
for (int i=0;i<n;i++) {
t+=x[i]*y[i+1]-x[i+1]*y[i];
}
cout<<t<<endl;
return true;
}
void testloop(){
while (tests-->0) {
start();
}
}
};
int main() {
ios_base::sync_with_stdio(false);
// cin.tie(NULL);
compute comp;
comp.start();
}
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: WRONG ANSWER
| 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..."
