Task: | Polygon area |
Sender: | ZDHKLV |
Submission time: | 2024-11-11 16:24:45 +0200 |
Language: | C++ (C++11) |
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 <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> x(n+1), y(n+1); for (int i = 0; i < n; i++) cin >> x[i] >> y[i]; x[n] = x[0]; y[n] = y[0]; long long output = 0; for (int i = 0; i < n; i++) { output += x[i] * y[i+1] - x[i+1] * y[i]; } cout << output << endl; }
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 |
---|
43178020099 |
Test 3
Verdict: WRONG ANSWER
input |
---|
4 -1000000000 -1000000000 -1000000000 1000000000 1000000000 1000000000 1000000000 -1000000000 |
correct output |
---|
8000000000000000000 |
user output |
---|
-5286920192 |