(int[] arr, int len, int num)
| 160 | } |
| 161 | |
| 162 | public static int lessThan(int[] arr, int len, int num) { |
| 163 | int l = 1, r = len, mid, ans = 0; |
| 164 | while (l <= r) { |
| 165 | mid = (l + r) >> 1; |
| 166 | if (arr[mid] < num) { |
| 167 | ans = mid; |
| 168 | l = mid + 1; |
| 169 | } else { |
| 170 | r = mid - 1; |
| 171 | } |
| 172 | } |
| 173 | return ans; |
| 174 | } |
| 175 | |
| 176 | public static void dfsLeft(int u, int fa, int red, int black, long path) { |
| 177 | if (u <= n) { |