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 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 algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > 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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.