The task itself is as follows:
There are 3n coins, among which there is a fake (heavier than all the others). It is required to determine the number of a counterfeit coin using weights without weights with exactly n weighings. The user enters 0 if the balance is balanced.
- If outweighed the left bowl.
- If outweighed the right bowl.
After each entry, 0, 1, or 2 outputs the new intervals of the array. I do not know how to organize a function so that it divides the array into 3 parts.
for (int i = 0; i <=1*p/3; i++) { arr1[i]=arr[i]; } for (int i = 1*p/3; i <=2*p/3; i++) { arr2[i]=arr[i]; } for (int i = 2*p/3; i <=p; i++) { arr3[i]=arr[i]; }
std::vectorbetter to replace. - KoVadim