Initialize sum as zero for all test cases ie inside 1st for loop.
On Jun 21, 2012 5:22 PM, Mayank Singh singh13490may...@gmail.com wrote:
here is my code :
#includestdio.h
#includestdlib.h
int main()
{
long long cand,sum;
int T,N,i,j,*temp;
scanf(%d,T);
temp=
Can't we use k iterations of bubble sort ?
On Jun 18, 2012 2:11 PM, Ramindar Singh ramin...@gmail.com wrote:
We can use Median of medians
http://en.wikipedia.org/wiki/Selection_algorithm#Linear_general_selection_algorithm_-_Median_of_Medians_algorithm
On Sunday, 17 June 2012 08:13:18
i think it can be done by counting the no of starting heaps with 1 coins in
it before any heap with coin1 in it. if all the heaps have only one coin
that player1 win if heap%2==1
if there is any heap with 1 then player1 win if (starting heap with 1 coin
in them)%2==0.
eg
player 1 win in case 1 of