| 49 | } |
| 50 | |
| 51 | int GetConfilctCount(const std::vector<bool>& mark, const int* indices, int num_indices, int max_cnt) { |
| 52 | int ret = 0; |
| 53 | for (int i = 0; i < num_indices; ++i) { |
| 54 | if (mark[indices[i]]) { |
| 55 | ++ret; |
| 56 | if (ret > max_cnt) { |
| 57 | return -1; |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | return ret; |
| 62 | } |
| 63 | void MarkUsed(std::vector<bool>* mark, const int* indices, int num_indices) { |
| 64 | auto& ref_mark = *mark; |
| 65 | for (int i = 0; i < num_indices; ++i) { |