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
What is 1d array in c?
if p is a string contained in a string?
What are variables c?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
What are categories used for in c?
Describe the modifier in c?
Can we change the value of #define in c?
Why is c so important?
Why malloc is faster than calloc?
What is static memory allocation? Explain
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
What is #include stdio h and #include conio h?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
What is volatile c?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none