| Task: | Polygon area |
| Sender: | Isak |
| Submission time: | 2025-11-10 16:30:14 +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 <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define LOOP(i,s,e) for (uint64_t i = (s); i < (e); i++)
#define SCAN(...) if (scanf(__VA_ARGS__) == 0) return EXIT_FAILURE
int main() {
uint64_t n = 0;
SCAN("%ld", &n);
int64_t acc = 0;
int64_t x1, x2, x0, y1, y2, y0;
SCAN("%ld %ld", &x1, &y1);
y0 = y1, x0 = x1;
LOOP(i, 0, n-1){
SCAN("%ld %ld", &x2, &y2);
acc += x1*y2 - x2*y1;
x1 = x2, y1 = y2;
}
acc += x1*y0 - x0*y1;
printf("%ld", acc);
return EXIT_SUCCESS;
}
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..."
