結果
問題 | No.3100 Parallel Translated |
ユーザー |
|
提出日時 | 2025-04-11 22:07:56 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 3,940 ms |
コンパイル使用メモリ | 253,280 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-04-11 22:08:06 |
合計ジャッジ時間 | 4,671 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using mint = atcoder::modint998244353; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<pair<int,int>> a(n); for(auto &&[x, y] : a) cin >> x >> y; auto f = [&](int i, int j){ auto [x1, y1] = a[i]; auto [x2, y2] = a[j]; return (mint)x1 * y2 - (mint)x2 * y1; }; mint ans; for(int i = 0; i < n; i++) ans += f(i, i + 1 == n ? 0 : i + 1); cout << (ans / 2).val() << '\n'; }