| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <cstdint> | ||
| 4 | #include <string> | ||
| 5 | #include <tuple> | ||
| 6 | #include <vector> | ||
| 7 | |||
| 8 | #include "task/include/task.hpp" | ||
| 9 | |||
| 10 | namespace nalitov_d_binary { | ||
| 11 | |||
| 12 | struct GridPoint { | ||
| 13 | int x{0}; | ||
| 14 | int y{0}; | ||
| 15 | |||
| 16 | GridPoint() = default; | ||
| 17 |
6/12✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 10 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 10 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 10 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 10 times.
✗ Branch 17 not taken.
|
717 | GridPoint(int px, int py) : x(px), y(py) {} |
| 18 | |||
| 19 | bool operator==(const GridPoint &other) const { | ||
| 20 |
4/12✓ Branch 0 taken 557 times.
✓ Branch 1 taken 130 times.
✓ Branch 2 taken 557 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 140 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
|
827 | return x == other.x && y == other.y; |
| 21 | } | ||
| 22 | |||
| 23 | bool operator!=(const GridPoint &other) const { | ||
| 24 | return !(*this == other); | ||
| 25 | } | ||
| 26 | |||
| 27 | bool operator<(const GridPoint &other) const { | ||
| 28 | return (y < other.y) || (y == other.y && x < other.x); | ||
| 29 | } | ||
| 30 | }; | ||
| 31 | |||
| 32 | struct BinaryImage { | ||
| 33 | int width{0}; | ||
| 34 | int height{0}; | ||
| 35 | std::vector<uint8_t> pixels; | ||
| 36 | std::vector<std::vector<GridPoint>> components; | ||
| 37 | std::vector<std::vector<GridPoint>> convex_hulls; | ||
| 38 | }; | ||
| 39 | |||
| 40 | using InType = BinaryImage; | ||
| 41 | using OutType = BinaryImage; | ||
| 42 | using TestType = std::tuple<int, std::string>; | ||
| 43 | using BaseTask = ppc::task::Task<InType, OutType>; | ||
| 44 | |||
| 45 | } // namespace nalitov_d_binary | ||
| 46 |