(int num)
| 66 | public static int cntt = 0; |
| 67 | |
| 68 | public static int kth(int num) { |
| 69 | int left = 1, right = s, mid; |
| 70 | while (left <= right) { |
| 71 | mid = (left + right) / 2; |
| 72 | if (sorted[mid] == num) { |
| 73 | return mid; |
| 74 | } else if (sorted[mid] < num) { |
| 75 | left = mid + 1; |
| 76 | } else { |
| 77 | right = mid - 1; |
| 78 | } |
| 79 | } |
| 80 | return -1; |
| 81 | } |
| 82 | |
| 83 | public static void prepare() { |
| 84 | for (int i = 1; i <= n; i++) { |