There are N egg baskets and the number of eggs in each
basket is a known quantity. Two players take turns to remove
these eggs from the baskets. On each turn, a player must
remove at least one egg, and may remove any number of eggs
provided they all belong to the same basket. The player
picking the last egg(s) wins the game. If you are allowed to
decide who is going to start first, what mathematical
function would you use to decide so that you end up on the
winning side?
Answer Posted / rahul
N%2
if it gives 0 then the person can choose to go second.if
nonzero then he should go first.But this logic is acceptable
only if there is atleast one egg in each basket.
Is This Answer Correct ? | 2 Yes | 7 No |
Post New Answer View All Answers
Why isn't any of this standardized in c? Any real program has to do some of these things.
What is anagram in c?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
What is the difference between strcpy() and memcpy() function in c programming?
What are structure types in C?
Explain why can’t constant values be used to define an array’s initial size?
What is a macro?
What is the use of volatile?
how to execute a program using if else condition and the output should enter number and the number is odd only...
What is the difference between near, far and huge pointers?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
What are the advantages of using Unions?
What is the difference between int main and void main in c?
What is function what are the types of function?
Tell me what is the purpose of 'register' keyword in c language?