| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "likhanov_m_elem_vec_sum/seq/include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include <cstdint> | ||
| 4 | |||
| 5 | #include "likhanov_m_elem_vec_sum/common/include/common.hpp" | ||
| 6 | |||
| 7 | namespace likhanov_m_elem_vec_sum { | ||
| 8 | |||
| 9 | 40 | LikhanovMElemVecSumSEQ::LikhanovMElemVecSumSEQ(const InType &in) { | |
| 10 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 11 | 40 | GetInput() = in; | |
| 12 | GetOutput() = 0; | ||
| 13 | 40 | } | |
| 14 | |||
| 15 | 40 | bool LikhanovMElemVecSumSEQ::ValidationImpl() { | |
| 16 | 40 | return GetInput() >= 0; | |
| 17 | } | ||
| 18 | |||
| 19 | 40 | bool LikhanovMElemVecSumSEQ::PreProcessingImpl() { | |
| 20 | 40 | return true; | |
| 21 | } | ||
| 22 | |||
| 23 | 40 | bool LikhanovMElemVecSumSEQ::RunImpl() { | |
| 24 | 40 | const int64_t n = GetInput(); | |
| 25 | |||
| 26 | int64_t sum = 0; | ||
| 27 |
2/2✓ Branch 0 taken 8888 times.
✓ Branch 1 taken 40 times.
|
8928 | for (int64_t i = 1; i <= n; ++i) { |
| 28 | 8888 | sum += i; | |
| 29 | } | ||
| 30 | |||
| 31 | 40 | GetOutput() = sum; | |
| 32 | 40 | return true; | |
| 33 | } | ||
| 34 | |||
| 35 | 40 | bool LikhanovMElemVecSumSEQ::PostProcessingImpl() { | |
| 36 | 40 | return true; | |
| 37 | } | ||
| 38 | |||
| 39 | } // namespace likhanov_m_elem_vec_sum | ||
| 40 |