[algogeeks] Matchbox Game from Amazon Ninja Coder Challenge 2013

2013-10-28 Thread robin
We have a game of matchboxes with the following rules: * It is a 2-player game. * There are n matchboxes with varying number of matchsticks in them. The n matchboxes are numbered from 1 through n. * The two players take alternating turns. * Both players can count how many matchsticks are

Re: [algogeeks] Stone Game

2011-10-13 Thread Gaurav Kumar
I don't see this code considers the case when after throwing i stones, the pile is still left with (Si-i) stones. For example, let say pile 10 had 25 stones, now even after throwing 10 stones, pile 25 would be left with 15 stones, which could again be thrown by the next person. Am I missing

Re: [algogeeks] Stone Game

2011-10-13 Thread Gaurav Kumar
Note that the problem says that the pile has AT LEAST i stones not exactly i stones. So it can for sure have more than i. On Thu, Oct 13, 2011 at 4:50 PM, Gaurav Kumar gkuma...@gmail.com wrote: I don't see this code considers the case when after throwing i stones, the pile is still left with

[algogeeks] Stone Game

2011-10-12 Thread Wladimir Tavares
In the problem Stone Game http://www.spoj.pl/problems/RESN04/ , I did the following algorithm that was accepted by spoj: #includestdio.h int main(){ int n,t,i,j,cont; scanf(%d,t); while(t--){ scanf(%d,n); cont=0; for(i=1;i=n;i++) { scanf(%d,j); if(j=i){

Re: [algogeeks] Stone Game

2011-10-12 Thread Hatta
being accepted doesn't imply in being correct maybe I'm wrong but given this Test Case I think BOB wins: 3 1 3 2 didn't he (bob!)? On Wed, Oct 12, 2011 at 6:53 PM, Wladimir Tavares wladimir...@gmail.com wrote: In the problem Stone Game , I did the following algorithm that was accepted by

Re: [algogeeks] Stone Game

2011-10-12 Thread sunny agrawal
your solution seems to be the right one... testcases may be faulty try submitting here http://www.codechef.com/problems/RESN04/ both the codes On Thu, Oct 13, 2011 at 5:44 AM, Hatta tmd...@gmail.com wrote: being accepted doesn't imply in being correct maybe I'm wrong but given this Test Case

[algogeeks] Poker Game

2011-05-06 Thread Ashish Goel
We have been given a deck of cards and each combination has a rating eg 3 As is higher than 2 As 1K etc. Write an algorithm such that the probability of picking 3 or 5 or 7 cards from the deck results in high rating. I understand that such a question has been asked in Amazon Best Regards

[algogeeks] Global Game jam 2010

2010-01-21 Thread Swarandeep Singh
Global Game Jam 2010, India Global Game Jam is a collaborative game development event focused towards bringing talented individuals together to develop open source games in a very short span of time (48 hours).Participants rapidly prototype video game designs and inject new ideas to help develop

[algogeeks] Global Game jam 2010

2010-01-21 Thread Swarandeep Singh
Global Game Jam 2010, India Global Game Jam is a collaborative game development event focused towards bringing talented individuals together to develop open source games in a very short span of time (48 hours).Participants rapidly prototype video game designs and inject new ideas to help develop

[algogeeks] interesting game

2009-09-30 Thread nikhil
we have all the numbers written from 1- n. 2 players play alternatively. At any turn , a player removes a number and along with all its divisors present in the list. Player to remove last number wins. so given initial number n and player who is starting first , we are to find who wins if both

[algogeeks] The Game

2007-02-21 Thread Manish Garg
hi, I m posting a game, its like this: Suppose N people are playing the game. All of them are numbered from 1 to N. They all sit in a circle such that their numbering order is also maintained, so that the last person (numbered N) sits adjacent to the first person (numbered 1). Now an integer K