From 0cb513dd197218c5bdb31605ed7525906ea07c1a Mon Sep 17 00:00:00 2001 From: ngthanhtrung23 Date: Sun, 2 Jun 2024 18:23:02 +0800 Subject: [PATCH] yosupo convex hull test --- Geometry/tests/yosupo_convex_hull.test.cpp | 18 ++++++++++++++++++ Graph/DfsTree/StronglyConnected.h | 1 + 2 files changed, 19 insertions(+) create mode 100644 Geometry/tests/yosupo_convex_hull.test.cpp diff --git a/Geometry/tests/yosupo_convex_hull.test.cpp b/Geometry/tests/yosupo_convex_hull.test.cpp new file mode 100644 index 00000000..7325cf7d --- /dev/null +++ b/Geometry/tests/yosupo_convex_hull.test.cpp @@ -0,0 +1,18 @@ +#define PROBLEM "https://judge.yosupo.jp/problem/static_convex_hull" + +#include "../../template.h" +#include "../basic.h" +#include "../polygon.h" + +void solve() { + int ntest; cin >> ntest; + while (ntest--) { + int n; cin >> n; + vector> ps(n); + for (int i = 0; i < n; ++i) cin >> ps[i]; + + ConvexHull(ps); + cout << ps.size() << '\n'; + for (const auto& p : ps) cout << p.x << ' ' << p.y << '\n'; + } +} diff --git a/Graph/DfsTree/StronglyConnected.h b/Graph/DfsTree/StronglyConnected.h index 14e6eb80..1a181263 100644 --- a/Graph/DfsTree/StronglyConnected.h +++ b/Graph/DfsTree/StronglyConnected.h @@ -8,6 +8,7 @@ // Tested: // - (requires scc to be topo sorted) https://judge.yosupo.jp/problem/scc // - https://cses.fi/problemset/task/1686/ +// - (edges have costs) https://oj.vnoi.info/problem/bedao_g16_b struct DirectedDfs { vector> g; int n;