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
which type of aspect you want from the student.
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
How the c program is executed?
What is an lvalue?
How many levels of pointers can you have?
What are the preprocessor categories?
What is realloc in c?
Why should I use standard library functions instead of writing my own?
What language is c written?
When is a “switch” statement preferable over an “if” statement?
What is the difference between array and linked list in c?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
List some applications of c programming language?
What is the scope of local variable in c?