結果
| 問題 |
No.3100 Parallel Translated
|
| コンテスト | |
| ユーザー |
startcpp
|
| 提出日時 | 2025-04-12 03:17:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 644 bytes |
| コンパイル時間 | 829 ms |
| コンパイル使用メモリ | 73,480 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-04-12 03:17:21 |
| 合計ジャッジ時間 | 2,104 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 32 |
ソースコード
// ギャグ。多角形の面積でOK.
#include <iostream>
#include <algorithm>
#include <complex>
#include <atcoder/modint>
#define rep(i, n) for(i = 0; i < n; i++)
#define int long long
using namespace std;
using namespace atcoder;
using mint = modint998244353;
typedef complex<double> Point;
int n;
Point ps[100];
int cross(Point a, Point b) {
return a.real() * b.imag() - a.imag() * b.real();
}
signed main() {
int i;
cin >> n;
rep(i, n) {
double x, y;
cin >> x >> y;
ps[i] = Point(x, y);
}
int area = 0;
rep(i, n) {
area += cross(ps[i], ps[(i + 1) % n]);
}
cout << (mint(area) / mint(2)).val() << endl;
return 0;
}
startcpp