format code
This commit is contained in:
parent
ef0a94fbaf
commit
678ceb72bb
7
2d.hpp
7
2d.hpp
@ -75,8 +75,11 @@ bool intersect(const Polygon<n>& a, const Polygon<m>& b) {
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int j = 0; j < m; j++) {
|
||||
if (cross(b[j] - a[i], a[(i + 1) % n] - a[i]) * cross(b[(j + 1) % m] - a[i], a[(i + 1) % n] - a[i]) <= 0
|
||||
&& cross(a[i] - b[j], b[(j + 1) % m] - b[j]) * cross(a[(i + 1) % n] - b[j], b[(j + 1) % m] - b[j])
|
||||
if (cross(b[j] - a[i], a[(i + 1) % n] - a[i])
|
||||
* cross(b[(j + 1) % m] - a[i], a[(i + 1) % n] - a[i])
|
||||
<= 0
|
||||
&& cross(a[i] - b[j], b[(j + 1) % m] - b[j])
|
||||
* cross(a[(i + 1) % n] - b[j], b[(j + 1) % m] - b[j])
|
||||
<= 0) {
|
||||
return true;
|
||||
}
|
||||
|
@ -59,7 +59,9 @@ public:
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
typename std::enable_if<!std::is_floating_point<T>::value>::type expectEq(std::function<T()> func, T&& answer) noexcept {
|
||||
typename std::enable_if<!std::is_floating_point<T>::value>::type expectEq(
|
||||
std::function<T()> func,
|
||||
T&& answer) noexcept {
|
||||
auto res = runTask(func);
|
||||
if (!res.has_value()) {
|
||||
return onError();
|
||||
@ -168,7 +170,9 @@ public:
|
||||
func(t);
|
||||
t.end();
|
||||
std::putchar('\n');
|
||||
if (t.hasFail()) return 1;
|
||||
if (t.hasFail()) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
tc.clear();
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user