| Task: | Polygon area |
| Sender: | hundlij1 |
| Submission time: | 2025-11-10 16:32:44 +0200 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.00 s | details |
| #2 | WRONG ANSWER | 0.00 s | details |
| #3 | WRONG ANSWER | 0.00 s | details |
Code
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <climits>
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void task1(){
ll n;
cin >> n;
ll a,b;
vector<pair<ll,ll>> arr(n + 1);
for(ll i = 0; i < n; i++){
cin >> a >> b;
arr[i] = {a,b};
}
arr[n] = arr[0];
ll sum = 0;
for(ll i = 0; i < n+1; i++){
sum += (arr[i].first * arr[i+1].second) - (arr[i+1].first * arr[i].second);
// cout << arr[i].first << " " << arr[i+1].second << endl;
// cout << arr[i+1].first << " " << arr[i].second << endl;
}
cout << abs(sum) << endl;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
task1();
}
Test details
Test 1
Verdict: WRONG ANSWER
| input |
|---|
| 100 -7 -19 91 77 100 100 64 60 ... |
| correct output |
|---|
| 43582 |
| user output |
|---|
| 634921 |
Feedback: Incorrect character on line 1 col 1: expected "43582", got "634921"
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 1000 365625896 -113418831 278762563 38777445 250367343 -96991975 175866909 -129766978 ... |
| correct output |
|---|
| 4053466653883387139 |
| user output |
|---|
| 4053496828622958123 |
Feedback: Incorrect character on line 1 col 6: expected "405346665388...", got "405349682862..."
Test 3
Verdict: WRONG ANSWER
| input |
|---|
| 4 -1000000000 -1000000000 -1000000000 1000000000 1000000000 1000000000 1000000000 -1000000000 |
| correct output |
|---|
| 8000000000000000000 |
| user output |
|---|
| 8000098465000000000 |
Feedback: Incorrect character on line 1 col 6: expected "800000000000...", got "800009846500..."
