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
something here?



On Wed, Oct 12, 2011 at 5:19 PM, sunny agrawal <[email protected]>wrote:

> 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 <[email protected]> wrote:
>
>> 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 <[email protected]>
>> wrote:
>> > In the problem Stone Game , I did the following algorithm that was
>> accepted
>> > by spoj:
>> >
>> > #include<stdio.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){
>> >         cont+=j/i;
>> >       }
>> >     }
>> >
>> >   if(cont%2==0)
>> >     printf("BOB\n");
>> >   else
>> >      printf("ALICE\n");
>> >
>> > }
>> > return 0;
>> > }
>> >
>> > A friend of mine made the following code, which was also accepted by
>> spoj:
>> >
>> > #include <stdio.h>
>> > #include <iostream>
>> > #include <stack>
>> > #include <queue>
>> > #include <algorithm>
>> > #include <iostream>
>> >
>> > using namespace std;
>> >
>> >
>> >
>> > int main(){
>> >       int n;
>> >       cin >> n;
>> >       while(n--)
>> >               cout << "ALICE" << endl;
>> >       return 0;
>> > }
>> >
>> >
>> >
>> > I could not prove because Alice always wins. Does anyone know how to
>> prove
>> > this fact?
>> >
>> >
>> >
>> > Wladimir Araujo Tavares
>> > Federal University of CearĂ¡
>> > Homepage | Maratona |
>> >
>> >
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Algorithm Geeks" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> > [email protected].
>> > For more options, visit this group at
>> > http://groups.google.com/group/algogeeks?hl=en.
>> >
>>
>>
>>
>> --
>> Hatta
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Sunny Aggrawal
> B.Tech. V year,CSI
> Indian Institute Of Technology,Roorkee
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to